Skip to content

icu: Make static linking possible#304772

Merged
7c6f434c merged 1 commit intoNixOS:stagingfrom
NorfairKing:icu-static
Apr 23, 2024
Merged

icu: Make static linking possible#304772
7c6f434c merged 1 commit intoNixOS:stagingfrom
NorfairKing:icu-static

Conversation

@NorfairKing
Copy link
Contributor

Description of changes

Make it possible to statically link against icu.
See #304756

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)

Add a 👍 reaction to pull requests you find important.

@ofborg ofborg bot added the 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. label Apr 17, 2024
@ofborg ofborg bot requested a review from 7c6f434c April 17, 2024 13:04
@ofborg ofborg bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Apr 17, 2024
@7c6f434c
Copy link
Member

Are the rebuilds just because of dontDisableStatic now being false instead of missing (by default)?

Copy link
Member

@symphorien symphorien left a comment

Choose a reason for hiding this comment

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

what is the advantage of this flag in comparison to pkgsStatic.icu ? (which already builds it seems)

@NorfairKing
Copy link
Contributor Author

Are the rebuilds just because of dontDisableStatic now being false instead of missing (by default)?

I guess so, but that surprises me as well.

@NorfairKing
Copy link
Contributor Author

what is the advantage of this flag in comparison to pkgsStatic.icu ? (which already builds it seems)

I'd like to be able to statically link outside of pkgsStatic and "just" using dontDisableStatic = true doesn't cut it for icu.

@NorfairKing
Copy link
Contributor Author

What are the steps to get this merged?

@7c6f434c
Copy link
Member

If you drop that line, the change becomes useless, but does the output path return to the old one?

@NorfairKing
Copy link
Contributor Author

NorfairKing commented Apr 18, 2024

@7c6f434c It took me a while to figure out what you meant, but no the path is different:

git checkout HEAD^
nix build .#icu && ls -l result
lrwxrwxrwx 1 syd users 54 Apr 19 00:57 result -> /nix/store/qwnmd1a9zxfjqgkhv3jyyf86r9jm4gsq-icu4c-73.2
git checkout icu-static
nix build .#icu && ls -l result                  131ms
lrwxrwxrwx 1 syd users 54 Apr 19 00:57 result -> /nix/store/c1m796by7343zg40d90qzr30lgc2k60f-icu4c-73.2

I'm guessing this has something to do with newlines in the postInstall hook.

@7c6f434c
Copy link
Member

But if it changes anything about postInstall while withStatic is not enabled, that means we don't actually understand what it changes, and given that pkgsStatic.icu works if really needed, I'd want to understand which parts here are actually non-no-op in which case…

@NorfairKing
Copy link
Contributor Author

@7c6f434c is there a way to say nix whats-different?

@NorfairKing
Copy link
Contributor Author

@7c6f434c I just confirmed: It's the presence of the dontDisableStatic env var that changes the store hash. That's unavoidable though.

@7c6f434c
Copy link
Member

It is avoidable, but in an ugly way. I wanted it checked that this is the only rebuild-triggering change, though.

@7c6f434c 7c6f434c merged commit 0f21d28 into NixOS:staging Apr 23, 2024
@github-actions
Copy link
Contributor

Backport failed for staging-24.05, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin staging-24.05
git worktree add -d .worktree/backport-304772-to-staging-24.05 origin/staging-24.05
cd .worktree/backport-304772-to-staging-24.05
git switch --create backport-304772-to-staging-24.05
git cherry-pick -x f3dee8a2e201ee0672d4268a062c3ec6f8f855c4

@NorfairKing
Copy link
Contributor Author

I guess it was in 24.05 already ..

@NorfairKing
Copy link
Contributor Author

@7c6f434c I just realised that I added the argument to the wrong function. It should be the former, so that it's overridable, not the later.

@7c6f434c
Copy link
Member

If you add the argument to the upper function, you need to re-call the resulting function after overriding and pass it the source hash again. don't you?

@NorfairKing
Copy link
Contributor Author

@7c6f434c Hm didn't think about it enough maybe. In any case I can't override static now so I still can't use this with pkgsMusl yet :P

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

Labels

10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants