libstore: Make sure that initNix has been called#7478
Merged
thufschmitt merged 1 commit intoNixOS:masterfrom Jan 2, 2023
Merged
libstore: Make sure that initNix has been called#7478thufschmitt merged 1 commit intoNixOS:masterfrom
thufschmitt merged 1 commit intoNixOS:masterfrom
Conversation
roberth
commented
Dec 19, 2022
| call upon the programmer to handle this correctly. However, we only add | ||
| this in a key locations, so as not to litter the code. */ | ||
| void assertLibStoreInitialized(); | ||
|
|
Member
Author
There was a problem hiding this comment.
I would have done this simply at the initNix level, but the library layering does not allow this.
Perhaps the common parts of initialization should be moved into libutil?
Prevent bugs like cachix/cachix#477
1817cbc to
aba6eb3
Compare
thufschmitt
approved these changes
Jan 2, 2023
Contributor
|
Discussed in Nix team meeting 2022-12-23:
|
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
Contributor
|
Discussed in Nix team meeting 2023-01-02:
|
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
Ma27
added a commit
to Ma27/nix
that referenced
this pull request
Jan 28, 2023
Since NixOS#7478 it's mandatory that `initNix()` is called for store operations. However that's not the case when running `openStore()` in Perl using the perl-bindings. That breaks e.g. `hydra-eval-jobset` when built against Nix 2.13 which uses small portions of the store API. The `-lnixmain` is necessary to make sure that `$out/lib/perl5/site_perl/5.36.0/x86_64-linux-thread-multi/auto/Nix/Store/Store.so` is linked against `libnixmain.so` which exposes the `initNix` symbol.
Ma27
added a commit
to Ma27/nix
that referenced
this pull request
Jan 28, 2023
Since NixOS#7478 it's mandatory that `initNix()` is called for store operations. However that's not the case when running `openStore()` in Perl using the perl-bindings. That breaks e.g. `hydra-eval-jobset` when built against Nix 2.13 which uses small portions of the store API. The `-lnixmain` is necessary to make sure that `$out/lib/perl5/site_perl/5.36.0/x86_64-linux-thread-multi/auto/Nix/Store/Store.so` is linked against `libnixmain.so` which exposes the `initNix` symbol.
7 tasks
Member
|
FYI this appears to break the perl bindings that are used by e.g. Hydra. Fix is in #7705. |
Ma27
added a commit
to Ma27/nix
that referenced
this pull request
Feb 2, 2023
Since NixOS#7478 it's mandatory that `initNix()` is called for store operations. However that's not the case when running `openStore()` in Perl using the perl-bindings. That breaks e.g. `hydra-eval-jobset` when built against Nix 2.13 which uses small portions of the store API. The `-lnixmain` is necessary to make sure that `$out/lib/perl5/site_perl/5.36.0/x86_64-linux-thread-multi/auto/Nix/Store/Store.so` is linked against `libnixmain.so` which exposes the `initNix` symbol.
Ma27
added a commit
to Ma27/nix
that referenced
this pull request
Feb 2, 2023
Since NixOS#7478 it's mandatory that `initLibStore()` is called for store operations. However that's not the case when running `openStore()` in Perl using the perl-bindings. That breaks e.g. `hydra-eval-jobset` when built against Nix 2.13 which uses small portions of the store API.
Ma27
added a commit
to Ma27/nix
that referenced
this pull request
Feb 2, 2023
Since NixOS#7478 it's mandatory that `initLibStore()` is called for store operations. However that's not the case when running `openStore()` in Perl using the perl-bindings. That breaks e.g. `hydra-eval-jobset` when built against Nix 2.13 which uses small portions of the store API.
github-actions bot
pushed a commit
that referenced
this pull request
Feb 3, 2023
Since #7478 it's mandatory that `initLibStore()` is called for store operations. However that's not the case when running `openStore()` in Perl using the perl-bindings. That breaks e.g. `hydra-eval-jobset` when built against Nix 2.13 which uses small portions of the store API. (cherry picked from commit 51013da)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prevent bugs like cachix/cachix#477