Commit 1f718c4
committed
Fix NotADirectoryError in tools/pkg/build.py salt_onedir
Commit 9c268db added a `git add -f salt/_version.txt` invocation
inside `salt_onedir` with `cwd=str(salt_archive)`, but `salt_archive`
is a path to a `.tar.gz` file, not a directory. Python's subprocess
implementation calls `chdir()` on `cwd` and raises:
NotADirectoryError: [Errno 20] Not a directory:
'/.../salt-3008.0+NNN.gSHA.tar.gz'
This blocks the Build Salt Onedir job on Linux and macOS for every
master PR. The Windows path takes a different branch
(`pkg\\windows\\install_salt.cmd`) and is unaffected.
The `salt_onedir` step runs in the salt source checkout (the CI
working tree), which is a real git repository containing
`salt/_version.txt`, so dropping the `cwd=` argument lets the
subprocess inherit that directory and the `git add` works as the
original commit intended.
Reproducer:
import subprocess
subprocess.run(['echo', 'x'], cwd='/tmp/anything.tar.gz')
# NotADirectoryError: [Errno 20] Not a directory: '/tmp/anything.tar.gz'
Fixes #69461
Refs 9c268db1 parent 0bacd93 commit 1f718c4
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments