coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

Run all workspace tests in CI (MacOS)

Open drinkcat opened this issue 11 months ago • 2 comments

Similar to #7392, it would be nice to run all tests in CI, on MacOS (basically adding workspace-tests: true to both macos jobs in the matrix).

When I tried in #7386, I hit this issue:

error: couldn't read /Users/runner/work/coreutils/coreutils/target/aarch64-apple-darwin/debug/build/fts-sys-bdca82aeb17ec986/out/fts-sys.rs: No such file or directory (os error 2)
  --> /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/fts-sys-0.2.14/src/lib.rs:24:1
   |
24 | include!(concat!(env!("OUT_DIR"), "/fts-sys.rs"));
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this error originates in the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `fts-sys` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
Error: Process completed with exit code 101.

It's a bit unfortunate that fts-sys gets pulled. I think it's only required by chcon (selinux), which makes no sense on MacOS. But I'm not sure if there's a way around this.

I think the easiest will be to patch fts-sys to generate an empty crate on non-supported platforms: https://codeberg.org/koutheir/fts-sys/issues/3

There might be more issues after that one gets fixed.

drinkcat avatar Mar 04 '25 13:03 drinkcat

fts-sys issue should be fixed upstream: need to wait for #7420.

drinkcat avatar Mar 10 '25 09:03 drinkcat

it is blocked on https://github.com/uutils/coreutils/pull/7423 which is blocked on https://github.com/termux/termux-packages/issues/23469

sylvestre avatar Mar 10 '25 09:03 sylvestre

That part is unblocked, let's see if anything else fails: https://github.com/uutils/coreutils/pull/7576 .

drinkcat avatar Mar 25 '25 12:03 drinkcat

https://github.com/uutils/coreutils/actions/runs/14060026185/job/39371268061?pr=7576

cargo +1.85.0 test --target=x86_64-apple-darwin  --workspace  --features=feat_os_macos
...
   Compiling uu_runcon v0.0.30 (/Users/runner/work/coreutils/coreutils/src/uu/runcon)
warning: ignoring -C extra-filename flag due to -o flag

error[E0432]: unresolved imports `selinux::OpaqueSecurityContext`, `selinux::SecurityClass`, `selinux::SecurityContext`
  --> src/uu/runcon/src/runcon.rs:11:15
   |
11 | use selinux::{OpaqueSecurityContext, SecurityClass, SecurityContext};

The fails because --workspace tries to run tests in all packages, and src/uu/runcon is one of them (and the selinux crate is empty on non-Linux platforms).

Not sure how to make progress on this, I'll do a couple of experiments, but nothing I can come up with now seems really appealing.

drinkcat avatar Mar 25 '25 18:03 drinkcat