lix/tests/nixos
Maximilian Bosch 35eec921af
libfetchers: make attribute / URL query handling consistent
The original idea was to fix lix#174, but for a user friendly solution,
I figured that we'd need more consistency:

* Invalid query params will cause an error, just like invalid
  attributes. This has the following two consequences:

  * The `?dir=`-param from flakes will be removed before the URL to be
    fetched is passed to libfetchers.

  * The tarball fetcher doesn't allow URLs with custom query params
    anymore. I think this was questionable anyways given that an
    arbitrary set of query params was silently removed from the URL you
    wanted to fetch. The correct way is to use an attribute-set
    with a key `url` that contains the tarball URL to fetch.

  * Same for the git & mercurial fetchers: in that case it doesn't even
    matter though: both fetchers added unused query params to the URL
    that's passed from the input scheme to the fetcher (`url2` in the code).
    It turns out that this was never used since the query parameters were
    erased again in `getActualUrl`.

* Validation happens for both attributes and URLs. Previously, a lot of
  fetchers validated e.g. refs/revs only when specified in a URL and
  the validity of attribute names only in `inputFromAttrs`.

  Now, all the validation is done in `inputFromAttrs` and `inputFromURL`
  constructs attributes that will be passed to `inputFromAttrs`.

* Accept all attributes as URL query parameters. That also includes
  lesser used ones such as `narHash`.

  And "output" attributes like `lastModified`: these could be declared
  already when declaring inputs as attribute rather than URL. Now the
  behavior is at least consistent.

  Personally, I think we should differentiate in the future between
  "fetched input" (basically the attr-set that ends up in the lock-file)
  and "unfetched input" earlier: both inputFrom{Attrs,URL} entrypoints
  are probably OK for unfetched inputs, but for locked/fetched inputs
  a custom entrypoint should be used. Then, the current entrypoints
  wouldn't have to allow these attributes anymore.

Change-Id: I1be1992249f7af8287cfc37891ab505ddaa2e8cd
2024-06-22 14:42:43 +02:00
..
ca-fd-leak Copy the output of fixed-output derivations before registering them 2024-03-07 01:44:58 +00:00
containers Re-enable systemd-nspawn test 2023-09-20 17:03:47 +00:00
coredumps Allow enabling core dumps from builds for nix & child processes 2024-05-16 17:11:21 -07:00
fetch-git Add pre-commit checks 2024-03-29 22:57:40 -07:00
no-new-privileges libstore/build: always enable seccomp filtering and no-new-privileges 2024-05-24 21:19:29 +00:00
setuid libstore/local-derivation-goal: prohibit creating setuid/setgid binaries 2024-05-03 16:29:06 +02:00
authorization.nix Allow to sign path as unprivileged user 2023-06-27 18:31:31 +02:00
broken-userns.nix Fix /etc/group having desynced IDs from the actual UID in the sandbox 2024-05-04 17:36:50 -07:00
default.nix [resubmit] flake: update nixpkgs pin 23.11->24.05 (+ boehmgc compat changes) 2024-06-12 15:34:22 -07:00
github-flakes.nix Deprecate the online flake registries and vendor the default registry 2024-05-18 12:27:23 +10:00
nix-copy-closure.nix make the multi-node vm tests a bit more reliable 2024-03-10 10:10:52 +01:00
nix-copy.nix tests/nixos/nix-copy: fix NixOS >= 24.05 compatibility 2024-06-08 17:59:08 +02:00
nix-upgrade-nix.nix [resubmit] flake: update nixpkgs pin 23.11->24.05 (+ boehmgc compat changes) 2024-06-12 15:34:22 -07:00
nss-preload.nix Merge pull request #9631 from cole-h/fixup-check-warnings 2024-03-07 09:58:15 +01:00
remote-builds-ssh-ng.nix ssh-ng: Set log-fd for ssh to 4 by default 2024-04-26 19:04:06 +02:00
remote-builds.nix make the multi-node vm tests a bit more reliable 2024-03-10 10:10:52 +01:00
sourcehut-flakes.nix tests: unhaunt the flakes nixos tests 2024-04-18 20:09:19 +00:00
symlink-resolvconf.nix libstore/build: set NO_NEW_PRIVS for the sandbox 2024-04-15 10:25:29 +03:00
tarball-flakes.nix libfetchers: make attribute / URL query handling consistent 2024-06-22 14:42:43 +02:00
util.nix Allow enabling core dumps from builds for nix & child processes 2024-05-16 17:11:21 -07:00