Skip to content

pkg build fixes #188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed

pkg build fixes #188

wants to merge 8 commits into from

Conversation

j1philli
Copy link

based on the knowledge shared here: #185 (comment)
I was able to get pantry packages building with the couple small changes here.
Using shebang #!pkgx +gem ruby did not initially fix the errors I was seeing. I then updated the deprecated deno.run commands being used and that together with the new shebang brought success.

@j1philli j1philli changed the title pkg build fixes pkg build fixes Oct 10, 2023
libexec/fixup.ts Outdated
@@ -20,31 +20,31 @@ const pkg_prefix = new Path(unknown[0])

switch (host().platform) {
case 'darwin': {
const { success } = await Deno.run({
cmd: [
const { output } = new Deno.Command(Deno.execPath(), {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be fix-machos.rb.

It's interesting this works, I guess that deno re-execs shebangs? To be clear this runs the ruby script through deno!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry not following, what should be fix-machos.rb?
fix-machos.rb is run on line 25 no?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are executing deno, this is what Deno.execPath() returns. Replace it with fix-machos.rb

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see.
Couldn't tell in deno.run docs if line 25 and 26 are args or not but saw my mistake with the actual command. Built a package with this and it completely successfully

@@ -1,8 +1,6 @@
#!/usr/bin/env ruby
#!pkgx +gem ruby
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be #!/usr/bin/env -S pkgx +gem ruby. Shebangs have to be full paths if you are running them directly which with the above change will be true.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol. you beat me by seconds.

@j1philli j1philli requested a review from mxcl October 20, 2023 02:17
const { success } = await Deno.run({
cmd: [
'fix-machos.rb',
const { output } = new Deno.Command('fix-machos.rb', {
Copy link
Member

@mxcl mxcl Oct 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn’t run the command: it instantiates it and then exits.

It's worrying that CI passes

@mxcl
Copy link
Member

mxcl commented Oct 20, 2023

I think this PR is not an actual fix for your issues. I am closing it. We need to look deeper into why you are having issues.

Rationale: the only reason it seems like it fixes it is because actually you are no longer running fix-macho.rb

@mxcl mxcl closed this Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants