-
-
Notifications
You must be signed in to change notification settings - Fork 475
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
Add Nix CI #86
base: main
Are you sure you want to change the base?
Add Nix CI #86
Conversation
Obviously, every change to the source will result in having to rebuild everything. However, at the moment, the whole repository is marked as source. This means that even non-code changes or build artifacts will trigger a rebuild. This is not a real problem for the CI, but may be annoying when doing local development. Having the relevant sources in one folder would make it a lot easier to only select source files for the build input. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looking good. After you filed an issue about Nix for the first time for mold, I investigated a little about Nix, and it looks like it is a good fit for testing mold.
IIUC, one caveat I found in Nix is that a package's hash consists of all hashes of all inputs which are used to build the package. Even if two build results happen to yield the exact same binary, if the toolchains used for building them are different, the results will have different hashes. And that makes other packages' hash values transitively different. So, if we make a code change that doesn't affect the linker's outputs, it still invalidates all binary package caches. Looks like it is a unfortunate consequence how Nix computes package hashes. Anyways, this is not a comment to your code, though.
default.nix
Outdated
nativeBuildInputs = with pkgs; [ clang_12 cmake lld_12 tbb xxHash zlib openssl git ]; | ||
dontUseCmakeConfigure = "true"; | ||
buildPhase = "make -j $NIX_BUILD_CORES"; | ||
installPhase = "mkdir -p $out $out/bin $out/share/man/man1 && PREFIX=$out make install"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The directories are automatically created if not exist. So make PREFIX=$out install
should work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, the current failure is a "no such file or directory", probably related to removing the mkdir
.
Thanks for the review. The hashes are indeed a problem. People are already working on this, see for example NixOS/rfcs#62, but it's a really hard problem so it will take some time. My packaging of |
It looks like CI failed. Can you take a look? |
Silly mistake, I should have tried it out locally. It's a bit annoying that you have to enable the CI for my PR every time I push :( |
@piegamesde I simply submit a PR to my own fork to test, that way I don't have to wait on approval during testing. |
2c6037b
to
d821445
Compare
c008ee2
to
cfccfc2
Compare
20d1729
to
2464a55
Compare
28b2820
to
7a8c14a
Compare
803547d
to
8f0acbf
Compare
f797b76
to
a44de89
Compare
4652763
to
230976a
Compare
192efa1
to
a1711b9
Compare
ccf2cda
to
7d91674
Compare
bf2c440
to
df9e997
Compare
cc86039
to
25d02bb
Compare
Let me know what you think. Closes #81