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

Compilation failure on OSX with M1 CPU #35

Closed
nmathewson opened this issue Apr 1, 2022 · 2 comments
Closed

Compilation failure on OSX with M1 CPU #35

nmathewson opened this issue Apr 1, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@nmathewson
Copy link
Contributor

Hello! Since upgrading to 0.8, I've had a compilation failure when building on my m1 laptop:

   Compiling rlimit v0.8.0 (/Users/nickm/src/crates/rlimit)
error[E0425]: cannot find value `RLIM_INFINITY` in module `C`
 --> src/unix.rs:7:30
  |
7 | pub const INFINITY: u64 = C::RLIM_INFINITY as u64;
  |                              ^^^^^^^^^^^^^ not found in `C`
error[E0422]: cannot find struct, variant or union type `rlimit` in module `C`
  --> src/unix.rs:23:19
   |
23 |     let rlim = C::rlimit {
   |                   ^^^^^^ not found in `C`
   |
help: consider importing this struct
   |
1  | use libc::rlimit;

... [many similar issues follow] ...

Some errors have detailed explanations: E0422, E0425.
For more information about an error, try `rustc --explain E0422`.
error: could not compile `rlimit` due to 29 previous errors

This problem seems to occur because there is no entry for target_arch="aarch64", target_os="macos" in bindings.rs.

I tried to rectify this by running "scripts/codegen.sh", but got a compilation failure from the C++ code:

./scripts/codegen.cpp:223:52: error: unknown type name 'rlim64_t'; did you mean 'rlim_t'?
    cout << "pub type rlim_t = " << rust_type_name<rlim64_t>() << ";" << endl;
                                                   ^~~~~~~~
                                                   rlim_t

As near as I can tell, my SDK does not have a separate rlim64_t or getrlimit64, so I tried running again with CODEGEN64 disabled.

I'll try writing a PR with the results.

nmathewson added a commit to nmathewson/rlimit that referenced this issue Apr 1, 2022
I got these by running the provided scripts/codegen.sh, with
CODEGEN64 removed.  They seem to match up with the contents of the
resource.h from the SDK.   With these defintions, rlimit now builds
and passes its tests on my M1 laptop.

Closes issue Nugine#35.
Nugine pushed a commit that referenced this issue Apr 1, 2022
I got these by running the provided scripts/codegen.sh, with
CODEGEN64 removed.  They seem to match up with the contents of the
resource.h from the SDK.   With these defintions, rlimit now builds
and passes its tests on my M1 laptop.

Closes issue #35.
@Nugine Nugine mentioned this issue Apr 2, 2022
@Nugine Nugine added the bug Something isn't working label Apr 2, 2022
@Nugine
Copy link
Owner

Nugine commented Apr 2, 2022

Resolved by #36.
The fix has been published by v0.8.1.

@Nugine Nugine closed this as completed Apr 2, 2022
@nmathewson
Copy link
Contributor Author

Thanks for the fast response!

@Nugine Nugine mentioned this issue Jul 19, 2023
2 tasks
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

No branches or pull requests

2 participants