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"
```
Checking if bluez is a derivation requires evaluating whether an
emulator is available (in the case that gobject-introspection is
available), which when cross compiling requires evaluating qemu, which
requires evaluating libxml2, which requires evaluating Python.
The recursion break happens in the Python expression because it's the
thing behaving unusually, by forcing evaluation of all of its
arguments, even ones that are optional and unused.
Fixes: 8b3a4a617e ("bluez: fix when gobject-introspection unsupported")
This patch hasn't been complete since an alternate case was added to
cpython which allows using ld(1) to resolve libraries. In addition to
this, the stated reason for the patch, to improve startup times by
preventing cpython from invoking gcc to resolve libuuid, has not been an
issue since that logic was removed in cpython 3.9. Finally, this patch
creates a disparity between Linux and other operating systems (I am
working on FreeBSD right now) since the ld(1) case is system gated.
Since it no longer accomplishes its stated purpose, is no longer needed,
and creates platform disparities, we should remove it.
I've left the half of this patch which prevents /sbin/ldconfig from
being invoked, since no nix-compiled program should ever be invoking
absolute paths like this.
Python 3.12 attempts to build with the _scproxy enabled even when building python3Minimal. Override the configure check to make sure it is disabled. Otherwise, the Darwin stdenv bootstrap will fail.
This only enables x86_64-unknown-freebsd, not any other FreeBSD, since I
do not have any other machines to tests on. If you're reading this, feel
free to try out other arches!
https://github.com/NixOS/nixpkgs/pull/311767 improved build purity, but Python’s configure script checks the Darwin version to enable platform features. Replacing the check with a check for Darwin without the version allows the build to succeed again.
* Make use of libxcrypt conditional (documented inline)
* Patch use of uname to to not pull in some impure information
* Various cases where behavior is split out among operating systems are
now inclusive of FreeBSD
In the past I was very active with Python packaging.
For several years now I was hardly around as maintainer,
so it does not make sense I am listed as a maintainer for
these makes. Looking back, I should have removed myself
as maintainer already much longer ago. Anyway, better late
than never.
It's been a fun ride, and I do intend to occasionally contribute
to Nixpkgs, but not in the same way it once was.
The way we build python environments is subtly broken. A python
environment should be semantically identical to a vanilla Python
installation in, say, /usr/local. The current implementation, however,
differs in two important ways. The first is that it's impossible to use
python packages from the environment in python virtual environments. The
second is that the nix-generated environment appears to be a venv, but
it's not.
This commit changes the way python environments are built:
* When generating wrappers for python executables, we inherit argv[0]
from the wrapper. This causes python to initialize its configuration
in the environment with all the correct paths.
* We remove the sitecustomize.py file from the base python package.
This file was used tweak the python configuration after it was
incorrectly initialized. That's no longer necessary.
The end result is that python environments no longer appear to be venvs,
and behave more like a vanilla python installation. In addition it's
possible to create a venv using an environment and use packages from
both the environment and the venv.