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

Fix compile error on wasm32-unknown-emscripten target #62

Merged
merged 1 commit into from
Feb 11, 2019

Conversation

iceiix
Copy link
Contributor

@iceiix iceiix commented Jan 12, 2019

rust-clipboard fails to build with the wasm32-unknown-emscripten target since it tries to build X clipboard support:

$ cargo build --target wasm32-unknown-emscripten
   Compiling xcb v0.8.2                                                                                                                                                      
error: failed to run custom build command for `xcb v0.8.2`                                                                                                                   
process didn't exit successfully: `rust-clipboard/target/debug/build/xcb-f6f24f9a96d825ba/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'Unable to find build dependency python3: Os { code: 2, kind: NotFound, message: "No such file or directory" }', libcore/result.rs:1009:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Since emscripten is recognized as "unix", but like macos and android it doesn't have an X11 clipboard, this pull request adds "emscripten" to the target_os exclusion for cfg unix:

#[cfg(all(unix, not(any(target_os="macos", target_os="android", target_os="emscripten"))))]

and the crate compiles with no errors

@iceiix
Copy link
Contributor Author

iceiix commented Jan 12, 2019

Note this doesn't add any real support for clipboards on the web, but that could be added later as another enhancement (https://www.w3.org/TR/clipboard-apis/); this PR is only about getting it to compile

iceiix added a commit to iceiix/stevenarella that referenced this pull request Jan 12, 2019
@aweinstock314 aweinstock314 merged commit 07d080b into aweinstock314:master Feb 11, 2019
iceiix added a commit to iceiix/stevenarella that referenced this pull request Mar 2, 2019
@iceiix
Copy link
Contributor Author

iceiix commented Mar 2, 2019

@aweinstock314 Thanks for the merge! Could you publish a new release on crates.io? (until then I can depend on the git revision)

iceiix added a commit to iceiix/stevenarella that referenced this pull request Mar 3, 2019
)

Note this only is the first step in web support, although the project compiles, it doesn't run!

Merging now to avoid branch divergence, until dependencies can be updated for wasm support.

* Add instructions to build for wasm32-unknown-unknown with wasm-pack in www/

* Update to rust-clipboard fork to compile with emscripten

aweinstock314/rust-clipboard#62

* Exclude reqwest dependency in wasm32

* Exclude compiling clipboard pasting on wasm32

* Exclude reqwest-using code from wasm32

* Install wasm target with rustup in Travis CI

* Update to collision 0.19.0

Fixes wasm incompatibility in deprecated rustc-serialize crate: rustgd/collision-rs#106

error[E0046]: not all trait items implemented, missing: `encode`
    --> github.aaakk.us.kg-1ecc6299db9ec823/rustc-serialize-0.3.24/src/serialize.rs:1358:1

* Increase travis_wait time even further, try 120 minutes

* Set RUST_BACKTRACE=1 in main

* Remove unused unneeded bzip2 features in zip crate

To fix wasm32-unknown-unknown target compile error:
error[E0432]: unresolved imports `libc::c_int`, `libc::c_uint`, `libc::c_void`, `libc::c_char`
 --> src/github.aaakk.us.kg-1ecc6299db9ec823/bzip2-sys-0.1.7/lib.rs:5:12
  |
5 | use libc::{c_int, c_uint, c_void, c_char};
  |            ^^^^^  ^^^^^^  ^^^^^^  ^^^^^^ no `c_char` in the root
  |            |      |       |
  |            |      |       no `c_void` in the root
  |            |      no `c_uint` in the root
  |            no `c_int` in the root

* flate2 use Rust backend

* Add console_error_panic_hook module for wasm backtraces

* Build using wasm-pack, wasm-bindgen, run with wasm-app

* Update to miniz_oxide 0.2.1, remove patch for Frommi/miniz_oxide#42

* Update to official clipboard crate since aweinstock314/rust-clipboard#62 was merged, but git revision pending release

* Update to branch of glutin attempting to build for wasm

iceiix/glutin#1

* Update winit dependency of glutin to git master

iceiix/winit#2

* Update to glutin branch with working (compiles, doesn't run) wasm_stub

* Add app name in title on web page

* Add wasm to Travis-CI test matrix

* Update glutin to fix Windows EGL compilation on AppVeyor

iceiix/glutin@9779735
iceiix added a commit to iceiix/stevenarella that referenced this pull request Feb 1, 2020
)

Note this only is the first step in web support, although the project compiles, it doesn't run!

Merging now to avoid branch divergence, until dependencies can be updated for wasm support.

* Add instructions to build for wasm32-unknown-unknown with wasm-pack in www/

* Update to rust-clipboard fork to compile with emscripten

aweinstock314/rust-clipboard#62

* Exclude reqwest dependency in wasm32

* Exclude compiling clipboard pasting on wasm32

* Exclude reqwest-using code from wasm32

* Install wasm target with rustup in Travis CI

* Update to collision 0.19.0

Fixes wasm incompatibility in deprecated rustc-serialize crate: rustgd/collision-rs#106

error[E0046]: not all trait items implemented, missing: `encode`
    --> github.aaakk.us.kg-1ecc6299db9ec823/rustc-serialize-0.3.24/src/serialize.rs:1358:1

* Increase travis_wait time even further, try 120 minutes

* Set RUST_BACKTRACE=1 in main

* Remove unused unneeded bzip2 features in zip crate

To fix wasm32-unknown-unknown target compile error:
error[E0432]: unresolved imports `libc::c_int`, `libc::c_uint`, `libc::c_void`, `libc::c_char`
 --> src/github.aaakk.us.kg-1ecc6299db9ec823/bzip2-sys-0.1.7/lib.rs:5:12
  |
5 | use libc::{c_int, c_uint, c_void, c_char};
  |            ^^^^^  ^^^^^^  ^^^^^^  ^^^^^^ no `c_char` in the root
  |            |      |       |
  |            |      |       no `c_void` in the root
  |            |      no `c_uint` in the root
  |            no `c_int` in the root

* flate2 use Rust backend

* Add console_error_panic_hook module for wasm backtraces

* Build using wasm-pack, wasm-bindgen, run with wasm-app

* Update to miniz_oxide 0.2.1, remove patch for Frommi/miniz_oxide#42

* Update to official clipboard crate since aweinstock314/rust-clipboard#62 was merged, but git revision pending release

* Update to branch of glutin attempting to build for wasm

iceiix/glutin#1

* Update winit dependency of glutin to git master

iceiix/winit#2

* Update to glutin branch with working (compiles, doesn't run) wasm_stub

* Add app name in title on web page

* Add wasm to Travis-CI test matrix

* Update glutin to fix Windows EGL compilation on AppVeyor

iceiix/glutin@9779735
iceiix added a commit to iceiix/stevenarella that referenced this pull request Feb 1, 2020
)

Note this only is the first step in web support, although the project compiles, it doesn't run!

Merging now to avoid branch divergence, until dependencies can be updated for wasm support.

* Add instructions to build for wasm32-unknown-unknown with wasm-pack in www/

* Update to rust-clipboard fork to compile with emscripten

aweinstock314/rust-clipboard#62

* Exclude reqwest dependency in wasm32

* Exclude compiling clipboard pasting on wasm32

* Exclude reqwest-using code from wasm32

* Install wasm target with rustup in Travis CI

* Update to collision 0.19.0

Fixes wasm incompatibility in deprecated rustc-serialize crate: rustgd/collision-rs#106

error[E0046]: not all trait items implemented, missing: `encode`
    --> github.aaakk.us.kg-1ecc6299db9ec823/rustc-serialize-0.3.24/src/serialize.rs:1358:1

* Increase travis_wait time even further, try 120 minutes

* Set RUST_BACKTRACE=1 in main

* Remove unused unneeded bzip2 features in zip crate

To fix wasm32-unknown-unknown target compile error:
error[E0432]: unresolved imports `libc::c_int`, `libc::c_uint`, `libc::c_void`, `libc::c_char`
 --> src/github.aaakk.us.kg-1ecc6299db9ec823/bzip2-sys-0.1.7/lib.rs:5:12
  |
5 | use libc::{c_int, c_uint, c_void, c_char};
  |            ^^^^^  ^^^^^^  ^^^^^^  ^^^^^^ no `c_char` in the root
  |            |      |       |
  |            |      |       no `c_void` in the root
  |            |      no `c_uint` in the root
  |            no `c_int` in the root

* flate2 use Rust backend

* Add console_error_panic_hook module for wasm backtraces

* Build using wasm-pack, wasm-bindgen, run with wasm-app

* Update to miniz_oxide 0.2.1, remove patch for Frommi/miniz_oxide#42

* Update to official clipboard crate since aweinstock314/rust-clipboard#62 was merged, but git revision pending release

* Update to branch of glutin attempting to build for wasm

iceiix/glutin#1

* Update winit dependency of glutin to git master

iceiix/winit#2

* Update to glutin branch with working (compiles, doesn't run) wasm_stub

* Add app name in title on web page

* Add wasm to Travis-CI test matrix

* Update glutin to fix Windows EGL compilation on AppVeyor

iceiix/glutin@9779735
iceiix added a commit to iceiix/stevenarella that referenced this pull request Feb 1, 2020
)

Note this only is the first step in web support, although the project compiles, it doesn't run!

Merging now to avoid branch divergence, until dependencies can be updated for wasm support.

* Add instructions to build for wasm32-unknown-unknown with wasm-pack in www/

* Update to rust-clipboard fork to compile with emscripten

aweinstock314/rust-clipboard#62

* Exclude reqwest dependency in wasm32

* Exclude compiling clipboard pasting on wasm32

* Exclude reqwest-using code from wasm32

* Install wasm target with rustup in Travis CI

* Update to collision 0.19.0

Fixes wasm incompatibility in deprecated rustc-serialize crate: rustgd/collision-rs#106

error[E0046]: not all trait items implemented, missing: `encode`
    --> github.aaakk.us.kg-1ecc6299db9ec823/rustc-serialize-0.3.24/src/serialize.rs:1358:1

* Increase travis_wait time even further, try 120 minutes

* Set RUST_BACKTRACE=1 in main

* Remove unused unneeded bzip2 features in zip crate

To fix wasm32-unknown-unknown target compile error:
error[E0432]: unresolved imports `libc::c_int`, `libc::c_uint`, `libc::c_void`, `libc::c_char`
 --> src/github.aaakk.us.kg-1ecc6299db9ec823/bzip2-sys-0.1.7/lib.rs:5:12
  |
5 | use libc::{c_int, c_uint, c_void, c_char};
  |            ^^^^^  ^^^^^^  ^^^^^^  ^^^^^^ no `c_char` in the root
  |            |      |       |
  |            |      |       no `c_void` in the root
  |            |      no `c_uint` in the root
  |            no `c_int` in the root

* flate2 use Rust backend

* Add console_error_panic_hook module for wasm backtraces

* Build using wasm-pack, wasm-bindgen, run with wasm-app

* Update to miniz_oxide 0.2.1, remove patch for Frommi/miniz_oxide#42

* Update to official clipboard crate since aweinstock314/rust-clipboard#62 was merged, but git revision pending release

* Update to branch of glutin attempting to build for wasm

iceiix/glutin#1

* Update winit dependency of glutin to git master

iceiix/winit#2

* Update to glutin branch with working (compiles, doesn't run) wasm_stub

* Add app name in title on web page

* Add wasm to Travis-CI test matrix

* Update glutin to fix Windows EGL compilation on AppVeyor

iceiix/glutin@9779735
iceiix added a commit to iceiix/stevenarella that referenced this pull request Feb 2, 2020
)

Note this only is the first step in web support, although the project compiles, it doesn't run!

Merging now to avoid branch divergence, until dependencies can be updated for wasm support.

* Add instructions to build for wasm32-unknown-unknown with wasm-pack in www/

* Update to rust-clipboard fork to compile with emscripten

aweinstock314/rust-clipboard#62

* Exclude reqwest dependency in wasm32

* Exclude compiling clipboard pasting on wasm32

* Exclude reqwest-using code from wasm32

* Install wasm target with rustup in Travis CI

* Update to collision 0.19.0

Fixes wasm incompatibility in deprecated rustc-serialize crate: rustgd/collision-rs#106

error[E0046]: not all trait items implemented, missing: `encode`
    --> github.aaakk.us.kg-1ecc6299db9ec823/rustc-serialize-0.3.24/src/serialize.rs:1358:1

* Increase travis_wait time even further, try 120 minutes

* Set RUST_BACKTRACE=1 in main

* Remove unused unneeded bzip2 features in zip crate

To fix wasm32-unknown-unknown target compile error:
error[E0432]: unresolved imports `libc::c_int`, `libc::c_uint`, `libc::c_void`, `libc::c_char`
 --> src/github.aaakk.us.kg-1ecc6299db9ec823/bzip2-sys-0.1.7/lib.rs:5:12
  |
5 | use libc::{c_int, c_uint, c_void, c_char};
  |            ^^^^^  ^^^^^^  ^^^^^^  ^^^^^^ no `c_char` in the root
  |            |      |       |
  |            |      |       no `c_void` in the root
  |            |      no `c_uint` in the root
  |            no `c_int` in the root

* flate2 use Rust backend

* Add console_error_panic_hook module for wasm backtraces

* Build using wasm-pack, wasm-bindgen, run with wasm-app

* Update to miniz_oxide 0.2.1, remove patch for Frommi/miniz_oxide#42

* Update to official clipboard crate since aweinstock314/rust-clipboard#62 was merged, but git revision pending release

* Update to branch of glutin attempting to build for wasm

iceiix/glutin#1

* Update winit dependency of glutin to git master

iceiix/winit#2

* Update to glutin branch with working (compiles, doesn't run) wasm_stub

* Add app name in title on web page

* Add wasm to Travis-CI test matrix

* Update glutin to fix Windows EGL compilation on AppVeyor

iceiix/glutin@9779735
iceiix added a commit to iceiix/stevenarella that referenced this pull request Feb 2, 2020
The git dependency was only for wasm32-unknown-emscripten support:
aweinstock314/rust-clipboard#62
but #92 changes to using wasm32-unknown-unknown instead, a better
supported path (though still incomplete in this project, see #171)
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