!sUXcTulPzyhnqOiFPL:helsinki-systems.de

NixOS Perl

47 Members
15 Servers

Load older messages


SenderMessageTime
23 Oct 2024
@luna-null:matrix.orgluna-null changed their display name from Autumn to luna-null.09:49:13
25 Oct 2024
@lholh:matrix.orglholh joined the room.03:54:29
@lholh:matrix.orglholh left the room.22:42:00
1 Nov 2024
@tomasajt:matrix.orgToma joined the room.20:07:14
8 Nov 2024
@jschvz:matrix.orgjschvz joined the room.02:57:01
13 Nov 2024
@inayet:matrix.orginayet joined the room.22:15:17
20 Nov 2024
@inayet:matrix.orginayet removed their profile picture.00:59:23
27 Nov 2024
@stigo:matrix.orgstigo changed their display name from stigo to stigo (away).20:49:35
1 Dec 2024
@vcunat:matrix.orgvcunat Is there someone who knows/follows Nix::, i.e. the perl bindings for Nix? 07:59:39
@vcunat:matrix.orgvcunat Apparently <nixpkgs/maintainers/scripts/copy-tarballs.pl> needs some changes to stay compatible with the current default version of Nix. 08:01:42
@stigo:matrix.orgstigoIs there an easy way to test/reproduce?15:07:39
@vcunat:matrix.orgvcunatI could... deploy it :-D 15:13:51
@vcunat:matrix.orgvcunatBut if you run it now, it should fail on line 25 already.15:15:30
@vcunat:matrix.orgvcunat
env NIX_PATH=nixpkgs=. ./maintainers/scripts/copy-tarballs.pl

Undefined subroutine &main::isValidPath called at ./maintainers/scripts/copy-tarballs.pl line 25.
15:15:51
@vcunat:matrix.orgvcunatAfterwards it deals with AWS a lot, so I think deploying it to infra will be the best way to test in this case.15:17:49
@vcunat:matrix.orgvcunat stigo (away): by a quick glance I suspect that we might need some new Nix::Store now and do calls like ->isValidPath(foo) 15:20:37
@stigo:matrix.orgstigo

I think you are right, looking at tests in CppNix src/perl/t/init.t the usage appears to be something like:

my $s = new Nix::Store("dummy://");
my $res = $s->isValidPath("/nix/store/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-bar");
15:48:25
@stigo:matrix.orgstigo Can't see any reason why isValidPath should be exported by default by Nix::Store, so weird if this has worked before? 15:48:51
@stigo:matrix.orgstigo Btw, you should use Nix::Store->new instead of new Nix::Store 15:49:55
@stigo:matrix.orgstigo

Maybe:

diff --git a/maintainers/scripts/copy-tarballs.pl b/maintainers/scripts/copy-tarballs.pl
index 30fbac6f002d..6c25471278f8 100755
--- a/maintainers/scripts/copy-tarballs.pl
+++ b/maintainers/scripts/copy-tarballs.pl
@@ -22,7 +22,9 @@ use JSON;
 use Net::Amazon::S3;
 use Nix::Store;

-isValidPath("/nix/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo"); # FIXME: forces Nix::Store initialisation
+my $store = Nix::Store->new();
+
+$store->isValidPath("/nix/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo"); # FIXME: forces Nix::Store initialisation

 sub usage {
     die "Syntax: $0 [--dry-run] [--exclude REGEXP] [--expr EXPR | --file FILES...]\n";
@@ -216,12 +218,12 @@ elsif (defined $expr) {
             }

             # Substitute the output.
-            if (!isValidPath($storePath)) {
+            if (!$store->isValidPath($storePath)) {
                 system("nix-store", "-r", $storePath);
             }

             # Otherwise download the file using nix-prefetch-url.
-            if (!isValidPath($storePath)) {
+            if (!$store->isValidPath($storePath)) {
                 $ENV{QUIET} = 1;
                 $ENV{PRINT_PATH} = 1;
                 my $fh;
15:56:48
@stigo:matrix.orgstigo *

Maybe this works, get's rid of the Undefined subrouting error, but not tested of course :D

diff --git a/maintainers/scripts/copy-tarballs.pl b/maintainers/scripts/copy-tarballs.pl
index 30fbac6f002d..6c25471278f8 100755
--- a/maintainers/scripts/copy-tarballs.pl
+++ b/maintainers/scripts/copy-tarballs.pl
@@ -22,7 +22,9 @@ use JSON;
 use Net::Amazon::S3;
 use Nix::Store;

-isValidPath("/nix/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo"); # FIXME: forces Nix::Store initialisation
+my $store = Nix::Store->new();
+
+$store->isValidPath("/nix/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo"); # FIXME: forces Nix::Store initialisation

 sub usage {
     die "Syntax: $0 [--dry-run] [--exclude REGEXP] [--expr EXPR | --file FILES...]\n";
@@ -216,12 +218,12 @@ elsif (defined $expr) {
             }

             # Substitute the output.
-            if (!isValidPath($storePath)) {
+            if (!$store->isValidPath($storePath)) {
                 system("nix-store", "-r", $storePath);
             }

             # Otherwise download the file using nix-prefetch-url.
-            if (!isValidPath($storePath)) {
+            if (!$store->isValidPath($storePath)) {
                 $ENV{QUIET} = 1;
                 $ENV{PRINT_PATH} = 1;
                 my $fh;
15:57:20
@vcunat:matrix.orgvcunat Maybe the forcing of initialization isn't needed now that we use new()? 15:57:46
@stigo:matrix.orgstigo ¯_(ツ)_/¯ 15:58:00
@stigo:matrix.orgstigo * ¯\_(ツ)_/¯ 15:58:04
@stigo:matrix.orgstigo *

Maybe this works, get's rid of the Undefined subroutine error, but not tested of course :D

diff --git a/maintainers/scripts/copy-tarballs.pl b/maintainers/scripts/copy-tarballs.pl
index 30fbac6f002d..6c25471278f8 100755
--- a/maintainers/scripts/copy-tarballs.pl
+++ b/maintainers/scripts/copy-tarballs.pl
@@ -22,7 +22,9 @@ use JSON;
 use Net::Amazon::S3;
 use Nix::Store;

-isValidPath("/nix/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo"); # FIXME: forces Nix::Store initialisation
+my $store = Nix::Store->new();
+
+$store->isValidPath("/nix/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo"); # FIXME: forces Nix::Store initialisation

 sub usage {
     die "Syntax: $0 [--dry-run] [--exclude REGEXP] [--expr EXPR | --file FILES...]\n";
@@ -216,12 +218,12 @@ elsif (defined $expr) {
             }

             # Substitute the output.
-            if (!isValidPath($storePath)) {
+            if (!$store->isValidPath($storePath)) {
                 system("nix-store", "-r", $storePath);
             }

             # Otherwise download the file using nix-prefetch-url.
-            if (!isValidPath($storePath)) {
+            if (!$store->isValidPath($storePath)) {
                 $ENV{QUIET} = 1;
                 $ENV{PRINT_PATH} = 1;
                 my $fh;
16:03:35
@vcunat:matrix.orgvcunatWith some additional changes this worked. But it uncovered annoying nix issues, so it really is better to stay with the older version for now 😢17:44:58
@vcunat:matrix.orgvcunatBut thank you 17:45:23
@vcunat:matrix.orgvcunat🙂17:45:41
3 Dec 2024
@stigo:matrix.orgstigo changed their display name from stigo (away) to stigo.00:52:10
26 Dec 2024
@10leej:matrix.orgnevoyu joined the room.01:41:18

Show newer messages


Back to Room ListRoom Version: 9