From 7f983966b33b208829632d20c77a3937fccf6d4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20Ol=C3=A1h?= Date: Mon, 28 Jun 2021 20:01:27 +0200 Subject: [PATCH] Support linking with `-o filename` (#849) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When linking with `-o filename` (such as in various CMake build checks), the parameter passed to the linker is a temporary file, and it is passed as a bare filename (i.e. relative path without a `'/'`). In such cases, `outdir` would have been the empty string, and the final `tar` command would fail (actually the call to `subprocess.check_call(…)` is what fails). --- bazel/emscripten_toolchain/link_wrapper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bazel/emscripten_toolchain/link_wrapper.py b/bazel/emscripten_toolchain/link_wrapper.py index a0287bf..2f156d8 100644 --- a/bazel/emscripten_toolchain/link_wrapper.py +++ b/bazel/emscripten_toolchain/link_wrapper.py @@ -51,7 +51,7 @@ parser.add_argument('--oformat') options = parser.parse_known_args(param_file_args)[0] output_file = options.o oformat = options.oformat -outdir = os.path.dirname(output_file) +outdir = os.path.normpath(os.path.dirname(output_file)) base_name = os.path.basename(output_file) # The output file name is the name of the build rule that was built.