nix-rust / nix

Rust friendly bindings to *nix APIs
MIT License
2.57k stars 650 forks source link

ci: fix CI by correcting wrong cfg value & removing cache with sudo #2394

Closed SteveLauC closed 2 months ago

SteveLauC commented 2 months ago

What does this PR do

This PR tries to fix the CI, there are 2 issues here:

  1. New nightly toolchain added checks for cfg values, and they work pretty well

    1. there are few typos in our cfg values (which is really unfortunate) fushsia -> fuchsia
    2. target_arch = x32 does not exist
  2. For CI that are using our MSRV toolchain, the last step before_cache_script would fail with Permission denied because the files that it wants to delete are owned by root: https://github.com/nix-rust/nix/actions/runs/8958096003/job/24601956503?pr=2394

    This is kinda weird because it didn't happen in the past, and for now, it only happens with our MSRV toolchain.

uid=1001(runner) gid=127(docker) groups=127(docker),4(adm),101(systemd-journal)
/home/runner/.cargo/registry/index
├── [root     root    ]  github.com-1ecc6299db9ec823
│   ├── [root     root    ]  .cache
│   │   ├── [root     root    ]  3
│   │   │   └── [root     root    ]  s
│   │   │       └── [root     root    ]  syn
│   │   ├── [root     root    ]  as
│   │   │   └── [root     root    ]  se
│   │   │       └── [root     root    ]  assert-impl
│   │   ├── [root     root    ]  au
│   │   │   └── [root     root    ]  to
│   │   │       └── [root     root    ]  autocfg

Checklist:

SteveLauC commented 2 months ago

Well, I reproduced issue 2 on my host, both with our MSRV toolchain and the latest stable toolchain 1.78:

$ l ~/.cargo/registry/index
Permissions Links Size User Group Date Modified Name
drwxr-xr-x@     1    - root root   5 May 20:35  index.crates.io-6f17d22bba15001f
SteveLauC commented 2 months ago

This is kinda weird because it didn't happen in the past, and for now, it only happens with our MSRV toolchain.

Still have no idea why this didn't happen in the past, I fixed it by adding sudo to the last step for jobs that run test with sudo.