Skip to content
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

zstd: install static libraries to dev #90218

Closed
wants to merge 1 commit into from

Conversation

veprbl
Copy link
Member

@veprbl veprbl commented Jun 13, 2020

Achieved by patching cmake "install()" directive to ensure that
$dev/lib/cmake is generated with correct paths.

If we don't want to build static libraries we should be setting
ZSTD_BUILD_STATIC to OFF instead.

Fixes: 7f76daa ('zstd: get rid of static libs if enableShared')

Motivation for this change

Fixes some of the fallout from #78910

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Achieved by patching cmake "install()" directive to ensure that
$dev/lib/cmake is generated with correct paths.

If we don't want to build static libraries we should be setting
ZSTD_BUILD_STATIC to OFF instead.

Fixes: 7f76daa ('zstd: get rid of static libs if enableShared')
Copy link
Member

@Ericson2314 Ericson2314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the old way better. Everything expects libraries in lib, and this will lead to tons of unfortunate conditions downstream. I say just have separate builds, or have e.g. dev-static and libs-static so we have two drop-in replacements that can be used instead of the originals without downstream knowing.

@Ericson2314
Copy link
Member

ZSTD_BUILD_STATIC is an improvement on just deleting after the fact, I do agree with that.

@vcunat
Copy link
Member

vcunat commented Jun 20, 2020

Yes, I also think the explicit way seemed less problematic (generally). One stumbling point is that pkgconfig (and maybe other tools) can have just a single libdir.

@vcunat
Copy link
Member

vcunat commented Jun 20, 2020

If we don't want to build static libraries we should be setting ZSTD_BUILD_STATIC to OFF instead.

See the code comment:

# They require STATIC for bin/zstd and tests.

I didn't investigate why... it seemed a little weird that the binary can't be linked against the dynamic library.

@Ericson2314
Copy link
Member

Ericson2314 commented Jun 20, 2020

Ah OK. Well hopefully we can patch to remove that restriction, eventually. Regardless of all this, one wants to test the build they're actually using, whatever that may be.

@veprbl
Copy link
Member Author

veprbl commented Jul 6, 2020

Closing in favour of #91984

@veprbl veprbl closed this Jul 6, 2020
Staging automation moved this from Needs review to Done Jul 6, 2020
@veprbl veprbl deleted the pr/zstd_fix_static branch July 6, 2020 01:56
@veprbl veprbl restored the pr/zstd_fix_static branch December 1, 2020 16:47
@veprbl veprbl deleted the pr/zstd_fix_static branch December 1, 2020 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Staging
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants