Skip to content

Update nix lock file and check in CI that nix lock file is in sync with nix flake#4838

Merged
automergerpr-permission-manager[bot] merged 2 commits intodevelopfrom
nix-lockfile
Jul 3, 2025
Merged

Update nix lock file and check in CI that nix lock file is in sync with nix flake#4838
automergerpr-permission-manager[bot] merged 2 commits intodevelopfrom
nix-lockfile

Conversation

@juliankuners
Copy link
Copy Markdown
Contributor

@juliankuners juliankuners commented Jul 3, 2025

Recently, the nix flake was updated in a pull request without fully updating the respective nix lock file. This causes issues when trying to install a nix derivation from CLI, i.e. with nix or kup, without cloning the repository, as the checked out source is placed in the read-only nix store. Therefore, the nix lock file must always stay perfectly in sync with the nix flake.

This pull request updates the nix lock file to be in sync again. Additionally, the flag --no-update-lock-file was added to CI when building the nix derivation to check that the nix lock file is actually in sync. Otherwise, CI would silently update the nix lockfile without reflecting that change in a commit. This additional sanity check could also be added to other RV repositories with CI that use nix.

@juliankuners juliankuners requested a review from a team as a code owner July 3, 2025 13:38
@rv-jenkins rv-jenkins changed the base branch from master to develop July 3, 2025 13:39
@juliankuners
Copy link
Copy Markdown
Contributor Author

@tothtamas28 Could you please review and merge this? Installing k with kup is currently broken without this PR.

@automergerpr-permission-manager automergerpr-permission-manager Bot merged commit fa59c0c into develop Jul 3, 2025
20 of 21 checks passed
@automergerpr-permission-manager automergerpr-permission-manager Bot deleted the nix-lockfile branch July 3, 2025 15:45
automergerpr-permission-manager Bot pushed a commit that referenced this pull request Jul 16, 2025
In PR #4838, the nix lock file `flake.lock` was updated to be in sync
again with `flake.nix`, which is a hard-requirement for `kup` and `nix`
to be able to install `k` properly. This PR also added a check in CI
that makes sure that the lock file is actually in sync with the flake
file.

In PR #4834, the develop branch was merged with the PR branch, which
causes the new check to be included in the PR branch. In addition, the
`update deps` workflow of the respective update PR was automatically run
that updated nix lock file. For some reason, the `flake.lock: update`
commit [generated a wrong lock
file](76f0afe#diff-216b2b7bfde9416c79d133bacb031e95702a20bdedb548c0b055c837aa4f6a9cL169)
that is un-sync with the `flake.nix` file in the same commit. Normally,
this should have been detected by the new check in the test PR workflow,
but it was not. The [first CI test run
succeeded](https://github.com/runtimeverification/k/actions/runs/16276235659/attempts/1)
and the PR was merged afterwards. I restarted a CI run on this PR,
[which failed as
expected](https://github.com/runtimeverification/k/actions/runs/16276235659/job/46028193744#step:7:20).

In my opinion, this should not actually happen and could have been
caused by a checkout of the wrong commit in CI? But on a second thought,
I observed that the [test CI workflow succeeded for
MacOS](https://github.com/runtimeverification/k/actions/runs/16276235659/job/46028193732#step:6:16)
due to the store paths being already in the nix store, which means that
the nix flake was actually build already build by CI as is, without
changes.

So in conclusion, this is either sum bug in the checkout of repositories
(unlikely I guess) or some very weird bug by nix (more likely).
Therefore, we should update the versions of nix used in the MacOS CI and
the workflows of this repository, as both use rather old versions of
nix.
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.

2 participants