Skip to content

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Feb 21, 2025

Motivation

Hydra currently fails to show the build dependencies of it's builds (NixOS/hydra#1401) with an error like this:

error: not an absolute path: 'Nix::Store=SCALAR(0x3f5338e8)'

The invalid path the error is referring to, is produced in the current Perl bindings itself.

Context

When #9863 converted the Nix::Store free functions into member functions, the implicit this argument was not accounted for when iterating over the variable number of arguments in some functions.

The following functions are affected:

  • computeFSClosure
  • topoSortPaths (this causes the hydra error)
  • exportPaths

flake.nix reproducing the error:

{
  # Current rev of github:NixOS/nix/2.26-maintenance
  inputs.nix.url = "github:NixOS/nix/0d039d4abec82c7c7c2787edea7fd3c732965f82";

  inputs.nixpkgs.follows = "nix/nixpkgs";

  outputs = {
    self,
    nixpkgs,
    nix,
    ...
  }: {
    packages.x86_64-linux.default =
      nixpkgs.legacyPackages.x86_64-linux.writers.writePerlBin "example" {
        libraries = [nix.hydraJobs.perlBindings.x86_64-linux];
      } ''
        use Nix::Store;

        my $store = Nix::Store->new();

        $store->computeFSClosure(0,0);
        # error: not an absolute path: '0' at /nix/store/y1g5c8wz7s2fr29fliq06v161asj6npr-example/bin/example line 6.

        $store->topoSortPaths();
        # error: not an absolute path: 'Nix::Store=SCALAR(0x3eca46b0)' at /nix/store/7vxyv8kcv01dz0gjs9cys27frbqj5bir-example/bin/example line 9.

        $store->exportPaths(1);
        # error: not an absolute path: '1' at /nix/store/ras8ghkb0pff4zwp8jycg48p5y3qgfdq-example/bin/example line 12.
      '';
  };
}

Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.


This is an automatic backport of pull request #12543 done by [Mergify](https://mergify.com).

When #9863 converted the `Nix::Store` free functions into member functions, the
implicit `this` argument was not accounted for when iterating over the variable
number of arguments in some functions.

(cherry picked from commit 5cf9e18)
@mergify mergify bot requested a review from edolstra as a code owner February 21, 2025 14:47
@mergify mergify bot added automatic backport This PR is a backport produced by automation (does not trigger backporting) merge-queue labels Feb 21, 2025
@Ericson2314
Copy link
Member

What the hell is that test failure! :)

mergify bot added a commit that referenced this pull request Feb 22, 2025
@mergify mergify bot merged commit 6d3ee99 into 2.26-maintenance Feb 22, 2025
24 checks passed
@mergify mergify bot deleted the mergify/bp/2.26-maintenance/pr-12543 branch February 22, 2025 18:34
@Ericson2314
Copy link
Member

Spurious hmmm OK

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

Labels

automatic backport This PR is a backport produced by automation (does not trigger backporting) merge-queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants