Pass the whole environment to the native-image build process by
generating a -E option for every environment variable.
This has the same effect as setting
NATIVE_IMAGE_DEPRECATED_BUILDER_SANITATION=true
but is compatible with packages providing -E options themselves
Packages that require access to environment variables in the build
should specify these using `-E` arguments in `nativeImageBuildArgs` or
using a `native-image.properties` as described here:
https://www.graalvm.org/22.1/reference-manual/native-image/BuildConfiguration/#embedding-a-configuration-file
Specifying NATIVE_IMAGE_DEPRECATED_BUILDER_SANITATION=true breaks with
packages that list their environment variables explicitly in `native-image.properties`.
PR #275947, which was self-merged without approvals, inserted
functionality specific to a propriteary closed-source compiler
(CUDA) into cc-wrapper.
This commit relocates this CUDA-specific functionality into the
appropritate place: `cuda-modules`.
It is unclear to me exactly what this function is supposed to be
doing; much of it (like the `.kind` attributes) do not appear to be
used *anywhere* in nixpkgs. Making sure we don't insert unexplained
deadcode like this is one of the important functions of the review
process.
This commit deletes speculative comments which were self-merged with
no approvals in PR #275947.
If you think that "The above 'fix' may be incorrect" the correct
response is to submit a PR which removes the 'fix' and get it reviewed.
Likewise, if you think that "For clang it's not necessary" you
should submit a PR which wraps it in `if !isClang`.
`cc-wrapper` is full of too much junk as it is, let's not make
things worse.
* doc: improve documentation for trivial text writing functions
Co-authored-by: Brian Merchant <bzm3r@proton.me>
Co-authored-by: Robert Hensing <robert@roberthensing.nl>
Co-authored-by: Alexander Groleau <alex@proof.construction>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Add some minor improvements of the package, and use temp files for the
source difference patch, such that it is more reliable. This follows
from the suggestions of @infinisil.
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>