summary refs log tree commit diff
path: root/pkgs/build-support
AgeCommit message (Collapse)AuthorFilesLines
2022-11-16Merge pull request #201472 from ncfavier/remove-dead-make-symlinksfigsoda2-16/+0
remove dead `make-symlinks` builder
2022-11-16Merge pull request #199300 from Fuuzetsu/escape-rust-exportsAaron Andersen1-1/+13
rustBuildCrate: properly handle cargo env pragmas with spaces
2022-11-16remove dead `make-symlinks` builderNaïm Favier2-16/+0
Introduced in 5808ac7148850a79d9ff59e37368bdd13f187adf, never used again after b06335a835ac8b7bc40c77e0089e8e8556bac3cc.
2022-11-15tests.trivial-builders.linkFarm: initBernardo Meurer1-0/+45
2022-11-15linkFarm: make last entry win in case of list repeatsBernardo Meurer1-1/+2
2022-11-15Merge pull request #170048 from lovesegfault/link-farm-passthruRobert Hensing1-10/+26
linkFarm: add entries to passthru
2022-11-15linkFarm: allow entries to be an attrsetBernardo Meurer1-10/+22
2022-11-15linkFarm: add entries to passthruBernardo Meurer1-8/+12
2022-11-10Merge master into staging-nextgithub-actions[bot]14-0/+780
2022-11-10patchRcPath hooks: use the passthru argumentShamrock Lee1-24/+20
2022-11-10patchRcPathBash, patchRcPathCsh, patchRcPathFish, patchRcPathPosix: initShamrock Lee14-0/+784
Init patchRcPath hooks, which provides utilities to patch shell scripts to be sourced by users. Add test cases and documentation.
2022-11-10Merge master into staging-nextgithub-actions[bot]1-0/+15
2022-11-09build-support/rust/lib: Add `toTargetFamily`John Ericson1-0/+15
Taken from https://github.com/kolloch/crate2nix/pull/255/files, it belongs in Nixpkgs not crate2nix. I have been using that P.R. for a few months without incident.
2022-11-09Merge master into staging-nextgithub-actions[bot]11-0/+1567
2022-11-09buildNpmPackage: initWinter11-0/+1567
2022-11-07Merge master into staging-nextgithub-actions[bot]5-0/+320
2022-11-06patchPpdFilesHook: new setup hook for absolute executable pathsYarny05-0/+320
PostScript Printer Description (ppd) files describe printer features and capabilities. They are usually evaluated by CUPS to convert print jobs into a format suitable for a printer. The conversion is often accomplished by commands or even short shell scripts inside the ppd files. ppd files are included in many printer driver packages. Their scripts sometimes refer to other executables; some of them are more common (like `perl`), others are more exotic (like `rastertohp`). If an executable is called with its name alone, the effects of the ppd file depend on whether the executable is in the PATH of CUPS, and on the executable's version. If an executable is called with an absolut path (like `/usr/bin/perl`), it won't work at all in NixOS. The commit at hand adds a setup hook that uses the `fixupPhase` to substitute certain executable's invocations in pdd files with absolute paths. To use it, add the hook to `nativeBuildInputs` and provide a list of executable names in `ppdFileCommands`. Each executable must be available in the package that is being built, or in `buildInputs`. The setup hook's script then looks for ppd files in `share/cups/model` and `share/ppds` in each output, and replaces executable names with their absolute paths. If ppd files need to be patched in unorthodox locations or the setup hook needs to be invoked manually for other reasons, one may leave the list `ppdFileCommands` empty to avoid automatic processing of ppd files, then call the shell function `patchPpdFileCommands` directly. Details are described in the file `patch-ppd-hook.sh`. Notes on the motivation for this setup hook: Most packages in nixpkgs that provide ppd files do not patch those ppd files at all. This is not fatal when the executables are just called with their names since the user can add packages with the executables to `services.printing.drivers`. E.g. if the user adds `pkgs.perl`, then all ppd files that invoke `perl` will work as expected. Nevertheless, to make these ppd files independent of their execution environment, command invocations should be substituted with absolut paths into the nix store. This is similar to patching shebang lines so scripts can be called independently of having the interpreter in the PATH. The hook script in this commit is meant to support new packages `foomatic-db*` which will generate several thousands of ppd files referencing a plethora of different executables. During development of these packages, I realized that it's quite hard to patch ppd files in a robust way. While binary names like `rastertokpsl` seem to be sufficiently unique to be patched with `sed`, names like `date` or `gs` are hard to patch without producing "false positives", i.e., coincidental occurences of the executable's name that do *not* refer to the executable and should not be patched at all. As this problem also affects other packages, it seems reasonable to put a robust implementation in its own setup hook so that other packages can use it without much effort. Notes on the implementation: The ppd file format is far from trivial. The basic structure are key-value pairs; keys may occur multiple times. Only a small subset of keys may contain executable names or shell scripts in their values. Some values may span multiple lines; a linebreak might even occur in the middle of a token. Some executable names also occur in other keys by accident where they must not be substituted (e.g. `gs` or `date`). It is necessary to provide the list of command names that will be patched for two reasons: ppd files often contain "tokens" that might look like commands (e.g. "file" or "host") but aren't; these would erroneously get patched. Also, looking for everything that might be a command would slow down the patching process considerably. The implementation uses `awk` to detect keys that might contain executable names; only their values are treated for substitution. This avoids most cases of "overzealous" substitutions. Since values may span multiple lines, `sed` alone (while faster than `awk`) cannot focus its substitution capabilities on relevant keys. An elaborate set of regular expressions further helps to minimize the probability of "false positives". Several tricks are employed to speed up `awk`. Notably, relevant files are identified with `grep` before `awk` is applied to those files only. Note that the script probably cannot handle fancy command names (like spaces or backslashes as part of the name). Also, there are still edge cases that the script would mistakenly skip, e.g. if a shell script contains a line break in the middle of an executable's name; although ppd files permit such constellations, I have yet to see one. ppd files may be gzipped. The setup hook accepts gzipped ppd files: It decompresses them, substitutes paths, then recompresses them. However, Nix cannot detect substituted paths as runtime dependencies in compressed ppd files. To ensure substituted paths are propagated as runtime dependencies, the script adds each substituted path to the variable `propagatedBuildInputs`. Since this might not be enough for multi-output packages, those paths are also written directly to `nix-support/propagated-build-inputs`. See the comment in `patch-ppd-hook.sh` for details. Finally, the setup hook comes with a small test that probes some edge cases with an artificial ppd file. References: * https://www.cups.org/doc/spec-ppd.html * general ppd file specification * lists some keys that may contain executable names or shell scripts * https://refspecs.linuxfoundation.org/LSB_4.0.0/LSB-Printing/LSB-Printing/ppdext.html * lists some keys that may contain executable names or shell scripts * https://en.wikipedia.org/wiki/PostScript_Printer_Description#CUPS * lists the usual locations of ppd files
2022-11-05Merge staging-next into staginggithub-actions[bot]1-1/+1
2022-11-04Merge pull request #198489 from Artturin/fetchgitlabremoteavvtArtturi1-1/+1
fetchFromGitLab: don't passthruAttrs fetchGit specific attrs to fetchUrl
2022-11-03rustBuildCrate: properly handle cargo env pragmas with spacesMateusz Kowalczyk1-1/+13
There are two problems: first that we end up splitting on spaces in the loop. Even when that is fixed, we still would split on spaces in the `export` inside the loop. We need to guard against both. Fixes #199298 Confirmed that it fixes the case mentioned in the ticket: ```console [nix-develop]$ $(nix-build -I nixpkgs=/home/shana/programming/nixpkgs Cargo.nix -A rootCrate.build --no-out-link)/bin/nix-rustc-env-escape-repro Expecting three words, got: first second third ``` I think this is going to cause a rebuild of every Rust package even if they were unaffected, not much we can do here.
2022-10-30cargoSetupHook: pass host config flagsYureka2-8/+30
2022-10-29fetchFromGitLab: don't passthruAttrs fetchGit specific attrs to fetchUrlArtturin1-1/+1
if `fetchSubmodules = false` to 'fetchFromGitLab' then theres the following error error: anonymous function at /nix/store/9m8drnpifyl5qsx93g6ll2xw6wkps03z-source/pkgs/build-support/fetchurl/default.nix:41:1 called with unexpected argument 'fetchSubmodules' at /nix/store/9m8drnpifyl5qsx93g6ll2xw6wkps03z-source/pkgs/build-support/fetchzip/default.nix:36:1: 35| 36| fetchurl (( | ^ 37| if (pname != "" && version != "") then
2022-10-29Merge staging-next into staginggithub-actions[bot]3-215/+0
2022-10-29Merge master into staging-nextgithub-actions[bot]3-215/+0
2022-10-28Merge pull request #197997 from atorres1985-contrib/hummingbirdAnderson Torres3-215/+0
skawarePackages: reformat
2022-10-28Merge pull request #197937 from danielbarter/cc-wrapper-hookJohn Ericson1-0/+6
cc-wrapper: adding a cc-wrapper-hook to the cc-wrapper
2022-10-28skawarePackages: move all of them to development/skaware-packagesAndersonTorres3-215/+0
2022-10-28Revert "Merge #191724: cc-wrapper: remove duplicate include flags"Vladimír Čunát3-125/+1
Let's redo this later, with more testing and less bugs. This reverts commits 4f6e99870b6f05 and d700d8e8a264.
2022-10-26cc-wrapper: adding a cc-wrapper-hook to the cc-wrapperDaniel Barter1-0/+6
2022-10-25Merge staging-next into staginggithub-actions[bot]1-1/+3
2022-10-25build-dotnet-module: don't end with exit code 1 when update was sucessfullSandro Jäckel1-1/+3
otherwise scripts might end prematurely
2022-10-25Merge staging-next into staginggithub-actions[bot]1-36/+0
2022-10-25ocamlPackages.buildOcaml: removeVincent Laporte1-36/+0
2022-10-23Merge staging-next into staginggithub-actions[bot]1-1/+1
2022-10-23Merge pull request #196681 from corngood/fix-nuget-to-nixAnderson Torres1-1/+1
nuget-to-nix: fix warning when package is installed from sdk
2022-10-20Merge staging-next into staginggithub-actions[bot]1-49/+71
2022-10-20Merge master into staging-nextgithub-actions[bot]1-49/+71
2022-10-19Merge pull request #192639 from ylecornec/ylecornec/buildBazelPackage-testsSandro1-49/+71
2022-10-19Merge staging-next into staginggithub-actions[bot]1-1/+2
2022-10-19Merge master into staging-nextgithub-actions[bot]1-1/+2
2022-10-18FHSEnv: export /etc/shellsDaniel Poelzleithner1-0/+1
/etc/shells is often read by programs to determine which shells should be provided. Fixes problems with extensions in vscode-fhs
2022-10-18build-fhs-userenv-bubblewrap: use -m not -f for readlinkStella1-1/+1
This change will let more inexistent paths be passed along, avoiding extremely weird and hard to debug behavior. See https://github.com/containers/bubblewrap/issues/520 for what I personally encountered.
2022-10-18nuget-to-nix: fix warning when package is installed from sdkDavid McFarland1-1/+1
2022-10-17Merge staging-next into staginggithub-actions[bot]1-26/+21
2022-10-17Merge master into staging-nextgithub-actions[bot]1-26/+21
2022-10-16Merge pull request #191134 from Et7f3/remove-duplicate-code-cc-wrapperSergei Trofimovich1-2/+0
cc-wrapper: remove duplicate C{C,XX}${role_post}
2022-10-16Merge pull request #193075 from Ma27/nextcloud-pkg-fixMaximilian Bosch1-26/+21
fetchNextcloudApp: rewrite with fetchzip & applyPatches
2022-10-14stdenv cc-wrapper: revert a problematic change for non-LinuxVladimír Čunát2-1/+123
The change from 0bea4a194f71 (PR #191724) broke stdenv bootstap on *-darwin, and I didn't want to drop the *-linux binaries that we have already.
2022-10-13Merge remote-tracking branch 'origin/staging-next' into stagingMartin Weinelt1-10/+11
2022-10-13Merge pull request #141050 from koenw/dockertools_too_many_argumentsRobert Hensing1-10/+11
build-support: Fix error when building images with many layers