You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The environmental variable $HOME not to be dependent on the cache directory location resolving, since non-cache settings are being resolved correctly.
Actual behavior
Package manager is not able to determine the cache directory to use and reverts to try to use /.cache, for which it it won't be able to have permissions to do so. For example strace shows the following system calls where the configuration directory is being resolved correctly:
Simplest way to reproduce would be to allow the /nonexistent home directory to be present and writable for user nobody via a docker container; (or in a working non-root user Linux environment just unset HOME) :
docker run -ti --user nobody -v /var/tmp:/nonexistent swift:5.6-focal /bin/bash
# In the container
git -C /tmp clone https://github.com/apple/swift-nio-examples.git
cd /tmp/swift-nio-examples/json-rpc/
unset HOME
swift package test
warning: Failed creating default cache location, Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission."
[...]
The same is happening in 5.7 nightly if executed under swiftlang/swift:nightly-focal instead of swift:5.6-focal, but here the warning is better:
warning: /.cache/org.swift.swiftpm is not accessible or not writable, disabling user-level cache features.
$ swift --version
Swift version 5.7-dev (LLVM cd62c186b914a47, Swift c58d4dba34ef37a)
Target: x86_64-unknown-linux-gnu
The background for this is that Github Runner setup scripts can unset all environment flags, and then the cache can run into this (actions/runner#1864)
Swift Package Manager version/commit hash
$ swift --version
Swift version 5.6.1 (swift-5.6.1-RELEASE)
Target: x86_64-unknown-linux-gnu
[the Swift Package Manager tag/commit hash]
Swift & OS version
$ swift --version && uname -a
Swift version 5.7-dev (LLVM cd62c186b914a47, Swift c58d4dba34ef37a)
Target: x86_64-unknown-linux-gnu
Linux 80f85cd927fb 5.4.0-109-generic #123-Ubuntu SMP Fri Apr 8 09:10:54 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered:
Expected behavior
The environmental variable $HOME not to be dependent on the cache directory location resolving, since non-cache settings are being resolved correctly.
Actual behavior
Package manager is not able to determine the cache directory to use and reverts to try to use
/.cache
, for which it it won't be able to have permissions to do so. For example strace shows the following system calls where the configuration directory is being resolved correctly:Steps to reproduce
Simplest way to reproduce would be to allow the /nonexistent home directory to be present and writable for user nobody via a docker container; (or in a working non-root user Linux environment just
unset HOME
) :The same is happening in 5.7 nightly if executed under
swiftlang/swift:nightly-focal
instead ofswift:5.6-focal
, but here the warning is better:The background for this is that Github Runner setup scripts can unset all environment flags, and then the cache can run into this (actions/runner#1864)
Swift Package Manager version/commit hash
$ swift --version
Swift version 5.6.1 (swift-5.6.1-RELEASE)
Target: x86_64-unknown-linux-gnu
[the Swift Package Manager tag/commit hash]
Swift & OS version
The text was updated successfully, but these errors were encountered: