Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixpkgs-review fails when the cache directory is set to a relative path #467

Open
bengsparks opened this issue Feb 13, 2025 · 0 comments · May be fixed by #468
Open

nixpkgs-review fails when the cache directory is set to a relative path #467

bengsparks opened this issue Feb 13, 2025 · 0 comments · May be fixed by #468

Comments

@bengsparks
Copy link

Specifically, loading the nixpkgs_review/nixpkgs_review/nix/review-shell.nix file will fail.
This is because when nixpkgs-path in import nixpkgs-path is set to a string that doesn't represent an absolute path, the import will fail.

MREs:

$ nix-shell -p nixpkgs-review --run "env XDG_CACHE_HOME=. nixpkgs-review pr 366438 --print-result"
$ nix-shell -p nixpkgs-review --run "env HOME=. nixpkgs-review pr 366438 --print-result"

will both output

snip! ```console -> Attempting to fetch eval results from GitHub actions -> Successfully fetched rebuilds: no local evaluation needed $ git -c fetch.prune=false fetch --no-tags --force https://github.com/NixOS/nixpkgs master:refs/nixpkgs-review/0 pull/366438/merge:refs/nixpkgs-review/1 remote: Enumerating objects: 135, done. remote: Counting objects: 100% (95/95), done. remote: Compressing objects: 100% (53/53), done. remote: Total 135 (delta 69), reused 53 (delta 42), pack-reused 40 (from 3) Receiving objects: 100% (135/135), 541.08 KiB | 10.82 MiB/s, done. Resolving deltas: 100% (70/70), completed with 33 local objects. From https://github.com/NixOS/nixpkgs 78fdbc78fd83..8ba337117121 master -> refs/nixpkgs-review/0 + a3a94082859a...3b58d130629f refs/pull/366438/merge -> refs/nixpkgs-review/1 (forced update) $ git worktree add nixpkgs-review/pr-366438/nixpkgs 3b58d130629fff2c768f92cd4baaf2628692d327 Preparing worktree (detached HEAD 3b58d130629f) Updating files: 100% (46165/46165), done. HEAD is now at 3b58d130629f Merge 836d015e0bea5715a2b4fdce411d5dd1427c4177 into 8ba337117121ab3774d7b623e3d5607b7d8de3df ```
$ nom build \
    --file /nix/store/ls4fz2mq89wh7g6c7lsdd1ifkyhi5v5r-nixpkgs-review-3.0.1/lib/python3.12/site-packages/nixpkgs_review/nix/review-shell.nix \
    # !! relative path !!
    --nix-path 'nixpkgs=nixpkgs-review/pr-366438/nixpkgs nixpkgs-overlays=/tmp/tmperlc9ss2' \
    --extra-experimental-features 'nix-command no-url-literals' \
    --no-link --keep-going --no-allow-import-from-derivation \
    --argstr local-system aarch64-darwin \
    # !! relative path !!
    --argstr nixpkgs-path nixpkgs-review/pr-366438/nixpkgs \
    --argstr nixpkgs-config-path /tmp/tmp8rjver0h.nix \
    # !! relative path !!
    --argstr attrs-path nixpkgs-review/pr-366438/attrs.nix
error:
       … while calling the 'import' builtin
         at /nix/store/ls4fz2mq89wh7g6c7lsdd1ifkyhi5v5r-nixpkgs-review-3.0.1/lib/python3.12/site-packages/nixpkgs_review/nix/review-shell.nix:35:2:
           34| in
           35| (import nixpkgs-path { }).mkShell {
             |  ^
           36|   name = "review-shell";

       … while realising the context of a path

       error: string 'nixpkgs-review/pr-366438/nixpkgs' doesn't represent an absolute path
@bengsparks bengsparks linked a pull request Feb 13, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant