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

stdweb always included as a dependency no matter the platform #243

Open
arturoc opened this issue Sep 17, 2018 · 5 comments
Open

stdweb always included as a dependency no matter the platform #243

arturoc opened this issue Sep 17, 2018 · 5 comments

Comments

@arturoc
Copy link

arturoc commented Sep 17, 2018

This is probably a bug in cargo but stdweb always gets included as a dependency of this crate. It's usually ok unless you try to compile a dynamic library including this crate in which case the resulting binary will have dependencies with emscripten and fail to load.

Adding an stdweb feature to optionally use stdweb when compiling for the web should solve the problem until cargo does the right thing

@tomaka
Copy link
Collaborator

tomaka commented Sep 17, 2018

Could you check your Cargo.lock to see if it's not accidentally one of the other dependencies that pulls stdweb? A Cargo bug is pretty unlikely I think.

@arturoc
Copy link
Author

arturoc commented Sep 17, 2018

it's coming from cpal but let me double check with a simpler example just in case

@arturoc
Copy link
Author

arturoc commented Sep 17, 2018

with a new project and no other dependencies but cpal and building in linux 64 (using nightly in case it makes any difference):

Cargo.toml:

[package]
name = "test_cpal"
version = "0.1.0"
authors = ["arturo castro <arturo@openframeworks.cc>"]

[dependencies]
cpal="*"

Cargo.lock:

[[package]]
name = "cpal"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
 "alsa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
 "core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
 "coreaudio-rs 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
 "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
 "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
 "stdweb 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
 "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]

@tomaka
Copy link
Collaborator

tomaka commented Sep 18, 2018

I think the dependency is always present in the Cargo.lock no matter the platform, but it's built only if necessary.

@arturoc
Copy link
Author

arturoc commented Sep 18, 2018

yeah i imagine since there's also stuff like winapi and coreaudio in linux but i was getting undefined symbols for emscripten functions so it was definitely being included. in any case this only happens when compiling a dynamic library so it's a pretty obscure case

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

No branches or pull requests

2 participants