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
sentencepiece: remove static library from the output #99645
Conversation
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
, cmake | ||
, gperftools | ||
|
||
, enableStatic ? false |
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.
there should be a related:
sentencepiece = super.sentencepiece.override {
enableStatic = true;
};
in pkgs/top-level/static.nix
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! I have added this. I have also disabled building of shared libraries in static builds.
I also added a commit which puts gperftools
in buildInputs
rather than nativeBuildInputs
.
However, building sentencepiece
statically fails, because building gperftools
fails with:
libtool: link: x86_64-unknown-linux-musl-g++ -std=gnu++11 -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -Wno-unused-result -fsized-deallocation -faligned-new -DNO_FRAME_POINTER -g -O2 -o stacktrace_unittest src/tests/stacktrace_unittest.o ./.libs/libstacktrace.a ./.libs/liblogging.a ./.libs/libfake_stacktrace_scope.a /nix/store/yzda7vvxr4zpmmlp5bfb22s075dm3dhf-x86_64-unknown-linux-musl-stage-final-gcc-debug-9.3.0-lib/x86_64-unknown-linux-musl/lib/../lib64/libstdc++.so -lm -Wl,-rpath -Wl,/nix/store/yzda7vvxr4zpmmlp5bfb22s075dm3dhf-x86_64-unknown-linux-musl-stage-final-gcc-debug-9.3.0-lib/x86_64-unknown-linux-musl/lib/../lib64 -Wl,-rpath -Wl,/nix/store/yzda7vvxr4zpmmlp5bfb22s075dm3dhf-x86_64-unknown-linux-musl-stage-final-gcc-debug-9.3.0-lib/x86_64-unknown-linux-musl/lib/../lib64
/nix/store/9nh6bp6w99kyjsa1gi6ynd3vxp1x66xl-x86_64-unknown-linux-musl-binutils-2.31.1/bin/x86_64-unknown-linux-musl-ld: attempted static link of dynamic object `/nix/store/yzda7vvxr4zpmmlp5bfb22s075dm3dhf-x86_64-unknown-linux-musl-stage-final-gcc-debug-9.3.0-lib/x86_64-unknown-linux-musl/lib/../lib64/libstdc++.so'
Seems to be the same issue as #76873.
Unfortunately, sentencepiece does provide a CMake option to disable static builds. So just remove it from the output, unless static builds are enabled.
6d7b39c
to
28adb93
Compare
I will close this PR for the time being, using sentencepiece as a shared library can currently lead to issues: |
Motivation for this change
Unfortunately, sentencepiece does provide a CMake option to disable
static builds. So just remove it from the output, unless static builds
are enabled.
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)