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

Publish tweag/rules_nixpkgs_core@0.10.0 #1022

Merged
merged 7 commits into from
Oct 19, 2023

Conversation

aherrmann
Copy link
Contributor

No description provided.

@aherrmann aherrmann mentioned this pull request Oct 19, 2023
6 tasks
@fmeum fmeum added the presubmit-auto-run Presubmit jobs will be triggered for new changes automatically without reviewer's approval label Oct 19, 2023
@aherrmann aherrmann force-pushed the rules_nixpkgs-0.10.0 branch from 73b3469 to 71e3e1a Compare October 19, 2023 08:12
@aherrmann
Copy link
Contributor Author

CI failed on presubmit.yml with

apt update
apt install --yes nix-setup-systemd
nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs
nix-channel --update
Reading package lists... Done
E: List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied)
Command '['set -e\napt update\napt install --yes nix-setup-systemd\nnix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs\nnix-channel --update']' returned non-zero exit status 100.
🚨 Error: The command exited with status 1

To meaningfully test rules_nixpkgs I need to install the Nix package manager. Is there any way to achieve this on CI?

@aherrmann aherrmann force-pushed the rules_nixpkgs-0.10.0 branch from f7b2400 to e6b787d Compare October 19, 2023 10:57
@aherrmann aherrmann force-pushed the rules_nixpkgs-0.10.0 branch from e6b787d to 8ab0739 Compare October 19, 2023 11:03
@fmeum
Copy link
Contributor

fmeum commented Oct 19, 2023

@aherrmann Looking at CI, this seems stuck on an interactive prompt.

Edit: I cancelled it to free resources.

The Nix installer should work headless, but there seems to be something
in the CI setup that confuses it.
@aherrmann aherrmann force-pushed the rules_nixpkgs-0.10.0 branch 2 times, most recently from 1c1f3b9 to 007596e Compare October 19, 2023 19:12
The shell configured on CI seems to disregard ~/.profile.
@aherrmann aherrmann force-pushed the rules_nixpkgs-0.10.0 branch from 59bea59 to 5197345 Compare October 19, 2023 19:28
@aherrmann
Copy link
Contributor Author

It took a bit of tweaking, but CI is now green.
The presubmit test installs Nix and then uses rules_nixpkgs_core to import hello.
The Nix installer usually updates ~/.profile to update PATH, but that doesn't seem to work in the CI setup here, so the CI config set's the PATH manually.
Debugging this was a bit tricky, since there doesn't seem to be an easy way to replicate the CI environment locally for testing. A useful tool for debugging was to temporarily include a patch that adds debug print statements to the rule set to better understand the environment that the test see.

@fmeum fmeum merged commit 489735d into bazelbuild:main Oct 19, 2023
1 check passed
@aherrmann aherrmann deleted the rules_nixpkgs-0.10.0 branch October 19, 2023 20:24
pjreiniger pushed a commit to bzlmodRio/bazel-central-registry that referenced this pull request Oct 20, 2023
* Publish tweag/rules_nixpkgs_core@0.10.0

* presubmit.yml use sudo to run apt

* Use Nix installer

* Apply `yes |`

The Nix installer should work headless, but there seems to be something
in the CI setup that confuses it.

* Install Nix in single user mode

* Set PATH manually.

The shell configured on CI seems to disregard ~/.profile.
avdv added a commit to tweag/rules_nixpkgs that referenced this pull request Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
presubmit-auto-run Presubmit jobs will be triggered for new changes automatically without reviewer's approval
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants