wasm-pack icon indicating copy to clipboard operation
wasm-pack copied to clipboard

`cargo install wasm-pack --version 0.12.1` fails on MacOS

Open ibeckermayer opened this issue 1 year ago • 4 comments

🐛 Bug description

cargo install wasm-pack --version 0.12.1 is failing on MacOS with the following error log:

error[E0445]: crate-private trait `types::Private` in public interface
  --> /Users/ibeckermayer/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hoot-0.1.2/src/types.rs:10:1
   |
7  | pub(crate) trait Private {
   | ------------------------ `types::Private` declared as crate-private
...
10 | pub trait State: Private {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^ can't leak crate-private trait

error[E0445]: crate-private trait `types::Private` in public interface
  --> /Users/ibeckermayer/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hoot-0.1.2/src/types.rs:12:1
   |
7  | pub(crate) trait Private {
   | ------------------------ `types::Private` declared as crate-private
...
12 | pub trait Version: Private {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak crate-private trait

error[E0445]: crate-private trait `types::Private` in public interface
  --> /Users/ibeckermayer/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hoot-0.1.2/src/types.rs:19:1
   |
7  | pub(crate) trait Private {
   | ------------------------ `types::Private` declared as crate-private
...
19 | pub trait Method: Private {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak crate-private trait

error[E0445]: crate-private trait `types::Private` in public interface
  --> /Users/ibeckermayer/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hoot-0.1.2/src/types.rs:42:1
   |
7  | pub(crate) trait Private {
   | ------------------------ `types::Private` declared as crate-private
...
42 | pub trait BodyType: Private {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak crate-private trait

error[E0446]: crate-private type `Writer<'_, '_>` in public interface
  --> /Users/ibeckermayer/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hoot-0.1.2/src/header.rs:60:1
   |
60 | / pub fn check_and_output_header(
61 | |     mut w: Writer,
62 | |     version: HttpVersion,
63 | |     name: &str,
64 | |     bytes: &[u8],
65 | |     trailer: bool,
66 | | ) -> Result<()> {
   | |_______________^ can't leak crate-private type
   |
  ::: /Users/ibeckermayer/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hoot-0.1.2/src/out.rs:42:1
   |
42 |   pub(crate) struct Writer<'b, 'a> {
   |   -------------------------------- `Writer<'_, '_>` declared as crate-private

error[E0446]: private type `CallState` in public interface
   --> /Users/ibeckermayer/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hoot-0.1.2/src/body.rs:10:1
    |
10  | / pub fn do_read_body<'a, 'b>(
11  | |     state: &mut CallState,
12  | |     src: &'a [u8],
13  | |     dst: &'b mut [u8],
14  | | ) -> Result<BodyPart<'b>> {
    | |_________________________^ can't leak private type
    |
   ::: /Users/ibeckermayer/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hoot-0.1.2/src/lib.rs:106:1
    |
106 |   pub(crate) struct CallState {
    |   --------------------------- `CallState` declared as private

   Compiling semver v1.0.21
Some errors have detailed explanations: E0445, E0446.
For more information about an error, try `rustc --explain E0445`.
error: could not compile `hoot` (lib) due to 6 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `wasm-pack v0.12.1`, intermediate artifacts can be found at `/var/folders/2g/285gxqwx5lxbx55v62jx93m00000gn/T/cargo-installOyZHaX`

This was apparently working for us previously (both locally, and in CI) but has stopped.

🤔 Expected Behavior

It should build successfully

👟 Steps to reproduce

Set up the environment and run cargo install wasm-pack --version 0.12.1

🌍 Your environment

Include the relevant details of your environment. wasm-pack version: wasm-pack 0.12.1 rustc version: rustc 1.71.1 (eb26296b5 2023-08-03) macOS: macOS Sonoma 14.3 (23D56) on M1 chip (locally)

ibeckermayer avatar Jan 30 '24 21:01 ibeckermayer

Also seeing this in our GitHub Actions CI - so not sure this is MacOS specific.

strideynet avatar Jan 30 '24 21:01 strideynet

Looks like an upstream issue with the hoot crate - https://github.com/algesten/hoot/issues/1

strideynet avatar Jan 30 '24 22:01 strideynet

Confirmed that cargo install --locked --version XXX wasm-pack worked for me, thanks @camscale

nam178 avatar Jan 30 '24 23:01 nam178

@ibeckermayer Are you building locally with docker/finch?

If so your local build works probably because of the cache, try again with --no-cache docker/finch argument

nam178 avatar Jan 30 '24 23:01 nam178