-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ci: workaround for the cache bug on Linux #11568
Conversation
92edff4
to
769399e
Compare
@@ -23,6 +23,10 @@ jobs: | |||
uses: actions/checkout@v2 | |||
with: | |||
fetch-depth: 50 | |||
# https://github.com/actions/cache/issues/133 | |||
- name: Fixup the owner of ~/.cargo/ | |||
if: matrix.platform == 'ubuntu-16.04' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will probably also want to do this on macOS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't seem to be a problem for macOS.
Github uses a third-party service for macOS runners: https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners#cloud-hosts-for-github-hosted-runners as opposed to Standard_DS2_v2 VMs on Asure for Linux and Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example job on macOS: https://github.com/openethereum/openethereum/runs/506808782.
|
Wasn't that the case already, it means that this fix doesn't actually work, sadly. |
|
@bjorn3 wow thank you for looking into this ❤️ |
.github/workflows/build-test.yml
Outdated
shell: bash | ||
run: git submodule update --init --recursive | ||
run: bash sudo chown -R $(whoami):$(id -ng) ~/.cargo/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will try to run sudo
as shell script I believe. Also windows doesn't have chown
, whoami
and id
. The permission system on Windows works quite different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expected running bash
on Windows would use the Windows Subsystem for Linux 2
, but maybe I'm wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bash
on windows is just a recompilation of bash
for windows I believe. You have to use wsl
to run commands on Windows Subsystem for Linux
. I assume it is not enabled on gh actions though.
Cargo.lock
Outdated
@@ -3556,9 +3556,9 @@ dependencies = [ | |||
|
|||
[[package]] | |||
name = "parity-util-mem" | |||
version = "0.5.2" | |||
version = "0.5.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the downgrade?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a downgrade compared to master, just reverted unrelated to this PR change (see REVERTME commit).
.github/workflows/build-test.yml
Outdated
$acl = Get-Acl "C:\Users\runneradmin\.cargo\" | ||
$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("everyone","FullControl","Allow") | ||
$acl.SetAccessRule($accessRule) | ||
$acl | Set-Acl "C:\Users\runneradmin\.cargo\" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#11572 was filed for Windows, but it's fine to do here as well
.github/workflows/build-test.yml
Outdated
if: matrix.platform == 'windows-latest' | ||
shell: powershell | ||
run: | | ||
$registry-path = "C:\Users\runneradmin\.cargo\registry" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected token '-path' in expression or statement.
$registry-path = "C:\Users\runneradmin\.cargo\registry" | |
$registry_path = "C:\Users\runneradmin\.cargo\registry" |
I assume _
is allowed.
|
.github/workflows/build-test.yml
Outdated
if: matrix.platform == 'windows-latest' | ||
shell: powershell | ||
run: | | ||
$registryPath = "C:\Rust\.cargo\registry" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use
$registryPath = "C:\Rust\.cargo\registry" | |
$registryPath = "$CARGO_HOME\registry" |
to be more resillient against changes to the path? (Not sure if it is correct powershell syntax)
I'm not even sure this is a permission issue on Windows, and the current attempt doesn't seem to fix the problem: https://github.com/openethereum/openethereum/runs/511742121#step:6:7. So let's try to tackle it in a separate PR? |
actions/cache#133 (comment)