Skip to content

Commit bebbaab

Browse files
committed
pyoxidizer: ensure output directory exists before writing executable
Reported in #447. I can't believe this bug existed!
1 parent 01cd220 commit bebbaab

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

pyoxidizer/docs/pyoxidizer_history.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ Bug Fixes
5151
the symbol. (#463)
5252
* Python ``.whl`` resources parsing now ignores directories. Previously,
5353
directories may have been emitted as 0-sized resources.
54+
* In some ``pyoxidizer.bzl`` configurations, an error would occur due to attempting
55+
to write a built executable to a directory that doesn't exist. This should no
56+
longer occur. (#447)
5457

5558
Backwards Compatibility Notes
5659
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

pyoxidizer/src/starlark/python_executable.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ pub fn build_internal(
9797
let output_path = context
9898
.get_output_path(type_values, target)
9999
.map_err(|_| anyhow!("unable to resolve output path"))?;
100+
std::fs::create_dir_all(&output_path)
101+
.with_context(|| format!("creating output directory {}", output_path.display()))?;
102+
100103
let dest_path = output_path.join(build.exe_name);
101104
warn!(
102105
context.logger(),

0 commit comments

Comments
 (0)