hydra/src/root
Josh McSavaney e0d3a1c1a5
Make nix-build args copy-pastable via set -x
A reproduce script includes a logline that may resemble:

> using these flags: --arg nixpkgs { outPath = /tmp/build-137689173/nixpkgs/source; rev = "fdc872fa200a32456f12cc849d33b1fdbd6a933c"; shortRev = "fdc872f"; revCount = 273100; } -I nixpkgs=/tmp/build-137689173/nixpkgs/source --arg officialRelease false --option extra-binary-caches https://hydra.nixos.org/ --option system x86_64-linux /tmp/build-137689173/nixpkgs/source/pkgs/top-level/release.nix -A 

These are passed along to nix-build and that's fine and dandy, but you can't just copy-paste this as is, as the `{}` introduces a syntax error and the value accompanying `-A` is `''`.

A very naive approach is to just `printf "%q"` the individual args, which makes them safe to copy-paste. Unfortunately, this looks awful due to the liberal usage of slashes:

```
$ printf "%q" '{ outPath = /tmp/build-137689173/nixpkgs/source; rev = "fdc872fa200a32456f12cc849d33b1fdbd6a933c"; shortRev = "fdc872f"; revCount = 273100; }'
\{\ outPath\ =\ /tmp/build-137689173/nixpkgs/source\;\ rev\ =\ \"fdc872fa200a32456f12cc849d33b1fdbd6a933c\"\;\ shortRev\ =\ \"fdc872f\"\;\ revCount\ =\ 273100\;\ \}
```

Alternatively, if we just use `set -x` before we execute nix-build, we'll get the whole invocation in a friendly, copy-pastable format that nicely displays `{}`-enclosed content and preserves the empty arg following `-A`:

```
running nix-build...
using this invocation: 
+ nix-build --arg nixpkgs '{ outPath = /tmp/build-138165173/nixpkgs/source; rev = "e0e4484f2c028d2269f5ebad0660a51bbe46caa4"; shortRev = "e0e4484"; revCount = 274008; }' -I nixpkgs=/tmp/build-138165173/nixpkgs/source --arg officialRelease false --option extra-binary-caches https://hydra.nixos.org/ --option system x86_64-linux /tmp/build-138165173/nixpkgs/source/pkgs/top-level/release.nix -A ''
```
2021-03-06 23:25:26 -05:00
..
static Merge branch 'master' into job_headers 2019-03-17 17:16:37 -04:00
all.tt Remove the Jobs table 2020-05-27 20:09:36 +02:00
auth.tt Remove Persona support 2016-10-20 14:14:04 +02:00
bootstrap-2.3.1.zip Add correct bootstrap-2.3.1.zip 2013-04-29 09:54:01 +02:00
build-deps.tt Don't generate clashing IDs 2013-02-20 18:26:26 +01:00
build.tt Normalize nixexpr{input,path} from builds to jobsetevals. 2021-01-22 09:10:18 -05:00
channel-contents.tt Remove nix-install-package support 2018-01-15 14:27:58 +01:00
common.tt Move evaluation errors from evaluations to EvaluationErrors, a new table 2021-02-01 21:33:14 -05:00
dashboard-my-jobs-tab.tt Add a "My jobsets" tab to the dashboard 2013-11-05 16:05:29 +01:00
dashboard-my-jobsets-tab.tt Hide hidden jobsets for project admins by default 2016-10-31 11:40:36 +01:00
dashboard.tt Remove the Jobs table 2020-05-27 20:09:36 +02:00
deps.tt Try harder to find build logs 2013-08-30 13:53:25 +00:00
edit-jobset.tt Merge remote-tracking branch 'origin/master' into flake 2020-03-04 15:28:23 +01:00
edit-project.tt Create projects in enabled state 2019-05-11 00:55:26 +02:00
error.tt Instead hard breaks in multi-line error messages 2013-10-03 18:05:37 +02:00
evals.tt Use bootstrap's pager (instead of pagination) class 2013-04-26 17:51:05 +02:00
flot-0.8.3.zip Update flot to 0.8.3 2014-10-07 13:35:31 +02:00
job-metrics-tab.tt Remove the Jobs table 2020-05-27 20:09:36 +02:00
job.tt Remove the Jobs table 2020-05-27 20:09:36 +02:00
jobset-channels-tab.tt Tie custom channels into channel-contents.tt. 2015-09-10 17:39:55 +02:00
jobset-eval.tt Move evaluation errors from evaluations to EvaluationErrors, a new table 2021-02-01 21:33:14 -05:00
jobset-jobs-tab.tt Jobset.pm: Factor out build->eval mapping. 2015-09-10 17:38:45 +02:00
jobset.tt Render the jobset page correctly when there are fetch errors 2020-05-20 17:47:18 +02:00
layout.tt Merge pull request #628 from dasJ/patch-1 2019-03-17 16:22:53 -04:00
lazy_error.tt Controllers: allows lazy tabs to return custom errors. 2018-12-01 13:40:41 -05:00
log.tt hydra-server: Support logs in S3 2017-04-05 17:55:56 +02:00
machine-status.tt Distinguish build step states 2017-12-07 15:35:31 +01:00
machines.tt machines: Read /etc/nix.machines instead of using the BuildMachines table 2013-03-04 16:03:04 -05:00
Makefile.am Fixes NixOS/hydra#402 (#424) 2017-08-10 14:16:24 +02:00
metric.tt Add support for tracking custom metrics 2015-07-31 00:57:30 +02:00
news.tt Give every page a consistent title 2013-02-20 15:54:33 +01:00
overview.tt Also hide disabled projects on the overview page by default 2016-11-01 13:15:55 +01:00
plain.tt Ensure proper escaping of /build/.../contents pages 2014-08-17 23:43:22 +02:00
product-list.tt Remove SHA-1 hash from BuildProducts 2020-07-27 18:24:10 +02:00
project.tt Remove the "releases" feature 2020-05-06 12:39:21 +02:00
queue-runner-status.tt Add missing file 2016-02-19 20:58:40 +01:00
queue-summary.tt /queue-summary: Show number of queued builds by system type 2016-03-22 17:03:26 +01:00
queue.tt Status page: Show running builds rather than build steps 2014-09-25 20:17:33 +02:00
reproduce.tt Make nix-build args copy-pastable via set -x 2021-03-06 23:25:26 -05:00
runtime-deps.tt Don't generate clashing IDs 2013-02-20 18:26:26 +01:00
search.tt Remove the Jobs table 2020-05-27 20:09:36 +02:00
status.tt Remove obsolete Builds columns and provide accurate "Running builds" 2015-10-27 15:37:17 +01:00
steps.tt hydra-server: Support logs in S3 2017-04-05 17:55:56 +02:00
topbar.tt Don't use enable_github_login option after all 2021-01-04 18:09:49 +01:00
user.tt Add cancel-build role 2019-11-05 22:56:01 +01:00
users.tt Some escaping 2013-07-09 13:55:29 +02:00