about summary refs log tree commit diff
path: root/pkgs/stdenv/generic
AgeCommit message (Collapse)AuthorFilesLines
2023-01-21Merge branch 'nativeCheckInputs' into staging-nativeCheckInputsGuillaume Girol1-24/+31
2023-01-21mkDerivation: introduce native checkInputs and nativeCheckInputsGuillaume Girol1-24/+31
When strictDeps is set, only nativeCheckInputs are added to PATH and only checkInputs can be linked against. See https://github.com/NixOS/nixpkgs/issues/161570
2023-01-18stdenv: don't clobber useArray and type in {prepend,append}ToVarAndrew Childs1-2/+2
Some other packages, for example ruby gems via buildRubyGem, use a variable called "type" internally, which is overwritten here and causes failures like: failure: $gempkg path unspecified Fix for changes in 11c3127e38dafdf95ca71a85b1591a29b67e0c09.
2023-01-16stdenv: disable shellcheck rule SC2068 & SC1091Artturin1-1/+1
this is intentional to support both structuredAttrs and non In pkgs/stdenv/generic/setup.sh line 614: for pkg in ${depsBuildBuild[@]} ${depsBuildBuildPropagated[@]}; do ^------------------^ SC2068 (error): Double quote array expansions to avoid re-splitting elements. In pkgs/stdenv/generic/setup.sh line 521: local varRef="$varVar[$((targetOffset - hostOffset))]" ^-- SC1087 (error): Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet).
2023-01-16stdenv: fix SC2242Artturin1-2/+2
exit -1 == exit 255 but we don't have a reason to use 255 In pkgs/stdenv/generic/setup.sh line 518: (( hostOffset <= targetOffset )) || exit -1 ^-- SC2242 (error): Can only exit with status 0-255. Other data should be wri tten to stdout/stderr.
2023-01-16stdenv: disable shellcheck rule SC2048Artturin1-1/+1
we use [*] to support structuredAttrs and non In pkgs/stdenv/generic/setup.sh line 1542: for curPhase in ${phases[*]}; do ^----------^ SC2048 (warning): Use "${array[@]}" (with quotes) to prevent whitespace problems.
2023-01-16stdenv: disable shellcheck rulesArtturin1-2/+1
In pkgs/stdenv/generic/setup.sh line 101: source "$hookName" ^---------^ SC1090 (warning): ShellCheck can't follow non-constant source. Use a directive to specify location. In pkgs/stdenv/generic/setup.sh line 166: mkdir -p "$out/nix-support" ^--^ SC2154 (warning): out is referenced but not assigned. In pkgs/stdenv/generic/setup.sh line 407: PATH= ^--^ SC2123 (warning): PATH is the shell search path. Use another name. In pkgs/stdenv/generic/setup.sh line 452: declare -a pkgBuildAccumVars=(pkgsBuildBuild pkgsBuildHost pkgsBuildTarget) ^---------------^ SC2034 (warning): pkgBuildAccumVars appears unused. Verify use (or export if used e xternally). because pkgBuildAccumVars is used In pkgs/stdenv/generic/setup.sh line 235: nameref="$* ${nameref-}" ^-----^ SC2178 (warning): Variable was used as an array but is now assigned a string. because we theres a useArray conditional
2023-01-16stdenv: fix SC2004 & SC2086Artturin1-6/+6
SC2004 (style): $/${} is unnecessary on arithmetic variables. SC2086 (info): Double quote to prevent globbing and word splitting.
2023-01-16stdenv: fix SC2223Artturin1-10/+10
In pkgs/stdenv/generic/setup.sh line 36: : ${outputs:=out} ^-------------^ SC2223 (info): This default assignment may cause DoS due to globbing. Quote it.
2023-01-15stdenv: drop remove unnecessary env varArtturin1-20/+11
and the associated obsolete functions support for log nesting was removed in 2017 https://github.com/nixos/nixpkgs/commit/6669a3b47711dc967df0ea8ff93fa9857aad015d
2023-01-15Merge pull request #209371 from Artturin/gzipreproArtturi1-0/+4
gzip: make reproducible when GZIP_NO_TIMESTAMPS is set
2023-01-12gzip: make reproducible when GZIP_NO_TIMESTAMPS is setArtturin1-0/+4
the logic can be tested with ``` $ GZIP_NO_TIMESTAMPS=1 && echo "${GZIP_NO_TIMESTAMPS:+-n }" -n $ unset GZIP_NO_TIMESTAMPS && echo "${GZIP_NO_TIMESTAMPS:+-n }" ```
2023-01-11Merge staging-next into staginggithub-actions[bot]1-4/+3
2023-01-11Merge master into staging-nextgithub-actions[bot]1-4/+3
2023-01-11check-meta(hasUnsupportedPlatform): use lib.meta.availableOnAdam Joseph1-4/+3
`hasUnsupportedPlatform` was not updated with #37395, so it does not understand attrsets in `meta.[bad]platforms`. In particular, attrsets in `meta.badPlatforms` will "fail open" and be ignored. Let's use `lib.meta.availableOn` instead of duplicating its logic. Thanks to @alyssais for [noticing][1]. [1][https://github.com/NixOS/nixpkgs/pull/194148#discussion_r990817610] Co-authored-by: sternenseemann <sternenseemann@systemli.org>
2023-01-06stdenv: don't fail installPhase on missing makefileArtturin1-1/+10
otherwise the build just fails with 'make: *** No rule to make target 'install'. Stop.' and update buildPhase message i don't know if the 'makefile may have been created in buildPhase' is true but i guess it might be possible
2023-01-04Merge staging-next into staginggithub-actions[bot]1-3/+3
2023-01-01check-meta.nix: make non-source consistent with documentationAdam Joseph1-3/+3
The documentation for `meta.sourceProvenance` in `doc/stdenv/meta.chapter.md` says: "the `meta.sourceProvenance` attribute should be a list containing one or more value..." Let's update check-meta.nix to require that `meta.sourceProvenance` is a list, as the documentation says, rather than a single element. Adding two extra keystrokes `[` and `]` when filling out this field is an insignificant burden for package authors, and being able to assume that the `meta.sourceProvenance` field is always a list greatly simplifies any code that acts on the value of this field. Since `meta.sourceProvenance` was just merged a few hours ago now is the easiest time to fix this: nobody is using the feature yet.
2023-01-02Merge branch 'staging-next' into stagingJan Tojnar1-27/+31
- readline6 attribute removed from all-packages.nix in d879125d61a0be8ecb2afddaca8f2b0530db0260 - readline attribute was bumped to readline82 in 50adabdd60d590c951824974356a9ccb9bb73ffc
2023-01-01stdenv/check-meta: do deep type checksNaïm Favier1-27/+31
Use a wrapper around `mergeDefinitions` to type-check values deeply, so that e.g. `maintainers = [ 42 ];` is an error.
2022-12-18Merge staging-next into staginggithub-actions[bot]1-1/+1
2022-12-17treewide: fix typosfigsoda1-1/+1
2022-12-17stdenv: set `enableParallelBuilding` explicitly if ↵Sergei Trofimovich1-0/+1
`enableParallelBuildingByDefault` is set Without the change we don't propagate `enableParallelBuilding = true` and leave most builds sequential. Noticed on `mythtv` package which did not specify parallelism and `config.enableParallelBuildingByDefault = true` had no effect.
2022-12-17stdenv: use `intersectAttrs` instead of `intersectLists`Naïm Favier1-1/+1
Better complexity.
2022-12-15Merge pull request #205944 from ncfavier/structured-attrs-envNaïm Favier2-6/+11
2022-12-15stdenv: handle `env` gracefullyNaïm Favier2-6/+11
Derivations not using `__structuredAttrs` should not attempt to set environment variables from `env`. Derivations using `__structuredAttrs` should fail if `env` is not exportable.
2022-12-13stdenv: sort defaultNativeBuildInputs alphabeticallyArtturin1-9/+10
2022-12-13stdenv: remove now unneeded linux conditionalArtturin1-6/+0
2022-12-13stdenv/generic: fix todoArtturin1-3/+1
2022-12-10stdenv: detect the type of variable in {prepend,append}ToVarArtturin1-2/+48
stdenv: error if using {prepend,append}ToVar on associative array i don't know how to prepend to associative array
2022-12-08stdenv: export system pname name version for substituteAllArtturin1-0/+4
so we don't have to add these to the env attrset
2022-12-08allow derivation attributes in envArtturin1-2/+2
derivations can be coerced to their output paths
2022-12-08config.structuredAttrsByDefault: add optionArtturin1-1/+1
2022-12-08work around a nix bugArtturin1-0/+4
2022-12-08stdenv: support opt-in __structuredAttrsArtturin3-59/+198
Co-authored-by: Robin Gloster <mail@glob.in> stdenv: print message if structuredAttrs is enabled stdenv: add _append reduces the chance of a user doing it wrong fix nix develop issue output hooks don't work yet in nix develop though making $outputs be the same on non-structuredAttrs and structuredAttrs is too much trouble. lets instead make a function that gets the output names reading environment file '/nix/store/2x7m69a2sm2kh0r6v0q5s9z1dh41m4xf-xz-5.2.5-env-bin' nix: src/nix/develop.cc:299: std::string Common::makeRcScript(nix::ref<nix::Store>, const BuildEnvironment&, const Path&): Assertion `outputs != buildEnvironment.vars.end()' failed. use a function to get all output names instead of using $outputs copy env functionality from https://github.com/NixOS/nixpkgs/pull/76732/commits
2022-11-20Merge staging-next into staginggithub-actions[bot]1-4/+4
2022-11-19splice.nix: start deprecating nativeDrv and crossDrvArtturin1-4/+4
2022-11-14stdenv.tests: Add succeedOnFailureRobert Hensing1-0/+5
2022-11-12stdenv: fix succeedOnFailureSandro Jäckel1-1/+1
2022-10-16Merge #195120: check-meta.nix: fix checkMetaRecursively optionpiegames1-1/+1
2022-10-15Merge pull request #193415 from risicle/ris-nixpkgs-allow-nonsource-fix-1Robert Scott1-2/+5
stdenv/check-meta: fix support for `NIXPKGS_ALLOW_NONSOURCE=1`
2022-10-13check-meta.nix: fix `checkMetaRecursively` optionarcnmx1-1/+1
In specific cases, combining the `checkMeta` and `checkMetaRecursively` config options would result in `error: infinite recursion encountered` fixes #193296
2022-09-28stdenv/check-meta: fix support for NIXPKGS_ALLOW_NONSOURCE=1Robert Scott1-2/+5
2022-09-28Merge staging-next into staginggithub-actions[bot]1-0/+4
2022-09-28check-meta: Add isHydraChannelaszlig1-0/+4
This is needed in order to mark a certain derivation containing a Nix expression tarball to Hydra so that it is recognised as a channel. When I first got an evaluation error due to using this meta attribute, I was under the impression that nobody outside of Vuizvui[1] is using this feature and that we don't have any occurrence of isHydraChannel in Nixpkgs. However, when working around[2] the issue I assumed that it's not something that should be included in Nixpkgs because we're not using it there. It turned out that my assumption was wrong and we *do* use the attribute in Nixpkgs, namely via releaseTools.channel, which is similar to what we're doing in Vuizvui. Since we already include a bunch of undocumented attributes in metaTypes, it only makes sense to add isHydraChannel as well since it's actually documented in the Hydra documentation[3]. [1]: https://github.com/openlab-aux/vuizvui [2]: https://github.com/openlab-aux/vuizvui/commit/e0685e81b3fdc43a272f0 [3]: https://github.com/NixOS/hydra/blob/53335323ae79ca1a42643f58e520b376898ce641/doc/manual/src/jobs.md#meta-fields Signed-off-by: aszlig <aszlig@nix.build>
2022-09-26Merge staging-next into staginggithub-actions[bot]1-13/+32
2022-09-25check-meta.nix: type checking changespiegames1-13/+32
- Enable metadata checking by default, see https://github.com/NixOS/nixpkgs/pull/25304#issuecomment-298385426 - Check metadata before any other package issues, see https://github.com/NixOS/nixpkgs/issues/191124#issuecomment-1246523976 - Document that type checks only apply to the top level of nested values. Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2022-09-22treewide: drop -l$NIX_BUILD_CORESGraham Christensen1-3/+3
Passing `-l$NIX_BUILD_CORES` improperly limits the overall system load. For a build machine which is configured to run `$B` builds where each build gets `total cores / B` cores (`$C`), passing `-l $C` to make will improperly limit the load to `$C` instead of `$B * $C`. This effect becomes quite pronounced on machines with 80 cores, with 40 simultaneous builds and a cores limit of 2. On a machine with this configuration, Nix will run 40 builds and make will limit the overall system load to approximately 2. A build machine with this many cores can happily run with a load approaching 80. A non-solution is to oversubscribe the machine, by picking a larger `$C`. However, there is no way to divide the number of cores in a way which fairly subdivides the available cores when `$B` is greater than 1. There has been exploration of passing a jobserver in to the sandbox, or sharing a jobserver between all the builds. This is one option, but relatively complicated and only supports make. Lots of other software uses its own implementation of `-j` and doesn't support either `-l` or the Make jobserver. For the case of an interactive user machine, the user should limit overall system load using `$B`, `$C`, and optionally systemd's cpu/network/io limiting features. Making this change should significantly improve the utilization of our build farm, and improve the throughput of Hydra.
2022-08-21Set inherit_errexit after bash version checkMatthew Bauer1-1/+2
inherit_errexit wasn’t available in bash 3. We have a check to show a nice error message, but that check is after we set inherit_errexit in setup.sh. So we can just move this to below the BASH_VERSINFO check.
2022-08-01Merge pull request #183507 from Artturin/stdenvmeson1Sandro1-1/+1