Skip to content
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

hugo-bin fails to install Hugo binary #5514

Closed
gabrielmaldi opened this issue Sep 15, 2023 · 6 comments
Closed

hugo-bin fails to install Hugo binary #5514

gabrielmaldi opened this issue Sep 15, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@gabrielmaldi
Copy link

What version of Bun is running?

1.0.2+37edd5a6e389265738e89265bcbdf2999cb81a49

What platform is your computer?

Darwin 22.6.0 arm64 arm

What steps can reproduce the bug?

bun install hugo-bin

file node_modules/hugo-bin/vendor/hugo # Error: Hugo binary does not exist
bunx hugo version # Error

What is the expected behavior?

bun install hugo-bin

file node_modules/hugo-bin/vendor/hugo # Success: Hugo binary exists
bunx hugo version # Prints Hugo version

What do you see instead?

image

Additional information

Follow-up of #2891 now that process.binding was implemented in #5355

@davidmhewitt
Copy link
Contributor

You would need to add hugo-bin to your trusted dependencies, see:
https://bun.sh/guides/install/trusted

@gabrielmaldi
Copy link
Author

Thank you! I didn't know about that feature and I love Bun's approach there. Adding:

"trustedDependencies": ["hugo-bin"]

worked perfectly.

Now I'm getting an error because the extended version of Hugo is not being installed. This is because hugo-bin reads this configuration from either "hugo-bin": { "buildTags": "extended" } in package.json or hugo_bin_build_tags = "extended" in .npmrc. Neither of these work in Bun (export HUGO_BIN_BUILD_TAGS="extended" does of course but it's not committable).

Is this something Bun would support? Looking at hugo-bin source it reads from process.env.npm_config_hugo_bin_build_tags and uses https://github.com/pkgconf/pkgconf. Maybe Bun isn't allowing dependencies to read package.json?

Thanks again!

@Electroid
Copy link
Contributor

This issue will be fixed, tracking it here: #4959

@Electroid Electroid closed this as not planned Won't fix, can't repro, duplicate, stale Oct 27, 2023
@gabrielmaldi
Copy link
Author

Thank you, @Electroid. I read through the other issue but didn't find anything regarding packages being able to read package.json or .nmprc (see my last comment). Is this something desirable for Bun? Thanks

@Jarred-Sumner
Copy link
Collaborator

The hugo-bin error related to missing postinstall was fixed by @dylan-conway and @paperdave in #7132 .This will be part of the Bun v1.0.17 release, which ships in a few hours from the time of writing.

The other issue regarding missing "config" in package.json is not included in that - can you file a new issue about that?

@gabrielmaldi
Copy link
Author

@Jarred-Sumner, while filing the new issue I just found that now this is working as expected (at least in Bun canary 1.0.17+5e60861c3). Having "hugo-bin": { "buildTags": "extended" } in package.json now makes hugo-bin install the extended version of Hugo (which can be verified with bunx hugo version). Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants