summary refs log tree commit diff
path: root/pkgs/build-support/trivial-builders
Commit message (Collapse)AuthorAge
* shellcheck-minimal: initYueh-Shun Li2023-11-01
| | | | Expose the minimal and stripped shellcheck package used by writeShellApplication.
* writeShellApplication: exclude shell checkscon-f-use2023-10-15
|
* writers.writeCBin: fix binary name when cross-compilingArtturin2023-09-21
| | | | | | `$name` contains cross-compilation info `bin/wrapped-argv0-aarch64-unknown-linux-gnu` name should not be set directly.
* Merge pull request #251369 from srid/writeShellApplication-metafigsoda2023-09-01
|\
| * trivial-builders: add meta to writeShellApplicationSridhar Ratnakumar2023-08-25
| |
* | applyPatches: fix adding meta informationMaximilian Bosch2023-08-20
| |
* | trivial-builders/applyPatches: carry `meta` information to the patched sourceRaito Bezarius2023-08-20
|/ | | | | | There is no reason to not carry licenses and other information to any patched source. This should improve our metadata in those situations.
* trivial-builders: add meta.mainProgram to writeShellScriptBinCharlie Moog2023-08-11
| | | | | | | | | | | | | | | | | | | | Derivations built with `writeShellScriptBin` should always be runnable with `nix run`. At present, the derivation is missing both `meta.mainProgram` and `pname`– this means that `nix run` falls back to inferring the bin path from `name`. This is unreliable and depends on faulty heuristics. For context, reference the following snippet from `nix run --help`: If installable evaluates to a derivation, it will try to execute the program <out>/bin/<name>, where out is the primary output store path of the derivation, and name is the first of the following that exists: · The meta.mainProgram attribute of the derivation. · The pname attribute of the derivation. · The name part of the value of the name attribute of the derivation.
* Merge pull request #240348 from fgaz/write-shell-application/check-platformsFrancesco Gazzetta2023-08-09
|\ | | | | writeShellApplication: use shellcheck only where supported
| * writeShellApplication: use shellcheck only where supportedFrancesco Gazzetta2023-08-05
| |
* | requireFile: fix error message with SRI hashesK9002023-08-04
|/
* tests.trivial-builders.writeTextFile: Test meta.mainProgram logicRobert Hensing2023-07-26
|
* tests.trivial-builders.references: Only run where supportedRobert Hensing2023-07-26
|
* trivial-builders: Move test list closerRobert Hensing2023-07-26
|
* writeCBin: Add meta.mainProgramRobert Hensing2023-07-26
| | | | ... and add tests.
* runCommand: don't set meta.position if meta is givenNaïm Favier2023-07-07
| | | | | | | Fixes #242093 without breaking #237589 If `meta` is given we probably already have position information, so no need to get it from the arguments.
* makeSetupHook: unbreak structuredAttrsByDefaultArtturin2023-06-30
|
* runCommand: set meta.position from the argumentsNaïm Favier2023-06-14
| | | | | | | | Currently all packages defined by a call to runCommand have their meta.position pointing to trivial-builders.nix. This change makes uses of runCommand that supply at least one attribute in the second argument point to the right file.
* writeTextFile: revert workaround for `executable = null`figsoda2023-05-31
|
* writeTextFile: fix when executable is not a boolfigsoda2023-05-29
|
* writeTextFile: set meta.mainProgram based on destinationfigsoda2023-05-27
|
* writeScriptBin, writeShellScriptBin: add meta.mainProgram automaticallyYueh-Shun Li2023-05-26
|
* trivial-builders: move into the directory named alike (#223429)Sandro2023-05-06
| | | | | While searching for something different I wondered why there is a trivial-builders.nix file next to the trivial-builders directory where only tests live. Lets fix that.
* writeTextFile: chmod before checkPhaseNaïm Favier2023-03-29
| | | | | | | | | | Set the executable bit before running the check phase, so that the check phase can run the script to test its behaviour. This aligns with what `concatTextFile` is doing. Also use explicit `if` statements so that we don't silently ignore `chmod` failures.
* trivial-builders/test/references.nix: fix evalAdam Joseph2023-03-17
| | | | | | | | | | | | | | | | | | | | | | | | | The command ``` nix-build -A tests.trivial-builders.references --show-trace ``` fails eval with ``` in job ‘nixpkgs.tests.trivial-builders.references’: error: The option `meta.description' does not exist. Definition values: - In `makeTest parameters': "Run the Nixpkgs trivial builders tests" ``` because `meta.description` and `meta.license` are not valid for `nixosTest`s (they are valid for `mkDerivation` of course). This has been causing Hydra eval failures: https://hydra.nixos.org/jobset/nixos/pr-209870-gcc-external-bootstrap#tabs-errors Let's fix eval by removing these attributes.
* tests.trivial-builders.linkFarm: initBernardo Meurer2022-11-15
|
* treewide: nixosTest -> testers.nixosTestRobert Hensing2022-05-09
|
* build-support/writeTextFile: add test for weird file namesK9002022-03-10
|
* nixos/nix-daemon: use structural settingspolykernel2022-01-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `nix.*` options, apart from options for setting up the daemon itself, currently provide a lot of setting mappings for the Nix daemon configuration. The scope of the mapping yields convience, but the line where an option is considered essential is blurry. For instance, the `extra-sandbox-paths` mapping is provided without its primary consumer, and the corresponding `sandbox-paths` option is also not mapped. The current system increases the maintenance burden as maintainers have to closely follow upstream changes. In this case, there are two state versions of Nix which have to be maintained collectively, with different options avaliable. This commit aims to following the standard outlined in RFC 42[1] to implement a structural setting pattern. The Nix configuration is encoded at its core as key-value pairs which maps nicely to attribute sets, making it feasible to express in the Nix language itself. Some existing options are kept such as `buildMachines` and `registry` which present a simplified interface to managing the respective settings. The interface is exposed as `nix.settings`. Legacy configurations are mapped to their corresponding options under `nix.settings` for backwards compatibility. Various options settings in other nixos modules and relevant tests have been updated to use structural setting for consistency. The generation and validation of the configration file has been modified to use `writeTextFile` instead of `runCommand` for clarity. Note that validation is now mandatory as strict checking of options has been pushed down to the derivation level due to freeformType consuming unmatched options. Furthermore, validation can not occur when cross-compiling due to current limitations. A new option `publicHostKey` was added to the `buildMachines` submodule corresponding to the base64 encoded public host key settings exposed in the builder syntax. The build machine generation was subsequently rewritten to use `concatStringsSep` for better performance by grouping concatenations. [1] - https://github.com/NixOS/rfcs/blob/master/rfcs/0042-config-option.md
* Merge branch 'staging-next' into stagingJan Tojnar2022-01-10
|\ | | | | | | | | | | | | ; Conflicts: ; nixos/doc/manual/from_md/release-notes/rl-2205.section.xml ; nixos/doc/manual/release-notes/rl-2205.section.md ; pkgs/build-support/libredirect/default.nix
| * tests.concat: added empty casePasquale2022-01-04
| |
| * concatText: test now worksPasquale2021-12-30
| |
| * concatText: add testPasquale2021-12-02
| |
* | tests.trivial-builders.overriding: update after shellDryRunNaïm Favier2021-12-27
|/
* test.trivial-builders: Add test cases, fix test runner, renameRobert Hensing2021-11-01
| | | | | The writeStringReferencesToFile didn't handle non-unique references to the same path correctly.
* trivial-builders: Add writeStringReferencesToFiletalyz2021-10-28
| | | | | | | | | Add writeStringReferencesToFile, a builder which extracts a string's references to derivations and paths and writes them to a text file, removing the input string itself from the dependency graph. This is useful when you want to make a derivation depend on the string's references, but not its content (to avoid unnecessary rebuilds, for example).
* trivial-builders: refactor writeTextFile to be overridabledeliciouslytyped2021-06-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes #126344, specifically with the goal of enabling overriding the checkPhase argument. See `design notes` at the end for details. This allows among other things, enabling bash extension for the `checkPhase`. Previously using such bash extensions was prohibited by the `writeShellScript` code because there was no way to enable the extension in the checker. As an example: ```nix (writeShellScript "foo" '' shopt -s extglob echo @(foo|bar) '').overrideAttrs (old: { checkPhase = '' # use subshell to preserve outer environment ( export BASHOPTS shopt -s extglob ${old.checkPhase} ) ''; }) ``` This commit also adds tests for this feature to `pkgs/tests/default.nix`, under `trivial-overriding`. The test code is located at `pkgs/build-support/trivial-builders/test-overriding.nix`. Design notes: ------------- Per discussion with @sternenseemann, the original approach of just wrapping `writeTextFile` in `makeOverridable` had the issue that combined with `callPackage` in the following form, would shadow the `.override` attribute of the `writeTextFile`: ```nix with import <nixpkgs>; callPackage ({writeShellScript}: writeShellScript "foo" "echo foo") ``` A better approach can be seen in this commit, where `checkPhase` is moved from an argument of `writeTextFile`, which is substituted into `buildCommand`, into an `mkDerivation` argument, which is substituted from the environment and `eval`-ed. (see the source) This way we can simple use `.overideAttrs` as usual, and this also makes `checkPhase` a bit more conformant to `mkDerivation` naming, with respect to phases generally being overridable attrs. Co-authored-by: sterni <sternenseemann@systemli.org> Co-authored-by: Naïm Favier <n@monade.li>
* tests.trivial: Add emptyFile, emptyDirectory to samplesRobert Hensing2021-06-12
|
* tests.trivial: Add metaRobert Hensing2021-05-19
|
* tests.trivial: Avoid evaluation and ${pkgs.path} depRobert Hensing2021-05-19
| | | | | | > There is an issue in the test added by #123111. > [it] introduces a dependency on the contents of nixpkgs, > making every change evaluate with a different hash.
* writeReferencesToFile: docs and testsRobert Hensing2021-05-15
|
* writeDirectReferencesToFile: initRobert Hensing2021-05-15