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
gflags: fix build on case-insensitive filesystems #38157
Conversation
3b90d38
to
2b4b0bb
Compare
@GrahamcOfBorg build gflags |
Success on x86_64-darwin (full log) Attempted: gflags Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: gflags Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: gflags Partial log (click to expand)
|
# a directory called 'build'. To fix building on the case-insensitive | ||
# filesystems commonly seen on darwin machines, rename 'BUILD' so it won't | ||
# conflict with the directory (it's for the unrelated build tool "bazel"). | ||
prePatch = "mv BUILD BUILD.bazel"; | ||
} |
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.
Could you also add meta.platforms, otherwise this won't get built by hydra.
2b4b0bb
to
bd4d928
Compare
bd4d928
to
b70a1af
Compare
@LnL7 Added platforms along with some other metadata. |
Uh sorry for the review pings everyone, I forgot I rebased against 17.09 locally to try my changes out. |
looks like you forgot a semicolon after one of the attributes. |
Darwin machines come with a case-insensitive filesystem by default. The gflags package's source contains a file 'BUILD' and the build process attempts to create a directory called 'build', which fails on case-insensitive filesystems. Add a prePatch hook to rename the BUILD file (which is for use with an unrelated build tool) to something that doesn't conflict with the 'build' directory. This hook allows this derivation to be built on case-insensitive filesystems. Add metadata to the derivation because previously it had none.
b70a1af
to
66bbee3
Compare
@GrahamcOfBorg build gflags |
Success on x86_64-darwin (full log) Attempted: gflags Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: gflags Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: gflags Partial log (click to expand)
|
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.
Thanks!
Also ported to release in 021ee7d. |
Motivation for this change
Darwin machines come with a case-insensitive filesystem by default. The
gflags package's source contains a file 'BUILD' and the build process
attempts to create a directory called 'build', which fails on
case-insensitive filesystems.
Things done
Add a prePatch hook to rename the BUILD file (which is for use with an unrelated build tool).
Tested using sandboxing (nix.useSandbox on NixOS, or option
build-use-sandbox
innix.conf
on non-NixOS)Built on platform(s)
I did not test compilation of all pkgs that depend on this change because this should not produce a change to any machine code
Tested execution of the bash completion script in bin
Fits CONTRIBUTING.md.