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

tests regarding cargo fetching destination are broken on i686 #372

Closed
jcgruenhage opened this issue Nov 8, 2021 · 7 comments · Fixed by #374
Closed

tests regarding cargo fetching destination are broken on i686 #372

jcgruenhage opened this issue Nov 8, 2021 · 7 comments · Fixed by #374
Labels
bug Something isn't working

Comments

@jcgruenhage
Copy link

Describe the bug
There's two test cases that currently fail on i686 machines:

advisories::helpers::test::converts_url_to_path
index::bare::test::matches_cargo

To Reproduce
Steps to reproduce the behavior:

  1. Get a 32 bit x86 machine
  2. Try to run the tests.

Expected behavior
Tests are working.

Screenshots
https://github.com/void-linux/void-packages/runs/4137744216?check_suite_focus=true#step:7:352, and in case that log disappears:
image

@jcgruenhage jcgruenhage added the bug Something isn't working label Nov 8, 2021
@Jake-Shadle
Copy link
Member

cargo calculates a hash based off various bits of info that is used as part of the root directory for all crate downloads, indexes, and sources, so I guess this is hashing differently on a 32-bit machine vs 64-bit. The code in question is located here https://github.com/EmbarkStudios/cargo-deny/blob/main/src/index.rs#L236 if you want to compare how cargo is doing this compared to this function, which is mostly just a slimmed down version of what cargo does with only the pieces that we care about.

If you can't/don't have time to do this yourself I will try and look at it eventually, but to be honest x86 support is really low on priority.

@jcgruenhage
Copy link
Author

I'll see whether I have time to work on this myself, but I currently don't think so, for the same reason, 32 bit x86 support is really low on my priority list as well. I just reported it because it popped up in the CI over at void-linux/void-packages#33951.

If those tests are failing, is it safe to assume that cargo-deny will not work because it won't find the files it's looking for?

@Jake-Shadle
Copy link
Member

Yes, but only advisories, all the other checks should work I believe, thanks for linking the issue with the CI failure, I didn't know this existed.

@jcgruenhage
Copy link
Author

I'd still go ahead and mark the package as broken on i686 then in Void

@ericonr
Copy link

ericonr commented Nov 10, 2021

This probably happens on all 32-bit platforms, not only i686.

@ericonr
Copy link

ericonr commented Nov 10, 2021

At a guess, 2usize.hash(&mut hasher); is the issue. usize is platform dependent; if anyone could try patching that to be 2u64, it might be enough?

@Jake-Shadle
Copy link
Member

@ericonr good call, this was indeed the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants