Commit Graph

681 Commits

Author SHA1 Message Date
Jade Lovelace
78945a827c stdenv: make inputDerivation never fixed-output
This fixes using inputDerivation on derivations that are fixed-output.

Previously:

```
nix-repl> drv = runCommand "huh" { outputHash = "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU="; outputHashAlgo = "sha256"; outputHashType = "flat"; } "touch $out"

nix-repl> drv.inputDerivation
«derivation /nix/store/d8mjs6cmmvsr1fv7psm6imis5pmh9bcs-huh.drv»

nix-repl> :b drv.inputDerivation
error: fixed output derivation 'huh' is not allowed to refer to other store paths.
       You may need to use the 'unsafeDiscardReferences' derivation attribute, see the manual for more details.
```

Fixes: https://github.com/NixOS/nixpkgs/issues/304209
2024-04-15 00:52:28 -07:00
infinixbot
af887c78d2 nixpkgs-check-by-name: 0.1.0 -> 0.1.1
https://github.com/NixOS/nixpkgs-check-by-name/releases/tag/0.1.1
2024-04-10 15:11:05 +00:00
Tristan Ross
b1ef46706f
llvmPackages_9: remove due to age 2024-04-08 22:39:53 -07:00
Dmitry Kalinkin
ce426df9bb
Merge pull request #294826 from xworld21/texlive-install-tl
texlive.withPackages: replace postBuild with install-tl like script
2024-03-31 16:43:12 -04:00
Vincenzo Mantova
87216540ef tests.texlive.context: check that the PDF has been created 2024-03-29 13:04:00 +00:00
Vincenzo Mantova
7ab4733846 tests.texlive.fmtutilCnf: remove
The fmtutilCnf test does not fit the new way of generating fmtutil.cnf.
2024-03-29 13:04:00 +00:00
Silvan Mosberger
56837f26e2 tests.nixpkgs-check-by-name: Remove now that a separate repo is used
Since https://github.com/NixOS/nixpkgs/pull/297901, the tool is fetched
from https://github.com/NixOS/nixpkgs-check-by-name, so there's no need
to keep it around in Nixpkgs anymore
2024-03-26 21:37:07 +01:00
Silvan Mosberger
b42fbdd7ea check-by-name: Remove now-unnecessary scripts/pinned-tool.json
It was not removed in https://github.com/NixOS/nixpkgs/pull/297901 so
that CI for that PR itself would not fail since CI runs from the base
branch.
2024-03-26 21:36:43 +01:00
Silvan Mosberger
f7ea336cb2 workflows/check-by-name.yml: Switch to new separate repo
The nixpkgs-check-by-name tooling is [being moved](https://github.com/NixOS/nixpkgs/issues/286559#issuecomment-2000466124)
to a [separate repo](https://github.com/NixOS/nixpkgs-check-by-name).

This commit updates Nixpkgs CI to use it instead of the tree inside
Nixpkgs

No changes have been made to the tooling locally since it was moved:
- [Exported history](55bf02190e/pkgs/test/nixpkgs-check-by-name)
- [Imported history](d579e1821d/)
2024-03-26 21:24:48 +01:00
annalee
ca5e01c3f4
treewide: drop LLVM11 2024-03-19 14:54:23 +00:00
Silvan Mosberger
1f75612fd5
Merge pull request #296324 from willbush/by-name-update-envc
check-by-name: Update .envrc to avoid using deprecated command
2024-03-18 02:35:14 +01:00
Will Bush
d7750c43b2
check-by-name: Update .envrc to remove deprecated command
Noticed the following warning:

```
direnv: `nix_direnv_watch_file` is deprecated - use `watch_file`
```

Which seems to come from here:

6455f38a8d/direnvrc (L207)

Seems this check is no longer needed

check-by-name: Remove check from .envrc

Co-authored-by: Silvan Mosberger <github@infinisil.com>
2024-03-16 20:45:09 -05:00
github-actions[bot]
87dfdf055e
Merge master into haskell-updates 2024-03-12 00:12:17 +00:00
Silvan Mosberger
ec758e1f6f check-by-name: Update pinned tooling
Includes https://github.com/NixOS/nixpkgs/pull/290743
2024-03-06 05:33:01 +01:00
github-actions[bot]
b74f04cf79
Merge master into haskell-updates 2024-03-03 00:13:21 +00:00
Silvan Mosberger
4b8265ab7f
Merge pull request #290743 from tweag/by-name-better-errors 2024-03-02 02:28:37 +01:00
Silvan Mosberger
fb0a07229f tests.nixpkgs-check-by-name: More inline format! arguments
Now that the previous commit removed all the .display()'s that were
previously necessary for PathBuf's, but now aren't for RelativePathBuf,
we can also inline the format! arguments
2024-03-01 23:07:37 +01:00
Silvan Mosberger
5981aff212 tests.nixpkgs-check-by-name: Use RelativePath for relative paths
Makes the code easier to understand and less error-prone
2024-03-01 23:07:34 +01:00
Silvan Mosberger
7858f06288 tests.nixpkgs-check-by-name: Better empty argument error 2024-03-01 01:50:05 +01:00
Silvan Mosberger
f056449c46 tests.nixpkgs-check-by-name: Fix absolute path in errors 2024-03-01 01:42:28 +01:00
Silvan Mosberger
2e8d778994 tests.nixpkgs-check-by-name: Various minor improvements
Co-Authored-By: Philip Taron <philip.taron@gmail.com>
2024-03-01 01:12:11 +01:00
github-actions[bot]
47e7b83fd1
Merge master into haskell-updates 2024-02-29 00:12:06 +00:00
Silvan Mosberger
cd5dc76d83 substitute: Deprecate replacements, introduce replacementsList
Also:
- Add tests
- Treewide update
- Improve docs
2024-02-29 00:35:27 +01:00
Will Fancher
f5622df470
Merge pull request #290946 from ju1m/systemd-option-list
nixos/systemd: merge unit options as lists when at least one value is a list
2024-02-27 20:49:39 -05:00
Julien Moutinho
7d0c812963 nixos/systemd: merge unit options as lists when at least one value is a list 2024-02-25 01:20:29 +01:00
github-actions[bot]
257171f024
Merge master into haskell-updates 2024-02-25 00:13:49 +00:00
Silvan Mosberger
64da6178bf tests.nixpkgs-check-by-name: Fix internal docs 2024-02-23 02:32:27 +01:00
Silvan Mosberger
d2fa5bafa9 tests.nixpkgs-check-by-name: Improve errors for new packages
Or rather, make it more consistent
2024-02-23 02:17:47 +01:00
Silvan Mosberger
ce271786de tests.nixpkgs-check-by-name: More spaces in errors 2024-02-23 02:16:49 +01:00
Silvan Mosberger
1c4308c352 tests.nixpkgs-check-by-name: Better error for empty second arg 2024-02-23 01:54:05 +01:00
Silvan Mosberger
eb1f01440a tests.nixpkgs-check-by-name: More consistent errors 2024-02-23 01:53:45 +01:00
Silvan Mosberger
f5e9b88af4 tests.nixpkgs-check-by-name: Evaluate base and main branch in parallel 2024-02-23 01:25:34 +01:00
Silvan Mosberger
db7562e886 tests.nixpkgs-check-by-name: Improve errors relating to the base branch 2024-02-23 01:05:26 +01:00
Silvan Mosberger
75cdccd6c4 tests.nixpkgs-check-by-name: Improve more errors 2024-02-23 00:10:20 +01:00
Silvan Mosberger
7258d472bc tests.nixpkgs-check-by-name: Improve non-syntactic callPackage error more 2024-02-22 23:43:02 +01:00
Silvan Mosberger
a53b07e252 tests.nixpkgs-check-by-name: Improve error for wrong package file 2024-02-22 23:04:40 +01:00
Silvan Mosberger
24069b982d tests.nixpkgs-check-by-name: Better error for non-syntactic callPackage 2024-02-19 23:42:34 +01:00
Silvan Mosberger
a61c8c9f5c tests.nixpkgs-check-by-name: Fix allowing non-path overrides
An edge case was allowed when it shouldn't be: A package defined in
`pkgs/by-name` could be overridden in `all-packages.nix` if it was of
the form `callPackage (<expr>) { <non-empty> }`.

This is not right, it's required that the first argument be the path
matching the package to be overridden.
2024-02-19 23:41:59 +01:00
Silvan Mosberger
712ac796e5 tests.nixpkgs-check-by-name: Improve inherit detection
Detect inherit's better, such that a future commit can use this
information in an error message
2024-02-19 22:02:27 +01:00
github-actions[bot]
743ad436a7
Merge master into haskell-updates 2024-02-18 00:13:34 +00:00
github-actions[bot]
e662338182
Merge staging-next into staging 2024-02-17 12:01:31 +00:00
DavHau
81d43b9b83 fetchPypiLegacy: add test 2024-02-17 17:11:59 +13:00
Rick van Schijndel
b728d76d0e
Merge pull request #255463 from emilylange/stdenv/patch-shebangs-trailing-newline
patch-shebangs: fix crash with shebang without trailing newline
2024-02-16 18:33:27 +01:00
github-actions[bot]
ed9046f8aa
Merge master into haskell-updates 2024-02-13 00:13:09 +00:00
Silvan Mosberger
ea4cd5c63d check-by-name: Update pinned tooling
Includes https://github.com/NixOS/nixpkgs/pull/287083
2024-02-12 02:23:40 +01:00
github-actions[bot]
63f3a9268c
Merge master into haskell-updates 2024-02-10 00:12:04 +00:00
Silvan Mosberger
50fcc65142 check-by-name: Update pinned tool
Includes https://github.com/NixOS/nixpkgs/pull/285089
2024-02-09 03:06:05 +01:00
github-actions[bot]
ae051d93c2
Merge master into haskell-updates 2024-02-09 00:12:19 +00:00
Silvan Mosberger
92284634ec tests.nixpkgs-check-by-name: Test against sbcl-like regression
This adds a test to check that a commit like 0a3dab4af3 would fail CI

After doing some improvements to the `pkgs/by-name` check I discovered
that sbcl shouldn't have been allowed in `pkgs/by-name` after all as is.

Specifically, the requirement is that if `pkgs/by-name/sb/sbcl` exists,
the definition of the `sbcl` attribute must look like

    sbcl = callPackage ../by-name/sb/sbcl/package.nix { ... };

However it currently is an alias like

    sbcl = sbcl_2_4_1;

This wasn't detected before because `sbcl_2_4_1` was semantically
defined using `callPackage`:

    sbcl_2_4_1 = wrapLisp {
      pkg = callPackage ../development/compilers/sbcl { version = "2.4.1"; };
      faslExt = "fasl";
      flags = [ "--dynamic-space-size" "3000" ];
    };

However this doesn't syntactically match what is required.

In https://github.com/NixOS/nixpkgs/pull/285089 I introduced syntactic
checks for exactly this, but they were only used for packages not
already in `pkgs/by-name`.

Only now that I'm doing the refactoring to also use this check for
`pkgs/by-name` packages this problem is noticed.

While introducing this new check is technically an increase in
strictness, and therefore would justify adding a new ratchet, I consider
this case to be rare enough that we don't need to do that.

This commit introduces a test to prevent such regressions in the
future

Moving sbcl back out of `pkgs/by-name` will be done when the pinned CI is updated
2024-02-08 02:38:11 +01:00
Silvan Mosberger
89a7afabf8 tests.nixpkgs-check-by-name: Improve code
- Detect manual use of _internalCallByNamePackageFile for packages in
  `pkgs/by-name` (can't be done for others though)
- Separate error message for when attribute locations can't be
  determined for `pkgs/by-name` attributes
- Much better structure of the code in eval.rs, representing more
  closely what is being checked
- Much more extensive comments
2024-02-08 02:38:08 +01:00