Original commit from https://github.com/NixOS/nixpkgs/pull/282226,
message:
Running CI locally is broken becauses the `-I` argument:
- Clobbers $NIX_PATH
- Is wrong for two reasons:
- Has too many `..` elements, relative to the script's location
- Isn't relative to the script's location (as with *.nix files),
since shell scripts and POSIX in general interpret paths
relative to the current working directory, not the canonical
path of argv[0]
- Is inconsistent, since this script has symlinks pointing at it
from different depths in the repository
There is no way to set this flag statically in a way that will work
everywhere. The caller needs to use $NIX_PATH, or the script needs
to take the `-I` value as an argument.
This commit deletes the static `-I` flag.
Since context now uses the luametatex engine, which is not distributed with
texlive, the probability of breaking it when updating increases. Let's add a
simple test just in case.
Co-authored-by: Vincenzo Mantova <1962985+xworld21@users.noreply.github.com>
Without the change the eval fails as:
$ nix build --no-link -f. tests.cross.sanity
error: attribute 'qutebrowser' missing
at pkgs/test/cross/default.nix:157:5:
156| # Two web browsers -- exercises almost the entire packageset
157| pkgs.pkgsCross.aarch64-multiplatform.qt5.qutebrowser
| ^
158| pkgs.pkgsCross.aarch64-multiplatform.firefox
Stops enforcing that packages whose evaluation gets fixed have to be
moved to `pkgs/by-name`.
This didn't really cause problems before, but I don't think it's great
behavior, and now that NonApplicable is a thing, we can easily make this
work, whereas before it would've been a larger change.
Introduces NonApplicable as a state of a ratchet, to be used when the
ratchet doesn't make sense to have.
This fixes an odd problem where before, changing an attribute to use
e.g. `callPackage` suddenly requires moving it to `pkgs/by-name`, when that
shouldn't have been required.
- Renames EmptyNonAutoCalled to ManualDefinition and add some docs to
better explain what it's for
- Don't conflate the Ratchet type with the Context type, keep them
apart, making the code a bit cleaner, but also allows adding
additional context for a Tight ratchet in the future
- Change the signature of to_nixpkgs_problem to align with the other
ratchet function signatures
Since https://github.com/NixOS/nixpkgs/pull/279892, there's a separate
check that makes sure all changed Nix files evaluate. To not trigger
that, we need to remove all invalid Nix expressions from the tests.
Since https://github.com/NixOS/nixpkgs/pull/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.
Before this, the tool for CI would update when nixos-unstable updated,
which is kind of terrible because you don't know when it happens, and it
might break master.
In fact, the tooling _right now_ has a serious bug and shouldn't be used!
This PR addresses this by _pinning_ the tooling in Nixpkgs itself.
Updating the tooling now requires two PRs:
- The first PR to update the tooling source
- (wait for Hydra to build and publish it in nixos-unstable)
- The second PR to update the pinned tooling
In turn you know exactly when the changes are going to take effect.
This change however has additional benefits:
- It makes CI more reproducible, because it doesn't depend on the state
of nixos-unstable anymore
- Updates to the tooling can be tested with the workflow itself,
because PRs that update the pinned tool will be tested on the updated
version
- CI gets a sizable speed boost, because there's no need to download and
evaluate a channel anymore
- It makes it more realistic to move the source of the tool into a
separate repository
- It removes the brittle branch-specific logic that was previously
needed to ensure that release branches use their own version of the
tooling.
nix-build failed because the tests assume to run in a CWD equal to the
project root, which is not the case in the derivation build.
This commit fixes it by not using hacky `..` references to paths,
and instead uses NIX_PATH for all implicit Nix testing path
dependencies.
Also the root of the `lib` path gets passed in from the `default.nix`
file, so all the relative path handling is done by Nix during evaluation
already, and in the Nix store when possible.