Commit graph

4479 commits

Author SHA1 Message Date
Tobias Bergkvist df13841609
Merge branch 'bergkvist/make-c-wrapper' into make-c-wrapper 2021-12-09 13:00:24 +01:00
Jacek Galowicz 177f0a6eed make makeWrapper and makeBinaryWrapper drop-in-replaceable 2021-12-09 11:32:29 +00:00
Doron Behar 32d566e1b9 wrapProgramBinary -> binaryWrapProgram 2021-12-08 18:59:38 +02:00
Jacek Galowicz f3b16a6b5d Fix typo in make-binary-wrapper 2021-12-08 10:26:17 +00:00
Tobias Bergkvist 7cf1aa102a Separate out indentation responsibility to indent4 in makeCWrapper using awk.
Generated code no longer needs to worry about its own indent level in the output.
2021-12-07 17:42:54 +01:00
Tobias Bergkvist 2b5a2d4a8e Switch to embedding input arguments instead of generated C code in binary. 2021-12-07 01:50:38 +01:00
Tobias Bergkvist 64da82731d Add new argument: --chdir DIR (alternative to --run "cd DIR" in makeWrapper) 2021-12-02 03:39:25 +01:00
Tobias Bergkvist a47286f0a0 Add argument --inherit-argv0 to replace use case --argv0 '$0'. Fix wrapProgramBinary by using this new argument 2021-12-02 02:29:00 +01:00
Tobias Bergkvist e3c94f3d6b Use cc instead of gcc in makeBinaryWrapper 2021-12-02 02:07:17 +01:00
Tobias Bergkvist a1e62262bc Replace concat3 with asprintf in set_env_prefix and set_env_suffix. 2021-12-01 23:27:26 +01:00
Tobias Bergkvist 3997e9de67 Switch from malloc to calloc in addFlags 2021-12-01 23:07:30 +01:00
Tobias Bergkvist 97d62a90f5 Switch from exit(1) to abort() in assert_success 2021-12-01 22:56:18 +01:00
Tobias Bergkvist 4e55d34535 Add assertValidEnvName and check that variable name is valid during code generation. Add assert_success, and assert that setenv/unsetenv succeeds to crash if they don't 2021-12-01 22:49:20 +01:00
Tobias Bergkvist 3a014be2f2 Assert that malloc does not return a NULL pointer for better error messages + to satisfy static analysis tools. 2021-11-09 02:56:32 +01:00
Tobias Bergkvist 1218b82bce Move assertExecutable from makeCWrapper to makeBinaryWrapper to ensure that makeCWrapper is a pure function 2021-10-19 14:37:05 +02:00
Doron Behar c310cb0d94 makeBinaryWrapper: add wrapProgramBinary (like wrapProgram) 2021-10-19 05:30:42 -07:00
Doron Behar a45c5db391 makeBinaryWrapper: Assert $1 is executable 2021-10-19 05:30:42 -07:00
Tobias Bergkvist adef70ce7c Specify uses_prefix, uses_suffix and uses_concat3 as local vars. Make sure errors in makeCWrapper are located next to the line with the issue. 2021-10-04 14:29:22 +02:00
Tobias Bergkvist 3df841bb99 Make error messages more consistent 2021-10-01 18:57:26 +02:00
Tobias Bergkvist d930fecc3c Return an #error macro if the wrong number of arguments are supplied 2021-10-01 18:51:19 +02:00
Tobias Bergkvist b62216a211 Fix shellcheck warnings. Use single quotes for printf format strings. Switch to strncpy in concat3. Use multiline strings to print C functions. Switch from if/elif to case. 2021-10-01 17:43:23 +02:00
Tobias Bergkvist b58c857bfb Switch to using strlen in concat3Fn. Make sure uses-variables are local to improve purity of makeCWrapper. Refactor 2021-08-26 14:36:30 +02:00
Tobias Bergkvist dcba4171d4 Add support for --add-flags, --prefix and --suffix 2021-08-23 23:44:57 +02:00
Tobias Bergkvist 1d64281401 Remove line at the bottom of make-binary-wrapper that executes makeBinaryWrapper "$@" 2021-06-01 01:25:22 +02:00
Tobias Bergkvist 8d2964a8e6 Rename make-c-wrapper.sh to make-binary-wrapper.sh. Refactor to match style of other setup-hooks. Add compilation step with gcc. Embed the entire generated source code into the binary for troubleshooting. 2021-06-01 01:02:08 +02:00
Tobias Bergkvist e8cedf3819 make-c-wrapper: Fix typo in generated documentation 2021-05-27 02:04:12 +02:00
Tobias Bergkvist 131ed20b2f make-c-wrapper: Remove trailing whitespace (editorconfig) 2021-05-27 01:56:23 +02:00
Tobias Bergkvist eef4fa82c1 make-c-wrapper: Fix typo in generated code documentation 2021-05-27 01:47:40 +02:00
Tobias Bergkvist de1f53b84d Add make-c-wrapper.sh for creating binary executable wrappers 2021-05-27 01:11:06 +02:00
Daniël de Kok 7eddab91f5
Merge pull request #123867 from danieldk/maturin-0.10.5
maturin: 0.10.4 -> 0.10.6
2021-05-25 16:01:47 +02:00
Léo Gaspard b6933f88a5
fetchurl: add testpypi mirror (#123146)
This should make it easier to run nixpkgs-based tests from versions that
are still only on test-pypi, and should not cost anything significant.
2021-05-24 22:24:30 +02:00
Jonathan Ringer 11a9ac00fc
Merge remote-tracking branch 'origin/master' into staging-next
Conflicts:
 pkgs/tools/networking/xh/default.nix
2021-05-22 18:19:10 -07:00
Maximilian Bosch ef99783505
Merge pull request #122248 from aszlig/hocker-fetchdocker-eval-error
Fix fetchdocker call signature
2021-05-22 23:06:25 +02:00
Daniël de Kok 11307c1d47 maturinBuildHook: add rustc to deps
maturin 0.10.5 uses rustc -vV to find the host:

e886c85f5a

We now need to make rustc visible to the hook for maturin to work
properly.
2021-05-21 07:51:27 +02:00
Jonathan Ringer c1f8a15dac
Merge remote-tracking branch 'origin/master' into staging-next
Conflicts:
  nixos/doc/manual/release-notes/rl-2105.xml
  pkgs/tools/security/sequoia/default.nix
2021-05-19 10:39:54 -07:00
Robert Hensing 5bbdc24b2a
Merge pull request #123597 from hercules-ci/issue-123572
tests.trivial: Avoid evaluation and ${pkgs.path} dep
2021-05-19 11:57:32 +02:00
Robert Hensing 14f54a8b3c tests.trivial: Add meta 2021-05-19 11:41:45 +02:00
talyz 27f8f6956a
replace-secret: Init
Add a small utility script which securely replaces secrets in
files. Doing this with `sed`, `replace-literal` or similar utilities
leaks the secrets through the spawned process' `/proc/<pid>/cmdline` file.
2021-05-19 09:32:00 +02:00
Robert Hensing 35406647fd tests.trivial: Avoid evaluation and ${pkgs.path} dep
> 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.
2021-05-19 01:06:09 +02:00
Jonathan Ringer c227fb4b17
Merge remote-tracking branch 'origin/master' into staging-next
Conflicts:
	pkgs/development/tools/rust/cargo-cache/default.nix
	pkgs/development/tools/rust/cargo-embed/default.nix
	pkgs/development/tools/rust/cargo-flash/default.nix
	pkgs/servers/nosql/influxdb2/default.nix
2021-05-17 07:01:38 -07:00
Robert Hensing ea0c94f50d
Merge pull request #123111 from hercules-ci/writeDirectReferencesToFile
writeDirectReferencesToFile and maintenance
2021-05-17 15:44:10 +02:00
Andrew Childs 79e34294bd nukeReferences: fix code signatures on aarch64-darwin 2021-05-17 00:27:03 +09:00
Andrew Childs f067102afe removeReferencesTo: fix code signatures on aarch64-darwin 2021-05-17 00:27:03 +09:00
Andrew Childs 772b66531a darwin: wrap strip and install_name_tool to codesign modified files
Co-authored-by: Moritz Angermann <moritz.angermann@gmail.com>
2021-05-17 00:27:02 +09:00
Andrew Childs c696fcdacb fixDarwinDylibNames: set name of install_name_tool 2021-05-17 00:27:01 +09:00
Andrew Childs 15637fe621 bintools-wrapper: support post linker hooks 2021-05-17 00:27:01 +09:00
Robert Hensing ed4523186e writeReferencesToFile: docs and tests 2021-05-15 17:04:25 +02:00
Robert Hensing cc60f81e69 writeDirectReferencesToFile: init 2021-05-15 17:04:25 +02:00
John Ericson 18c38f8aee treewide: All the linker to be chosen independently
This will begin the process of breaking up the `useLLVM` monolith. That
is good in general, but I hope will be good for NetBSD and Darwin in
particular.

Co-authored-by: sterni <sternenseemann@systemli.org>
2021-05-14 21:29:51 +00:00
Jan Tojnar ac6a4f7cf5
Merge branch 'staging-next' into staging 2021-05-14 01:40:09 +02:00