oya
oya copied to clipboard
"text file is busy" when running a task and updating a pack at the same time
I get a "text file is busy" error when running a task calling a script from a pack that's getting updated within the same task invocation. As far as I can tell this only happens when installing a newer version of already-installed pack. It also may be a Linux-specific issue.
$ oya run test
INFO[0002] Installing pack github.com/foo-inc/oya-packs/foo-py-project version v1.4.0 into "/tmp/oya585242744/github.com/foo-inc/oya-packs/[email protected]" (git tag: foo-py-project/v1.4.0)
INFO[0003] Installing pack github.com/foo-inc/oya-packs/foo-py-project version v1.4.0 into "/home/pierec/.oya/packs/github.com/foo-inc/oya-packs/[email protected]" (git tag: foo-py-project/v1.4.0)
------------------------------------------------------------------------------
Error: fork/exec /home/pierec/.oya/packs/github.com/foo-inc/oya-packs/[email protected]/chkdeps: text file busy
at line 6, column 1
5| # If venv is already setup, skip this task
> 6| "${Oya[BasePath]}/chkdeps" \
^
------------------------------------------------------------------------------
Error: task "venv" failed
in github.com/foo-inc/oya-packs/foo-py-project imported as "_py"
------------------------------------------------------------------------------
Error: task "_py.venv" failed
in file "/home/pierec/coding/tpx/foo/py-lib-logging/Oyafile"
------------------------------------------------------------------------------
Error: exit status 255
at line 4, column 1
3| # Make sure "pip-tools" is installed
> 4| oya run venv
^
------------------------------------------------------------------------------
Error: task "freeze" failed
in github.com/foo-inc/oya-packs/foo-py-project imported as "_py"
------------------------------------------------------------------------------
Error: task "_py.freeze" failed
in file "/home/pierec/coding/tpx/foo/py-lib-logging/Oyafile"
------------------------------------------------------------------------------
Error: exit status 255
at line 3, column 1
2|
> 3| oya run freeze
^
------------------------------------------------------------------------------
Error: task "test" failed
in github.com/foo-inc/oya-packs/foo-py-project imported as "_py"
------------------------------------------------------------------------------
Error: task "_py.test" failed
in file "/home/pierec/coding/tpx/foo/py-lib-logging/Oyafile"
------------------------------------------------------------------------------
Error: exit status 255
at line 2, column 1
1| set -e
> 2| oya run _py.test $@
^
------------------------------------------------------------------------------
Error: task "test" failed
in file "/home/pierec/coding/tpx/foo/py-lib-logging/Oyafile"
Let me break that down into a minimal example. Consider a pack the following structure:
$ ls -l
drwxr-xr-x 3 pierec pierec 200 Oct 27 21:05 .
drwxr-xr-x 5 pierec pierec 120 Oct 27 10:57 ..
-rwxr-xr-x 1 pierec pierec 712 Oct 26 23:44 a-shell-script
-rw-r--r-- 1 pierec pierec 4551 Oct 29 19:53 Oyafile
$ cat Oyafile
Project: github.com/foo/some-pack
a-task: |
set -e
"${Oya[BasePath]}/a-shell-script"
Consider a project using the above pack:
$ cat Oyafile
Project: github.com/foo/some-project
Require:
github.com/foo/some-pack: v1.0.0
a-task:
some-pack.a-task
Steps to reproduce:
- git clone
some-projectto some directory. - Run
oya run a-task- no errors. - Update
Oyafileto refer to a newer version ofsome-pack. - Run
oya run a-task- "text file is busy" error occurs. - Run
oya run a-taskagain - no errors.