Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensure /var/lock dir exists #168

Merged
merged 1 commit into from
Aug 20, 2024
Merged

Conversation

crazy-max
Copy link
Collaborator

relates to https://github.com/tonistiigi/xx/actions/runs/10355410498/job/28662989273#step:5:784

  > [test-apk test-apk 2/2] RUN --mount=type=cache,target=/pkg-cache,sharing=locked [ ! -f /etc/alpine-release ] || ./test-apk.bats:
0.515 not ok 5 skip-nolinux
0.517 # (from function `assert_success' in file bats-assert/src/assert.bash, line 114,
0.517 #  in test file test-apk.bats, line 54)
0.519 #   `assert_success' failed
0.520 #
0.520 # -- command failed --
0.520 # status : 1
0.520 # output : /usr/bin/xx-apk: line 7: can't create /var/lock/xx-apk: nonexistent directory
0.520 # --
0.520 #

Alpine edge has /var/lock as symlink to /run/lock but this dir doesn't exist:

$ docker run --rm -it alpine:edge sh -xc "ls -al /var/ && ls -al /run"
+ ls -al /var/
total 44
drwxr-xr-x   11 root     root          4096 Aug  7 16:24 .
drwxr-xr-x    1 root     root          4096 Aug 20 16:12 ..
drwxr-xr-x    4 root     root          4096 Aug  7 16:24 cache
dr-xr-xr-x    2 root     root          4096 Aug  7 16:24 empty
drwxr-xr-x    3 root     root          4096 Aug  7 16:24 lib
drwxr-xr-x    2 root     root          4096 Aug  7 16:24 local
lrwxrwxrwx    1 root     root             9 Aug  7 16:24 lock -> /run/lock
drwxr-xr-x    2 root     root          4096 Aug  7 16:24 log
drwxr-xr-x    2 root     root          4096 Aug  7 16:24 mail
drwxr-xr-x    2 root     root          4096 Aug  7 16:24 opt
lrwxrwxrwx    1 root     root             4 Aug  7 16:24 run -> /run
drwxr-xr-x    3 root     root          4096 Aug  7 16:24 spool
drwxrwxrwt    2 root     root          4096 Aug  7 16:24 tmp
+ ls -al /run
total 8
drwxr-xr-x    2 root     root          4096 Aug  7 16:24 .
drwxr-xr-x    1 root     root          4096 Aug 20 16:12 ..

And Alpine latest /var/lock is a dir:

docker run --rm -it alpine:latest sh -xc "ls -al /var/ && ls -al /run"
+ ls -al /var/
total 48
drwxr-xr-x   12 root     root          4096 Jun 18 14:16 .
drwxr-xr-x    1 root     root          4096 Aug 20 16:13 ..
drwxr-xr-x    4 root     root          4096 Jun 18 14:16 cache
dr-xr-xr-x    2 root     root          4096 Jun 18 14:16 empty
drwxr-xr-x    3 root     root          4096 Jun 18 14:16 lib
drwxr-xr-x    2 root     root          4096 Jun 18 14:16 local
drwxr-xr-x    3 root     root          4096 Jun 18 14:16 lock
drwxr-xr-x    2 root     root          4096 Jun 18 14:16 log
drwxr-xr-x    2 root     root          4096 Jun 18 14:16 mail
drwxr-xr-x    2 root     root          4096 Jun 18 14:16 opt
lrwxrwxrwx    1 root     root             4 Jun 18 14:16 run -> /run
drwxr-xr-x    3 root     root          4096 Jun 18 14:16 spool
drwxrwxrwt    2 root     root          4096 Jun 18 14:16 tmp
+ ls -al /run
total 8
drwxr-xr-x    2 root     root          4096 Jun 18 14:16 .
drwxr-xr-x    1 root     root          4096 Aug 20 16:13 ..

So makes sure lock folder exists.

@crazy-max crazy-max changed the title alpine: ensure lock folder exists ensure /var/lock dir exists Aug 20, 2024
@crazy-max crazy-max merged commit b4e4c45 into tonistiigi:master Aug 20, 2024
27 of 28 checks passed
@crazy-max crazy-max deleted the alpine-var-lock branch August 20, 2024 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants