Skip to content

Commit

Permalink
build: fix post build hook (#425)
Browse files Browse the repository at this point in the history
If you look past all those backslashes, the post build hook is adding
the command `OUT_PATHS=$OUT_PATHS /run/uploadToCache` to the queue (where
`$OUT_PATHS` has been substituted for the actual value). This only works when
`$OUT_PATHS` contains no spaces.

As an example, running `pueue add -- VAR="hello world" printenv VAR` adds the
command `VAR=hello world printenv VAR` to the queue, which is not what we want.
The queue tries to run a command called `world` with arguments `printenv` and
`VAR`. The problem is that the quotes around the variable aren't carried onto
the queue.  We need to run `pueue add -- VAR=\"hello world\" printenv VAR` so
that the queue executes `VAR="hello world" printenv VAR`.
  • Loading branch information
LightAndLight authored Jun 1, 2023
1 parent 1ca11c7 commit 7875a6f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/postBuildHook
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#! /bin/sh

su -l runner -c "env PATH=\"\$PATH:\$HOME/bin\" pueue add -- OUT_PATHS=\"$OUT_PATHS\" /run/uploadToCache"
su -l runner -c "env PATH=\"\$PATH:\$HOME/bin\" pueue add -- OUT_PATHS=\\\"$OUT_PATHS\\\" /run/uploadToCache"
2 changes: 1 addition & 1 deletion .github/workflows/postBuildHookMacos
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#! /bin/sh

su -l runner -c "env PATH=\"\$PATH:\$HOME/bin\" \$(readlink \$HOME/.nix-profile)/bin/pueue add -- OUT_PATHS=\"$OUT_PATHS\" /var/run/uploadToCache"
su -l runner -c "env PATH=\"\$PATH:\$HOME/bin\" \$(readlink \$HOME/.nix-profile)/bin/pueue add -- OUT_PATHS=\\\"$OUT_PATHS\\\" /var/run/uploadToCache"

0 comments on commit 7875a6f

Please sign in to comment.