Preserve the structure of tclRequiresCheck when using structuredAttrs
instead of relying on it being a space-separated string.
Shouldn't be necessary since package names don't usually contain spaces
or braces, but you never know.
With __structuredAttrs enabled, arguments to mkDerivation are not exported as
environment variables inside the bash builder by default, so in this case
tclRequiresCheck doesn't exist when the tcl oneliner tries to read it.
tclRequiresCheck is also an array in this case.
So, expand the array and set the environment variable explicitly for the tcl
call only.
The existing handling of static builds in this expression was
insufficient for x86_64, where we can't even build shared libraries in
a static environment. Avoid building such libraries, like we do for
other packages.
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.
Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
This is a bit of a silly one. It's a symbol redefinition problem caused
by autoconf being pessimistic, then a funny eval error where
`stdenv.hostPlatform.extensions.dynamicLibrary` is not defined, say,
when the platform does not support dynamic libraries.
Fixes: https://github.com/NixOS/nixpkgs/issues/380168
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.
Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.
A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.
This commit was automatically created and can be verified using
nix-build https://github.com/infinisil/treewide-nixpkgs-reformat-script/archive/a08b3a4d199c6124ac5b36a889d9099b4383463f.tar.gz \
--argstr baseRev 78e9caf153
result/bin/apply-formatting $NIXPKGS_PATH
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"
```
Given the number of entries in TCLLIBPATH when using tcllib, this
results in some massive startup time speedups:
```
$ nix shell 'nixpkgs#tcl2048' -c sh -c 'echo q | time 2048'
```
takes .44s on master but only .01s with this change.
Add a dependency on tzdata, use tzdata's zoneinfo in clock.tcl. Remove
other paths clock.tcl may try to use for zoneinfo to avoid non-store dependency.
tcl-8_6 was updated in 4fb92ae60d from
8.6.9 -> 8.6.11 but tk's hash wasn't updated at the same time,
which means the current hash was still from tk 8.6.9 rather than 8.6.11.
When I reached out to vrthra / Rahul Gopinath about this PR, he
indicated that he no longer has the time to serve as tcl maintainer
and suggested that I take on the responsibility.