GaloisInc / llvm-pretty-bc-parser

Parser for the llvm bitcode format
Other
60 stars 6 forks source link

Document how to update `flake.lock` file when bumping `llvm-pretty` submodule #276

Open RyanGlScott opened 2 months ago

RyanGlScott commented 2 months ago

The llvm-pretty-bc-parser CI uses a Nix flake, and the associated flake.lock file needs to be updated every time the llvm-pretty submodule commit is updated. If you forget to do this, the CI will likely fail with mysterious errors due to the Nix-based CI checkout out a different llvm-pretty commit than what the submodule targets. (See here for one example of this.) This has led to quite a bit of head-scratching (between myself, @mccleeary-galois, and others) when trying to debug CI failures.

We should clearly document what Nix command you need to run in order to update the flake.lock file in tandem with a submodule bump. (I vaguely recall that it's something to the effect of nix flake update, but the specifics escape me.)

kquick commented 2 months ago

This is unfortunately undergoing some UI changes, so it depends on the version:

? -- 2.18: nix flake lock --update-input {inputname} 2.19 -- ?: nix flake update {inputname}

The --update-input argument works for other commands (nix build, nix develop) in2.18 or earlier, but as of 2.19, it is reportedly removed from those.