mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-11 12:59:17 +03:00
Fix find: ./local-spawn-runner not found issue (#5793)
CWD will be set to the same execroot for all targets on Windows. While this will contain the things we are searching for it contains a whole bunch of other stuff and in particular it can also change during the execution of `find`. This resulted in errors with temporary files such as the local-spawn-runner-* stuff that appear and disappear while find is running. This PR switches it to a tmp dir which works around this issue and makes more sense anyway since we clearly don’t want to search in the whole execroot. changelog_begin changelog_end
This commit is contained in:
parent
32fbf040aa
commit
8c25bc4de5
@ -159,10 +159,16 @@ def _extract_main_dalf_impl(ctx):
|
||||
outputs = [output_dalf],
|
||||
progress_message = "Extract DALF from DAR (%s)" % project_name,
|
||||
command = """
|
||||
set -eou pipefail
|
||||
{zipper} x {input_dar}
|
||||
main_dalf=$({find} . -name '{project_name}-{project_version}-[a-z0-9]*.dalf')
|
||||
cp $main_dalf {output_dalf}
|
||||
set -eoux pipefail
|
||||
TMPDIR=$(mktemp -d)
|
||||
trap "rm -rf $TMPDIR" EXIT
|
||||
# While zipper has a -d option, it insists on it
|
||||
# being a relative path so we don't use it.
|
||||
ZIPPER=$PWD/{zipper}
|
||||
DAR=$PWD/{input_dar}
|
||||
(cd $TMPDIR && $ZIPPER x $DAR)
|
||||
main_dalf=$({find} $TMPDIR/ -name '{project_name}-{project_version}-[a-z0-9]*.dalf')
|
||||
cp $main_dalf {output_dalf}
|
||||
""".format(
|
||||
zipper = zipper.path,
|
||||
find = posix.commands["find"],
|
||||
|
Loading…
Reference in New Issue
Block a user