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
arrow-cpp: add pkgsStatic support #75798
Conversation
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.
Great stuff!
Overall requests:
- For packages that allow configuring the building of static and shared libs separately (thus, also allow building both of them), can we used the argument names
enableStatic ? false
andenableShared ? true
instead of a singlestatic ? false
argument?
That makes it a lot more obvious to figure out what exactly the option does. So far in nixpkgs, the semantics of juststatic
is quite inconsistent: For some packages it additionally enables static libs, for some others it turns off shared libs and builds only static, and for a few (likezlib
) it puts static libs into a separate.static
output. - For the few packages that (usually for not-so-great reasons / bad upstream packaging reasons) allow only static XOR shared libs, could you point that out with a comment?
Thanks!
One more thing: This PR should be targeting staging. |
0c315c5
to
ffb4791
Compare
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.
For packages that allow configuring the building of static and shared libs separately (thus, also allow building both of them), can we used the argument names enableStatic ? false and enableShared ? true instead of a single static ? false argument?
That makes it a lot more obvious to figure out what exactly the option does. So far in nixpkgs, the semantics of just static is quite inconsistent: For some packages it additionally enables static libs, for some others it turns off shared libs and builds only static, and for a few (like zlib) it puts static libs into a separate .static output.
For the few packages that (usually for not-so-great reasons / bad upstream packaging reasons) allow only static XOR shared libs, could you point that out with a comment?
In my opinion it is the other way around. Allowing the option to build static and shared libs in the same build tree is handing a foot gun to the libraries users. Upstream projects often do it anyway to either be more flexible in their development or for packaging for traditional distributions where everything goes to /usr/lib
and the packager has no information about how the library will be used. But in nixpkgs exactly that information is available through that option, and with that any reason to put both into a build is gone.
Consequently, I think static
is the correct name for that option and it would be better to change the existing packages that currently use a different interpretation for static
.
I wasn't able to remove the python restriction. The actual culprit is openblas, which currently does not build with the |
@tobim I have tried your approach in the past (for static-haskell-nix) and and found it forbiddingly much effort:
|
I admit I did not consider TemplateHaskell while formulating my argument.
I'm not arguing for zlib-style split outputs though. I think static libs should live in the
From the point of view of a nixpkgs user these options are implementation details that should be confined to the package expression, but abstracted away in the interface. |
ffb4791
to
e2c1471
Compare
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.
Changes to the arrow-cpp
LGTM
e2c1471
to
a939f01
Compare
This comment has been minimized.
This comment has been minimized.
2820dce
to
0d39262
Compare
I applied that without changes. But lets merge #76659 first. |
Regarding upstreaming the patch to woff2: I don't have high hopes that it would be successful, look at google/woff2#112, which tries to address the same issue (but did not work for me). I opened https://gitlab.kitware.com/cmake/cmake/issues/20136 instead, that might at least get us a cleaner way for interacting with pkgconfig in a static context. |
@GrahamcOfBorg build thrift |
0d39262
to
db5d3cd
Compare
@GrahamcOfBorg build thrift |
@GrahamcOfBorg build pkgsCross.mingwW64.zstd |
+if(NOT BUILD_SHARED_LIBS) | ||
+ set(_S "STATIC_") | ||
+endif() | ||
+set(BROTLIDEC_LIBRARIES ${PC_BROTLIDEC_${_S}LIBRARIES}) |
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.
It seems like the only reason why we need this is because we are applying google/brotli#655 which is not upstream yet. The problem is that other than fixing BUILD_SHARED_LIBS it also sneakily does this:
-target_link_libraries(brotlidec-static brotlicommon-static)
-target_link_libraries(brotlienc-static brotlicommon-static)
-
I think the 7ebd599 needs to be reworked to not use unsupported patch. Instead, we could remove the shared libraries and symlink the static ones in their place (also suggested in google/brotli#655 (comment)).
cc @matthewbauer @domenkozar
This looks good to me. In case of regressions we can always revert commits. |
Nice job! 👍 |
In case anyone is looking, this broke |
Fix for the |
Motivation for this change
Things done
Added a static option to zstd, double-conversion, gflags, glog, gtest, woff2, snappy, thrift, and finally arrow-cpp.
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @