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

check-by-name/run-local.sh: Make it usable for non-CI platforms #281407

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

infinisil
Copy link
Member

@infinisil infinisil commented Jan 16, 2024

Description of changes

Since #281374, the nixpkgs-check-by-name tooling is pinned to a specific /nix/store path to avoid having to evaluate Nixpkgs in CI.

The same path is used for local runs, but that doesn't actually work when you're trying to run it on a platform different from CI:

$ ./pkgs/tests/nixpkgs-check-by-name/scripts/run-local.sh master 
Running nixpkgs-check-by-name..
/tmp/tmp.kynXWxE3nr/tool/bin/nixpkgs-check-by-name: line 3: /nix/store/qlls5ca8q88qpyygg9ddi60gl1nmvpij-nixpkgs-check-by-name/bin/.nixpkgs-check-by-name-wrapped:
  cannot execute binary file: Exec format error
/tmp/tmp.kynXWxE3nr/tool/bin/nixpkgs-check-by-name: line 3: /nix/store/qlls5ca8q88qpyygg9ddi60gl1nmvpij-nixpkgs-check-by-name/bin/.nixpkgs-check-by-name-wrapped:
  Undefined error: 0

This PR makes it work by being clearer about platforms and making local runs check out the correct Nixpkgs to evaluate the tool from.

Things done

  • Ran run-local.sh master successfully on x86_64-linux and aarch64-darwin
  • Ran update-pinned-tool.sh for the new format.

Add a 👍 reaction to pull requests you find important.

Since NixOS#281374, the
nixpkgs-check-by-name tooling is pinned to a specific /nix/store path to
avoid having to evaluate Nixpkgs in CI.

The same path is used for local runs, but that doesn't actually work
when you're trying to run it on a platform different from CI.

This commit makes it work by being clearer about platforms and making
local runs check out the correct Nixpkgs to evaluate the tool from.
@infinisil infinisil force-pushed the by-name-local-run-platforms branch from c0ed22d to 9da57b5 Compare January 17, 2024 09:45
@infinisil infinisil merged commit 9997190 into NixOS:master Jan 17, 2024
19 checks passed
@infinisil infinisil deleted the by-name-local-run-platforms branch January 17, 2024 20:21
infinisil added a commit to tweag/nixpkgs that referenced this pull request Jan 17, 2024
- name: Fetching the pinned tool
run: |
# Get the direct /nix/store path from the pin to avoid having to evaluate Nixpkgs
toolPath=$(jq -r .ci-path pkgs/test/nixpkgs-check-by-name/scripts/pinned-tool.json)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should've tested this in a separate repository. This broke CI on master very briefly before I fixed it with #281412. Only two PRs were affected:

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

Successfully merging this pull request may close these issues.

1 participant