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

fmt: Open enableShared option #93101

Closed
wants to merge 1 commit into from

Conversation

ardumont
Copy link
Contributor

Some application (e.g. gerbera) requires the possibility to compile fmt as external.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS,
    • macOS
    • other: debian with nix
  • 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/)
  • impact on package closure size: No change [1]
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

[1] with the following command:

% nix-build --expr "(import <nixpkgs> {}).callPackage ./pkgs/development/libraries/fmt {
  enableShared = (true|false); }"

before:
/nix/store/gijq38rh428pcy7xivbwpwafqv2al4bw-fmt-6.2.1 39607656

after:
/nix/store/bnzn9f2dgdgigad2snahr9fk6x97if21-fmt-6.2.1 39607656

This is required by some applications. This keeps the default behavior.
@doronbehar
Copy link
Contributor

Does merely adding the enabledShared attribute, (without adding say a --enable-shared configure flag) does the job? I never ran into that..

@ardumont
Copy link
Contributor Author

Does merely adding the enabledShared attribute, (without adding say a --enable-shared configure flag) does the job? I never ran into that..

Good question, now i'm wondering if i messed up my analysis (and my checks...)
I'll check.

@ardumont
Copy link
Contributor Author

Does merely adding the enabledShared attribute, (without adding say a --enable-shared configure flag) does the job? I never ran into that..

Good question, now i'm wondering if i messed up my analysis (and my checks...)
I'll check.

Indeed, that does not seem to make any difference (aside triggering a new build).
That'd explain the closure size being the same.

I read back properly this definition, there is "-DBUILD_SHARED_LIBS=ON" in
there now. It's very much what i need.

So that diff is irrelevant! Cool, thanks and sorry for the noise.

And yeah, i should have realized adding that option flag alone was a bit
strange... ¯_(ツ)_/¯

Now, i don't really get why it makes a difference in [1] though but meh

[1] https://github.com/ardumont/mypkgs/blob/master/default.nix#L8-L10

Thanks

@ardumont ardumont closed this Jul 14, 2020
@ardumont ardumont deleted the fmt-add-option-enable-shared branch July 14, 2020 15:05
@ardumont
Copy link
Contributor Author

Now, i don't really get why it makes a difference in [1] though but meh

I have the answer now, tl; dr i upgraded the fmt deps (which is already new in
nixpkgs-unstable). And somehow, I finally conflated this upgrade with that flag
which was a tryout I forgot to drop...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants