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

check for mips targets for stat.st_dev definitions #103

Closed
wants to merge 1 commit into from

Conversation

kraj
Copy link

@kraj kraj commented Jan 26, 2022

src/logging.rs Outdated Show resolved Hide resolved
@lucab
Copy link
Owner

lucab commented Jan 26, 2022

Thanks for the PR. Can you maybe add some details about where this showed up?

@swsnr
Copy link
Collaborator

swsnr commented Jan 26, 2022

I'd also appreciate a summary of the linked bug report; it's rather long, and I'm not sure what information or fact I should read from it.

st_dev has wrong type in glibc when using mips/O32 ABI
its type should be dev_t but it is set to unsigned long int
this is specific issue on mips/o32 ABI in glibc for details

See
https://sourceware.org/bugzilla/show_bug.cgi?id=17786

currently the build fails on mips archirecture with type mismatches

      Fixes
      error[E0308]: mismatched types
*        --> /usr/src/debug/python3-pyruvate/1.1.2-r0/cargo_home/bitbake/libsystemd-0.4.1/src/logging.rs:296:25
          |
      296 |                 device: stat.st_dev,
          |                         ^^^^^^^^^^^ expected `u64`, found `u32`

Signed-off-by: Khem Raj <raj.khem@gmail.com>
@swsnr
Copy link
Collaborator

swsnr commented Jan 29, 2022

What Rust tier does the corresponding target belong to?

I'm asking because I'm not keen on maintaining architecture specific code here. If it's anything but a tier 1 target my vote would be to account for this mismatch for elsewhere, e.g. upstream libc or nix😬

I'm fine with using a different API at this place, as long as we don't have do deal with cfg here. Perhaps we can use std::fs::Metadata here somehow.

@swsnr
Copy link
Collaborator

swsnr commented Jan 29, 2022

I've opened #104 to use std::fs in this place instead of libc.

@kraj Please do test #104.

@swsnr
Copy link
Collaborator

swsnr commented Feb 24, 2022

@kraj Did you have a chance to test #104?

@kraj
Copy link
Author

kraj commented Feb 24, 2022

@kraj Did you have a chance to test #104?

in limited build only test it seems to be ok.

@lucab
Copy link
Owner

lucab commented Feb 28, 2022

@kraj thanks for the additional feedback. I'd also prefer taking the rework in #104 to address this.

@swsnr
Copy link
Collaborator

swsnr commented Feb 28, 2022

I'm closing this in favour of #104 which I just merged 🙂

@swsnr swsnr closed this Feb 28, 2022
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.

None yet

3 participants