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

Cross-compile fails because docs requires running Nix #4622

Open
dramforever opened this issue Mar 9, 2021 · 3 comments
Open

Cross-compile fails because docs requires running Nix #4622

dramforever opened this issue Mar 9, 2021 · 3 comments
Labels

Comments

@dramforever
Copy link
Contributor

dramforever commented Mar 9, 2021

During build, a few documentation-related build targets require running Nix, which is not possible in a cross-compiled situation

nix/doc/manual/local.mk

Lines 56 to 71 in 1c0e3e4

$(d)/nix.json: $(bindir)/nix
$(trace-gen) $(dummy-env) $(bindir)/nix __dump-args > $@.tmp
@mv $@.tmp $@
$(d)/conf-file.json: $(bindir)/nix
$(trace-gen) $(dummy-env) $(bindir)/nix show-config --json --experimental-features nix-command > $@.tmp
@mv $@.tmp $@
$(d)/src/expressions/builtins.md: $(d)/builtins.json $(d)/generate-builtins.nix $(d)/src/expressions/builtins-prefix.md $(bindir)/nix
@cat doc/manual/src/expressions/builtins-prefix.md > $@.tmp
$(trace-gen) $(nix-eval) --expr 'import doc/manual/generate-builtins.nix (builtins.fromJSON (builtins.readFile $<))' >> $@.tmp
@mv $@.tmp $@
$(d)/builtins.json: $(bindir)/nix
$(trace-gen) $(dummy-env) NIX_PATH=nix/corepkgs=corepkgs $(bindir)/nix __dump-builtins > $@.tmp
@mv $@.tmp $@

Ideally this could be generated without running nix. Failing that, a way to disable these (possibly at the cost of losing some documentation) would be great. (Edit --disable-doc-gen, see comment below)

@matthewbauer
Copy link
Member

matthewbauer commented Mar 9, 2021

You can disable them with --disable-doc-gen. I have a working cross-compilation example in #2667.

@dramforever
Copy link
Contributor Author

Thanks for the workaround!

alyssais added a commit to alyssais/nixpkgs that referenced this issue Jun 6, 2021
The documentation for Nix HEAD now requires running the generated Nix
binary, so we can't cross-build it. :(

NixOS/nix#4622
alyssais added a commit to NixOS/nixpkgs that referenced this issue Jun 12, 2021
The documentation for Nix HEAD now requires running the generated Nix
binary, so we can't cross-build it. :(

NixOS/nix#4622
@stale
Copy link

stale bot commented Sep 10, 2021

I marked this as stale due to inactivity. → More info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants