Commit Graph

29 Commits

Author SHA1 Message Date
Philip Taron
efb603b277 Avoid top-level with ...; in pkgs/build-support/writers/test.nix 2024-03-19 22:31:19 +01:00
DavHau
9a5b86c189 writers: add support for wrapping
Add a makeWrapperArgs argument to all script writers under pkgs.writers.

This can be used to set, prefix, or suffix the PATH or other environment variables which improves the ability to generate scripts with reproducible behavior.

Some of the writers (writeBash, writeDash, writeFish, writeNu) previously did not support passing an argument set, for example
```
writeBash "example" "echo hello"

```

In order to add the new capability to these writers as well, their call signature is now overloaded in order to allow the following:
(The old call style from the example above remains intact)
```
writeBash "example"
  { makeWrapperArgs = [ "--prefix" "PATH" ":" "${pkgs.hello}/bin" ]; }
  ''
    hello
  ''
```

Done as well:
- add tests
- add more docs
- fix some misleading docs
- extend existing docs with more examples
2024-03-05 14:25:42 +07:00
Vladimír Čunát
ea4b95755d
Revert "writers: add support for wrapping" 2024-03-04 07:05:23 +01:00
DavHau
3e3ae4ecf5 writers: add support for wrapping
Add a makeWrapperArgs argument to all script writers under pkgs.writers.

This can be used to set, prefix, or suffix the PATH or other environment variables which improves the ability to generate scripts with reproducible behavior.

Some of the writers (writeBash, writeDash, writeFish, writeNu) previously did not support passing an argument set, for example
```
writeBash "example" "echo hello"

```

In order to add the new capability to these writers as well, their call signature is now overloaded in order to allow the following:
(The old call style from the example above remains intact)
```
writeBash "example"
  { makeWrapperArgs = [ "--prefix" "PATH" ":" "${pkgs.hello}/bin" ]; }
  ''
    hello
  ''
```

Done as well:
- add tests
- add more docs
- fix some misleading docs
- extend existing docs with more examples
2024-02-29 17:31:58 +07:00
Tulili
703a085c0a pkgs.writers: tests for lua ruby, and remove failed tests because of external package errors 2024-01-30 06:48:43 +01:00
Tulili
f6e0ee5545 pkgs.writers: remove tests that dont work anymore and add comments tracking issues 2024-01-30 06:48:35 +01:00
Raphael Robatsch
5ba1e86bb0 tests.writers.simple.fsharp: Add missing dependency
This test currently fails because `FSharp.SystemTextJson` depends on
`System.Text.Json`. Fix the test by adding the missing dependency.
2023-12-11 09:47:06 +01:00
Robert Hensing
a6622bf00a writers/test: Refactor
It now also checks the executable bit.
2023-10-24 11:17:38 +02:00
Robert Hensing
79130267d3 writers/data.nix: Remove duplicate implementations 2023-10-24 11:17:38 +02:00
zimbatm
504e42b559 writers: introduce data writers
Make it easy to write structured data back to disk.
2023-07-22 17:54:41 +02:00
zimbatm
73ee03cbc5 writers: split out the tests
Make it easier to run and debug individual tests.
2023-07-22 17:53:52 +02:00
pacien
6e4a14b54f writers: add writeFish and writeFishBin
This adds writers for Fish shell scripts, with syntax checking.
2022-10-10 15:59:23 +02:00
Moises Nessim
81998d0a1d Add writeFSharp and makeFSharpWriter functions to writers
Uses fsharp interactive (fsi) to run fsx script

Expose mkNugetSource and mkNugetDeps functions

Use them in writers.writeFSharp and buildDotnetModule

Add tests
2022-02-28 17:40:43 -05:00
Markus S. Wamser
b93e478777 writers.PyPy{2,3}: init 2021-12-15 10:01:08 +01:00
Markus S. Wamser
4e42f6bcb3 writers.writePython2: remove 2021-12-15 09:56:14 +01:00
Jörg Thalheim
982f46985e writers: drop writeC
This function is fundamentally broken.
Not even the ncurses example will compile.
The interface needs to be rethought for it to work (i.e. don't
unconditionally include all pc files, set include path and ld path and
rpath).
Since it is unlikely that in the current this has any user, just drop it for now.
2021-08-25 20:16:31 +02:00
sternenseemann
6bd0c16f89 tests.writers: also expose path via passthru 2021-07-13 15:22:34 +02:00
sternenseemann
3bc8e5cd23 tests.writers: use dashes instead of underscores in drv names
This is more in line with standard derivation name policy in nixpkgs.
2021-06-08 14:06:41 +02:00
sternenseemann
f46a1e353a tests.writers: give all test derivations unique names
This makes it easier to debug test failures since the derivation name
will give an indication which writer it belongs to.
2021-06-08 14:06:41 +02:00
Sandro Jäckel
03831816d8
writers: format 2021-03-05 18:14:34 +01:00
Ben Siraphob
98f26993f2 treewide: remove stdenv where not needed 2021-03-04 19:54:50 +07:00
Pavol Rusnak
90f7338112
treewide: stdenv.lib -> lib 2021-01-24 01:49:49 +01:00
Dominik Xaver Hörl
14205a6429 writers: add test for rust 2021-01-12 11:03:08 +01:00
Adrian Gierakowski
76437a88bb writers.writePython2 and writePython3: use "bare" python if no deps are needed
`python.withPackages` has a runtime dependecy on bash since it's wrapped with
`makeWrapper`. This fix avoids bash as runtime dependency when it's not
needed.

as discussed here: https://github.com/NixOS/nixpkgs/issues/93609#issuecomment-662880047
2020-07-24 11:39:01 +01:00
lassulus
6d807882ad writers test: use writeC with library for testing 2019-10-23 20:47:27 +02:00
lassulus
e7cccb74ee writers test: fix python2 linter errors 2019-10-23 20:47:27 +02:00
volth
7b8fb5c06c treewide: remove redundant quotes 2019-09-08 23:38:31 +00:00
lassulus
995defbb9b build-support writers: content can be string or file 2018-12-04 16:40:32 +01:00
lassulus
2d02cd7790 build-support writers: add tests 2018-11-27 07:08:13 +01:00