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

meson.build:54:8: ERROR: Automatic wrap-based subproject downloading is disabled #47

Open
jcurtis-cc opened this issue Jun 15, 2023 · 4 comments

Comments

@jcurtis-cc
Copy link

Hi there,

Nix flake working "out of the box" sounds wonderful. After spending a few hours trying to use it on MacOS and Ubuntu and Alpine containers I'm still not getting past:

meson.build:54:8: ERROR: Automatic wrap-based subproject downloading is disabled

Any tips?

@jcurtis-cc
Copy link
Author

After installing nix in the container this is the command I'm running:

nix shell github:hdoc/hdoc --extra-experimental-features flakes --extra-experimental-features nix-command --no-write-lock-file

@hdoc
Copy link
Owner

hdoc commented Jun 15, 2023

If you're in a Nix shell then you can build hdoc using the normal commands like in the readme:

meson build             # Configure the build directory
ninja -C build          # Compile hdoc binaries and tests
./build/hdoc --verbose  # Run hdoc over itself, saving the HTML documentation to ./hdoc-output/

Alternatively, it's possible to build hdoc with the Nix build system but Nix enforces purity requirements which makes downloading project source from the internet impossible. It's possible to define all the project sources as part of the Nix flake but I would encourage you to try building in the interactive shell first.

@eli-schwartz
Copy link

Relevant: #25 (comment)

Maybe time to switch from subproject(), and over to the combination of dependency() + --wrap-mode=forcefallback?

@hdoc
Copy link
Owner

hdoc commented Aug 22, 2023

The issue here is that Nix expects a hermetic build environment with no network access. Meson, when it notices that the wraps are not present locally, will try to access the network to download the wraps. This causes the Nix build to fail. The solution is to specify the exact hashes of all the wrap sources as well as the Meson patches (where applicable) so that Nix knows about them. Then, Nix will go and download them and place them in the correct location during the build so that Meson has the wraps locally and doesn't need to download them.

We have this implemented internally and will be releasing a new Nix Flake with this functionality as part of our next release. I will make a comment on this PR when that happens.

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

No branches or pull requests

3 participants