In preparation for the deprecation of `stdenv.isX`.
These shorthands are not conducive to cross-compilation because they
hide the platforms.
Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way
One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059
There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.
```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
Also:
- update README
- expand passthru tests to cover packages that depend on resholve
- drop temporary patches added to tests during bats update (so that
PR didn't need to go through staging)
I'm preparing to update bats to 1.11.0, but a change it includes will
require updating 3 of resholve's tests. Since a full resholve source
bump would need to go through staging now, I'm just patching the tests
in the separate test derivation.
oildev has been using a pinned re2c based on what oil uses
upstream. That's been a conservative choice, so I'll see if
it can just lean on the normal re2c package for now.
One of resholve's passthru tests depended on getting `script` from
util-linux, but it's no longer there on macos after #232713.
This change just tracks upstream change to use unixtools.script, which
is what I should have used in the first place. Upstream commit for
reference:
3407150949
This release gets resholve caught up to the latest release of oil/osh.
Since the update was already somewhat involved, I used the opportunity
to also figure out how to patch out some C extensions and external
dependencies that shouldn't be necessary just to use the parser.
- update README.md
- github.com/abathur/resholve/blob/master/CHANGELOG.md#v090-jan-29-2023
- github.com/abathur/nix-py-dev-oil/compare/v0.8.12.3...v0.14.0.0
checkInputs used to be added to nativeBuildInputs. Now we have
nativeCheckInputs to do that instead. Doing this treewide change allows
to keep hashes identical to before the introduction of
nativeCheckInputs.
We are marking `resholve` itself with `meta.knownVulnerabilities`, and
overriding `resholve-utils` functions's `resholve` with
`meta.knownVulnerabilities = [ ]`.
This way, we can still use `resholve` at build-time without triggering
security warnings, however we can't instantiate `resholve` itself. See:
```
$ nix-build -A resholve
error: Package ‘resholve-0.8.4’ in /.../nixpkgs/pkgs/development/misc/resholve/resholve.nix:48 is marked as insecure, refusing to evaluate.
$ nix-build -A ix
/nix/store/k8cvj1bfxkjj8zdg6kgm7r8942bbj7w7-ix-20190815
```
For debugging purposes, you can still bypass the security checks and
instantiate `resholve` by:
```
$ NIXPKGS_ALLOW_INSECURE=1 nix-build -A resholve
/nix/store/77s87hhqymc6x9wpclb04zg5jwm6fsij-resholve-0.8.4
```
Forgot to port this resholve Nix API fix in the course of #184292.
Same change as:
github.com/abathur/resholve/commit/b743d2eb12d82e35c567733a7a884174e3606641
This PR strips down the modified `python27` derivation used by `resholve`. The
idea is to reduce the possible security issues, and also to make it easier to
bootstrap.
Effort to fix automatic nixpkgs-update updates for resholved
packages in 9f6310d did help the bot get further, but it
then failed to find the source outputHash (the outer
derivation's source is the inner derivation; bot looks for
outer.src.outputHash; ours is at outer.src.src.outputHash).
This change uses `originalSrc` to indicate the source of the
inner derivation. Along with ryantm/nixpkgs-update#324, this
enables the bot to fall back on an attr that Nix/nixpkgs are
not directly depending on, supporting automatic updates for
packages built with `resholve.mkDerivation`.
Two items in resholve's mkDerivation are causing trouble for
some ecosystem tools:
1. I didn't pass through the original package's meta, which breaks the
ability of at least nixos package search and r-ryantm to find the
right source file (in the latter case breaking auto updates).
2. I was prepending "resholved-" to the pname, which at least nixos
package search picks up as the package's name. Repology also tries
to do this, but their current nix updater will prefer to get this
data from the name. For now, this means changing to name will not
stop repology from picking up the `resholved-<package>` names.
Repology's code makes it clear that they *want* to use the pname/
version, so I was inclined to settle with what I've got for now,
but thiagokokada clarified that we aren't just waiting for nixpkgs
fixes, but because Nix itself isn't exporting the pname/version in
its JSON. See also:
- https://github.com/repology/repology-updater/issues/854
- https://github.com/repology/repology-updater/commit/9313110121df5
For now, at least, I'll switch to appending "-unresholved" to the
inner derivation's pname.