Skip to content

Commit cfd638f

Browse files
committed
Support arbitrary stores in Perl bindings
Fix #9859 It's a breaking change but that's fine; we can just update Hydra to use the new bindings.
1 parent 30bdee5 commit cfd638f

File tree

6 files changed

+190
-79
lines changed

6 files changed

+190
-79
lines changed

perl/.yath.rc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[test]
2+
-I=rel(lib/Nix)

perl/default.nix

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
, nix, curl, bzip2, xz, boost, libsodium, darwin
66
}:
77

8-
perl.pkgs.toPerlModule (stdenv.mkDerivation {
8+
perl.pkgs.toPerlModule (stdenv.mkDerivation (finalAttrs: {
99
name = "nix-perl-${nix.version}";
1010

1111
src = fileset.toSource {
1212
root = ../.;
13-
fileset = fileset.unions [
13+
fileset = fileset.unions ([
1414
../.version
1515
../m4
1616
../mk
@@ -20,7 +20,10 @@ perl.pkgs.toPerlModule (stdenv.mkDerivation {
2020
./configure.ac
2121
./lib
2222
./local.mk
23-
];
23+
] ++ lib.optionals finalAttrs.doCheck [
24+
./.yath.rc
25+
./t
26+
]);
2427
};
2528

2629
nativeBuildInputs =
@@ -40,6 +43,13 @@ perl.pkgs.toPerlModule (stdenv.mkDerivation {
4043
++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium
4144
++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security;
4245

46+
# `perlPackages.Test2Harness` is marked broken for Darwin
47+
doCheck = !stdenv.isDarwin;
48+
49+
nativeCheckInputs = [
50+
perlPackages.Test2Harness
51+
];
52+
4353
configureFlags = [
4454
"--with-dbi=${perlPackages.DBI}/${perl.libPrefix}"
4555
"--with-dbd-sqlite=${perlPackages.DBDSQLite}/${perl.libPrefix}"
@@ -48,4 +58,4 @@ perl.pkgs.toPerlModule (stdenv.mkDerivation {
4858
enableParallelBuilding = true;
4959

5060
postUnpack = "sourceRoot=$sourceRoot/perl";
51-
})
61+
}))

perl/lib/Nix/Store.pm

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,20 @@ our %EXPORT_TAGS = ( 'all' => [ qw( ) ] );
1212
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
1313

1414
our @EXPORT = qw(
15-
setVerbosity
16-
isValidPath queryReferences queryPathInfo queryDeriver queryPathHash
17-
queryPathFromHashPart
18-
topoSortPaths computeFSClosure followLinksToStorePath exportPaths importPaths
15+
Store
16+
Store::new
17+
Store::isValidPath Store::queryReferences Store::queryPathInfo Store::queryDeriver Store::queryPathHash
18+
Store::queryPathFromHashPart
19+
Store::topoSortPaths Store::computeFSClosure followLinksToStorePath Store::exportPaths Store::importPaths
20+
Store::addToStore Store::makeFixedOutputPath
21+
Store::derivationFromPath
22+
Store::addTempRoot
23+
Store::queryRawRealisation
24+
1925
hashPath hashFile hashString convertHash
2026
signString checkSignature
21-
addToStore makeFixedOutputPath
22-
derivationFromPath
23-
addTempRoot
2427
getBinDir getStoreDir
25-
queryRawRealisation
28+
setVerbosity
2629
);
2730

2831
our $VERSION = '0.15';

0 commit comments

Comments
 (0)