Fix bug with using this project on flake builds of nontrivial packages#10
Open
farberbrodsky wants to merge 1 commit intodanielbarter:mainfrom
Open
Fix bug with using this project on flake builds of nontrivial packages#10farberbrodsky wants to merge 1 commit intodanielbarter:mainfrom
farberbrodsky wants to merge 1 commit intodanielbarter:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
why and background
I was trying to use this project to make compile commands for a larger project that I wanted to get into, but it didn't work out of the box, given that I was determined to use a pure flake build. After seeing that
hellofrom the example does work, I proceeded to something medium sized,jq. It didn't work either, and so I started debugging how the stdenv works and stuff. My work is not well documented but I am working in https://github.com/farberbrodsky/nix_mini_compile_commands_experiment .reproduction
Anyways, to reproduce the error, try running
nix buildwith the following flake.nix:You would get an error like:
Which is actually because of:
If you change mini-compile-commands's url to be
github:farberbrodsky/mini_compile_commands?rev=c01dfacad0472ba805e472e155e72bc5f6d631f8, the bug is solved!Note that if you want to see the compile_commands.json you actually need to run
nix build ".#default.out"because the first output isn't called "out".solution
change
extraBuildInputstoextraNativeBuildInputsbug analysis
looking around the comments in the stdenv's script, specifically the function
activatePackage, it says that:I think this is the cause and have not gone further in triaging this. But it really makes sense that this is a Native build input, as it is a part of running the compiler, not a part of any compiled program.
footnote
Really cool project, feels well designed in terms of the scope of the hook you added to nixpkgs. Let's hope that everything else works but I might have another pull request :)