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

fix: fix unit tests #54

Merged
merged 5 commits into from
Apr 1, 2024
Merged

fix: fix unit tests #54

merged 5 commits into from
Apr 1, 2024

Conversation

toumorokoshi
Copy link
Owner

tome unit tests is not working for aarch64.

@toumorokoshi
Copy link
Owner Author

@zph I think #52 is a python issue with the aarch64-based platforms - bash works fine.

I'm running into an issue with cross and macOS-aarch64 though - do you have any suggestions?

   Compiling syn v1.0.85
   Compiling unicode-xid v0.2.2
   Compiling cfg-if v1.0.0
   Compiling rustc_version v0.4.0
   Compiling rstest v0.12.0
   Compiling tome v0.11.1 (/Users/runner/work/tome/tome)
    Finished release [optimized] target(s) in 11.43s
     Running unittests src/lib.rs (target/aarch64-apple-darwin/release/deps/tome-202239b87011928f)
error: test failed, to rerun pass `--lib`

Caused by:
  could not execute process `/Users/runner/work/tome/tome/target/aarch64-apple-darwin/release/deps/tome-202239b87011928f` (never executed)

Caused by:
  Bad CPU type in executable (os error 86)
Error: Process completed with exit code 101.

I took the github workflow file from one of your branches.

@zph
Copy link
Contributor

zph commented Apr 1, 2024

🤔 I'll check it out. Good find on the python v bash issue.

I'm able to do the compilation on a local apple silicon, so it's a matter of figuring it out why it's not working in the cross compiling and on ci.

image

(run on this branch from PR)

I'm glad you took the GH Actions CI configuration I setup... it was fussy to get working.

@toumorokoshi
Copy link
Owner Author

I'm able to do the compilation on a local apple silicon, so it's a matter of figuring it out why it's not working in the cross compiling and on ci.

This is encouraging! I can keep digging on my side too.

I'm glad you took the GH Actions CI configuration I setup... it was fussy to get working.

thanks for writing it! If you're able to send a PR as part of fixing #9, I'd love to see it in the repo!

@zph
Copy link
Contributor

zph commented Apr 1, 2024

Ah, I had the build tests skipped on aarch64 linux/darwin because of this issue and not spending the time to discover a fix when tests were doing fine on x86_64 and I'd spent a chunk of time just getting cross compilation working.

image

The logs don't show enough info so it would help if we can find a debug flag for the github action to show what tests are failing in the build and release process.

cross GH action documents lack of support for unit tests
on darwin aarch64.
@toumorokoshi
Copy link
Owner Author

Ah, I had the build tests skipped on aarch64 linux/darwin because of this issue and not spending the time to discover a fix when tests were doing fine on x86_64 and I'd spent a chunk of time just getting cross compilation working.

image The logs don't show enough info so it would help if we can find a debug flag for the github action to show what tests are failing in the build and release process.

actually it looks like the action doesn't support tests in darwin aarch64 at all: https://github.com/houseabsolute/actions-rust-cross?tab=readme-ov-file#input-parameters.

So I'll just skip it for now and merge this fix in?

@zph
Copy link
Contributor

zph commented Apr 1, 2024

I found a good lead on this issue:

  1. I enabled tests for aarch with verbose mode
  2. And after a bit of googling, looked more closely at the error message... and see that it's showing
image

What's interesting there is that this test should be running on an apple silicon worker, but the cargo in use is x64_86 while the executable for tome is aarch64.

These snippets:

could not execute process `CARGO=/Users/runner/.rustup/toolchains/beta-x86_64-apple-darwin/bin/cargo
....
/Users/runner/work/tome/tome/target/aarch64-apple-darwin/release/deps/tome-7e8c41eefa8a9c38` (never executed)

Note the conflicted architectures of cargo v. tome.

I'm not sure how to fix it yet but that looks like our problem.

@zph
Copy link
Contributor

zph commented Apr 1, 2024

Ah, I had the build tests skipped on aarch64 linux/darwin because of this issue and not spending the time to discover a fix when tests were doing fine on x86_64 and I'd spent a chunk of time just getting cross compilation working.
image
The logs don't show enough info so it would help if we can find a debug flag for the github action to show what tests are failing in the build and release process.

actually it looks like the action doesn't support tests in darwin aarch64 at all: https://github.com/houseabsolute/actions-rust-cross?tab=readme-ov-file#input-parameters.

So I'll just skip it for now and merge this fix in?

Sounds good 👍

@toumorokoshi
Copy link
Owner Author

I found a good lead on this issue:

  1. I enabled tests for aarch with verbose mode
  2. And after a bit of googling, looked more closely at the error message... and see that it's showing
image What's interesting there is that this test should be running on an apple silicon worker, but the cargo in use is x64_86 while the executable for tome is aarch64.

These snippets:

could not execute process `CARGO=/Users/runner/.rustup/toolchains/beta-x86_64-apple-darwin/bin/cargo
....
/Users/runner/work/tome/tome/target/aarch64-apple-darwin/release/deps/tome-7e8c41eefa8a9c38` (never executed)

Note the conflicted architectures of cargo v. tome.

I'm not sure how to fix it yet but that looks like our problem.

really interesting! the action looks like it just delegate to another action, which in turn just install toolchains with the string directly. So I wonder if this is upstream all the way to rust toolchains?

I'm logging off for now, but I'll at least merge this incremental improvement in.

@toumorokoshi toumorokoshi merged commit 944b3e2 into master Apr 1, 2024
8 checks passed
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