Skip to content

Conversation

ChanTsune
Copy link
Contributor

@ChanTsune ChanTsune commented Aug 31, 2024

What does this PR do

Fix failed to build for target wasm32-unknown-emscripten with this error:

error[E0432]: unresolved import `self::consts`
  --> src/errno.rs:19:15
   |
19 | pub use self::consts::*;
   |               ^^^^^^ could not find `consts` in `self`

error[E0432]: unresolved import `self::Errno`
   --> src/errno.rs:198:15
    |
198 |     use self::Errno::*;
    |               ^^^^^ could not find `Errno` in `self`

error[E0432]: unresolved import `crate::errno::Errno`
 --> src/fcntl.rs:2:5
  |
2 | use crate::errno::Errno;
  |     ^^^^^^^^^^^^^^-----
  |     |             |
  |     |             help: a similar name exists in the module: `errno`
  |     no `Errno` in `errno`

error[E0432]: unresolved import `crate::errno::Errno`
 --> src/sys/signal.rs:3:5
  |
3 | use crate::errno::Errno;
  |     ^^^^^^^^^^^^^^-----
  |     |             |
  |     |             help: a similar name exists in the module: `errno`
  |     no `Errno` in `errno`

error[E0432]: unresolved import `crate::errno::Errno`
 --> src/unistd.rs:3:5
  |
3 | use crate::errno::Errno;
  |     ^^^^^^^^^^^^^^-----
  |     |             |
  |     |             help: a similar name exists in the module: `errno`
  |     no `Errno` in `errno`

error[E0432]: unresolved import `errno::Errno`
   --> src/lib.rs:205:5
    |
205 | use errno::Errno;
    |     ^^^^^^^-----
    |     |      |
    |     |      help: a similar name exists in the module: `errno`
    |     no `Errno` in `errno`

For more information about this error, try `rustc --explain E0432`.
error: could not compile `nix` (lib) due to 6 previous errors

To pass the build, I made the following changes:

  • Added the errno::errno_location function for Emscripten.
  • Uses the same errno::consts module as Linux.

Checklist:

  • I have read CONTRIBUTING.md
  • I have written necessary tests and rustdoc comments
  • A change log has been added if this PR modifies nix's API

@SteveLauC
Copy link
Member

CI fixed in #2478, please rebase your branch:)

@ChanTsune ChanTsune force-pushed the fix-failed-to-build-target-emscripten branch from 248e76c to c0a1c96 Compare September 1, 2024 10:42
Copy link
Member

@SteveLauC SteveLauC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing it for Nix, just one tiny issue:)

@SteveLauC
Copy link
Member

BTW, perhaps we can have a changelog for this, please see CONTRIBUTING.md on how to add one, something like this would suffice:

2477.added.md

Add the support for Emscripten.

@ChanTsune ChanTsune force-pushed the fix-failed-to-build-target-emscripten branch from c0a1c96 to 6723feb Compare September 4, 2024 04:23
Copy link
Member

@SteveLauC SteveLauC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@SteveLauC SteveLauC added this pull request to the merge queue Sep 4, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 4, 2024
@SteveLauC
Copy link
Member

Ahh, our Cirrus CI has been quite unstable recently...

@SteveLauC SteveLauC added this pull request to the merge queue Sep 4, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 4, 2024
@SteveLauC
Copy link
Member

Damn it, I think our Cirrus CI is broken, which is definitely not related to this PR, I will take a look later:<

@SteveLauC
Copy link
Member

Weird, Cirrus CI works fine in other PRs, let's merge this PR anyway!

@SteveLauC SteveLauC merged commit e599223 into nix-rust:master Sep 4, 2024
36 checks passed
@ChanTsune ChanTsune deleted the fix-failed-to-build-target-emscripten branch September 4, 2024 12:24
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