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
cxxopts: fix darwin build #122800
cxxopts: fix darwin build #122800
Conversation
Result of 2 packages built successfully:
1 suggestion:
Result of 2 packages built successfully:
1 suggestion:
|
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.
Maybe you can ask upstream to make a release with those fixes?
Anyway, I think we should rather mark it as broken.
@@ -17,11 +17,14 @@ stdenv.mkDerivation rec { | |||
|
|||
doCheck = true; | |||
|
|||
# Conflict on case-insensitive filesystems. | |||
dontUseCmakeBuildDir = true; |
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.
Why not provide an alternative cmakeDir
?
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.
This just seemed more concise and doesn't fail. I think an alternate dir would look like:
{
dontUseCmakeBuildDir = true;
preConfigure = ''
mkdir _build
cd _build
cmakeDir=..
'';
}
Maybe you can ask upstream to make a release with those fixes?
I'm not familiar with these packages to know what that would do with ydotool.
Anyway, I think we should rather mark it as broken.
Good point, I made a change for this.
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.
I think an alternate dir would look like
Never mind, yours looks definitely cleaner.
I'm not familiar with these packages to know what that would do with ydotool.
Let's hope @WilliButz can give some advice.
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.
{
dontUseCmakeBuildDir = true;
preConfigure = ''
mkdir _build
cd _build
cmakeDir=..
'';
}
That's essentially what the cmake hook does anyway. I think dontUseCmakeBuildDir = true;
is fine. Shouldn't affect installation.... dependning on upstream's logic.
6f747a3
to
5163e99
Compare
You might be able to get rid of the error by setting cmake flag CXXOPTS_BUILD_EXAMPLES to OFF to not build the example code. This should probably have been done anyway. Also, the pname warning was another error on my part. I don’t understand where the build directory already existing error is coming from that is prompting this change? |
I wasn’t really clear with the quoted output, but everything is compiled with that compiler flag, not just examples. The conflict is because the source dir contains a file |
Yeah, it might still come up with the tests, but I don’t think the examples should be built by default. The decision of whether to build the examples and the tests is implicitly controlled by
If dontUseCmakeBuildDir is triggering that, that may be why the error started occurring, and the alt dir suggestion might avoid it. Though I agree that patching would be the best solution if it doesn’t break ydotool; it would be preferable to use the more succinct syntax and have the unit tests run on all platforms. |
This change will allow cxxopts to build on macOS using the current rev pinned in master:
The crucial line being:
Turning off building the examples should be unnecessary, but I think I should have done this the first time and it eliminates 'example' from being unnecessarily generated or included in other package's dependencies. I did look into trying to set CMAKE_CXX_FLAGS or CXXFLAGS manually to all the flags that cxxopts would have set in the current version sans the suggest-override flag that the current version of clang in nix doesn't support, but I couldn't figure out the proper syntax or find a working example. Obviously it's not great, but since it will continue to build on other platforms with warnings enabled and I don't expect there to be many platform differences, and since upstream maintainers are really responsible for the sort of warnings it would generate, I think it's better than breaking it on macOS. But I agree the ideal would be to update it to include the patch. I bumped it myself locally and it built fine, so if ydotool can do that, I would favor bumping the version to switching off the warnings. |
5163e99
to
6e4c786
Compare
Looks good, I've updated the PR with your changes. :) |
@ofborg build cxxopts |
meta = with lib; { | ||
homepage = "https://github.com/jarro2783/cxxopts"; | ||
description = "Lightweight C++ GNU-style option parser library"; | ||
license = licenses.mit; | ||
maintainers = [ maintainers.spease ]; | ||
platforms = platforms.all; |
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.
Why did you remove this?
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.
I was asked to remove this in another review. Assumed it meant the same when nothing was specified?
Regardless, it probably shouldn't be in this PR. I'll remove it.
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.
probably because it's the default. But i don't think it detracts from readability since meta is at the bottom of the file anyway.
Co-authored-by: Steven Pease <peasteven@gmail.com>
6e4c786
to
21a0704
Compare
@ofborg build cxxopts |
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.
Motivation for this change
Darwin Hydra failure: https://hydra.nixos.org/build/142025157/log
I've been trying to fix the Darwin build, and the change here solves the immediate error from the log above, however it then fails with:
This appears to have been fixed upstream, but there is no new release. I'm hesitant to upgrade the unstable version used here, because it is linked to the version of ydotool, which is also Linux only. Cherry picking the change would also be a custom patch in this case. So we're stuck, hence I propose we flag it as Linux-only.
ZHF: #122042
cc @NixOS/nixos-release-managers
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)