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

Workaround IoVec upstream issue introduced by of Fetch implementation #110

Conversation

machineloop
Copy link
Contributor

@machineloop machineloop commented Jan 16, 2018

Master is broken for wasm32-unknown-unknown builds because of the Fetch implementation's use of Http Request/Response return types. @deniskolodin, we can avoid backing out Fetch's use of Http if we do something along the lines of this PR.

See #102 for more info, IoVec needs to cut a new release supporting Wasm and From<[u8]> impls.

There was a breaking change to remove the From<[u8]> impls that will be released with a version-bump eventually.

We can add these lines of code temporarily in the examples to pull a version of IoVec directly from my Github fork which cherry picks the commits that support Wasm while leaving out the breaking changes to the From<[u8]> impls.

Perhaps there's a more elegant way to do this without using [replace] in the cargo.toml files.

@therustmonk
Copy link
Member

@machineloop This is a useful change and it's better than reverting Fetch service back. 👍 Thank you!
It seems not every example needs replace, because only dashboard uses Fetch service. Could you leave replace in dashboard demo only to keep this patch compact?

@machineloop
Copy link
Contributor Author

machineloop commented Jan 16, 2018

Yeah, I'm not sure why this is the case, when I remove the [replace] from an example and cd into the its directory and try to compile with cargo web start --target-webasm, I still get this:

screen shot 2018-01-15 at 4 58 05 pm

@deniskolodin, could you double check the other examples without a Fetch implementation compile without the [replace]?

@gabisurita
Copy link
Contributor

@deniskolodin @machineloop Besides Fetch is not used on the examples, all of them will still try to compile IoVec as a dependecy, so you do need [replace] on all examples or on the yew package to compile them as wasm32-unknown-unknown.

@machineloop
Copy link
Contributor Author

Thanks for taking a look @gabisurita, I've tried adding the [replace] directly to Yew's cargo.toml, also tried using newer [patch.crates-io], couldn't get either to work directly on Yew. Have you had any luck making a single change to the Yew lib to fix?

@therustmonk
Copy link
Member

Ok, I'll examine that more deep. Also I have another fail for wasm32-unknown-unknown:

   Compiling dtoa v0.4.2
   Compiling unicode-xid v0.0.4
   Compiling itoa v0.3.4
   Compiling serde v1.0.27
   Compiling libc v0.2.36
   Compiling iovec v0.1.1 (https://github.com/machineloop/iovec?branch=wasm-support#c954f1d8)
   Compiling quote v0.3.15
   Compiling rustc-serialize v0.3.24
   Compiling byteorder v1.2.1
error[E0046]: not all trait items implemented, missing: `encode`
    --> /home/denis/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-serialize-0.3.24/src/serialize.rs:1358:1
     |
853  |     fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error>;
     |     ---------------------------------------------------------------- `encode` from trait
...
1358 | impl Encodable for path::Path {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `encode` in implementation

error[E0046]: not all trait items implemented, missing: `decode`
    --> /home/denis/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-serialize-0.3.24/src/serialize.rs:1382:1
     |
904  |     fn decode<D: Decoder>(d: &mut D) -> Result<Self, D::Error>;
     |     ----------------------------------------------------------- `decode` from trait
...
1382 | impl Decodable for path::PathBuf {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `decode` in implementation

error: aborting due to 2 previous errors
error: Could not compile `rustc-serialize`.

warning: build failed, waiting for other jobs to finish...
error: build failed
error: build failed

@machineloop
Copy link
Contributor Author

Interesting @deniskolodin... what example are you compiling and what version of Rust are you on?

@ctjhoa
Copy link
Contributor

ctjhoa commented Jan 26, 2018

I've written a wasm backport for iovec 0.1.x
carllerche/iovec#13

@therustmonk
Copy link
Member

@machineloop Thank you for the great help! IoVec works now. Probably should close this PR?

@machineloop
Copy link
Contributor Author

Fixed, closing PR

@machineloop machineloop closed this Feb 3, 2018
@machineloop machineloop deleted the workaround-fetch-iovec-upstream-issue branch February 3, 2018 13:29
teymour-aldridge added a commit to teymour-aldridge/yew that referenced this pull request Jul 8, 2020
* Add #[derive(Clone)] in examples

Closes yewstack#110

* Add backticks to rust elements

Co-authored-by: Teymour Aldridge <[email protected]>

* Another backtics

Co-authored-by: Teymour Aldridge <[email protected]>
jstarry pushed a commit to jstarry/yew that referenced this pull request Jul 10, 2020
* Add #[derive(Clone)] in examples

Closes yewstack#110

* Add backticks to rust elements

Co-authored-by: Teymour Aldridge <[email protected]>

* Another backtics

Co-authored-by: Teymour Aldridge <[email protected]>
jstarry added a commit that referenced this pull request Jul 10, 2020
* GitBook: [master] 2 pages modified

* Added code examples for the router docs. (#67)

* GitBook: [master] 3 pages modified

* GitBook: [master] one page modified

* Update the sample doc app to use wasm-pack (#75)

* Update the sample doc app to use wasm-pack

According to the rest of the documentation, wasm-pack and web-sys are
the recommended tool to use. However, the sample app documents the usage
of cargo-web and stdweb.

The command lines are taken from the example folder of yew.

* Some grammar fixes

* Use cargo miniserve instead of python to server the files

* Add wasm-bindgen dependency

* Fixed bad link to build script for wasm-bindgen/cargo-web (#81)

* Fixed bad link to build script for wasm-bindgen/cargo-web

* yewstack/docs#81 Updated link for cargo-web

* Update miniserve cargo install command (#88)

* create as lib right away (#93)

* updated (#92)

* GitBook: [master] 29 pages modified

* update the docs to specify that local agents do not incur serialization overhead (#89)

* Add a note telling how to bypass the recursion limit of the html! macro. (#94)

* Add a note telling how to bypass the recursion limit of the html! macro.

* Update src/concepts/html/README.md

Co-authored-by: Teymour Aldridge <[email protected]>

* Update src/concepts/html/README.md

Co-authored-by: Teymour Aldridge <[email protected]>
Co-authored-by: Justin Starry <[email protected]>

* Add latest Stack Overflow survey results (#95)

* Mention prop_or macro (#97)

* Mention prop_or macro

* Fix the prop_or vs prop_or_else mixup

* Update src/concepts/components/properties.md

Co-authored-by: Justin Starry <[email protected]>

* Fix a typo. (#102)

* Point to master branch for examples (#98)

* Point to master branch for examples

* Update src/getting-started/examples.md

Co-authored-by: Teymour Aldridge <[email protected]>

* Apply suggestions from code review

Co-authored-by: Teymour Aldridge <[email protected]>

* Update src/getting-started/examples.md

Co-authored-by: Teymour Aldridge <[email protected]>
Co-authored-by: Justin Starry <[email protected]>

* Add code of conduct to documentation as well. (#104)

* Added "" for the version at line 25 (#107)

* Added "" for the version at line 25

* Update src/getting-started/starter-templates.md

Co-authored-by: Teymour Aldridge <[email protected]>

Co-authored-by: Justin Starry <[email protected]>
Co-authored-by: Teymour Aldridge <[email protected]>

* Removed periods and fixed spelling mistakes (#103)

* Added period to description

* Fixed the spelling of " Arguabley" to "Arguably"

* Update README.md

* Added period to description

* Added period to description

* Grammar and spelling correction

added period to description, fixed spelling of "encouter" to "encounter"

* Added period to description

* Added period to description

* Grammar and spelling

Added period to description, fixed spelling of "accross" to "across"

* Added period to description

* Added period to description

* Fixed spelling of "aggresive" to "aggressive"

* Removed period from description

* Update optimizations.md

* Removed period from description

* Removed period from description

* Removed period from description

* Removed period from description

* Removed period from description

* Removed period from description

* Removed period from description

* Removed period from description

* Removed period from description

* Removed period from description

* Removed period from description

* Update src/concepts/html/README.md

Co-authored-by: Teymour Aldridge <[email protected]>

Co-authored-by: Justin Starry <[email protected]>
Co-authored-by: Teymour Aldridge <[email protected]>

* Shorten line lengths. (#106)

* Shortens line lengths (to ~100 characters max per line).
 * A few stylistic improvements
 * Corrects a couple of typos
 * Fixes a few grammar errors

Co-authored-by: Justin Starry <[email protected]>

* bumping up the yew version in Cargo.toml (#107) (#109)

* bumping up the yew version in Cargo.toml (#107)

* bumping up the yew version for stdweb

* bumping up the yew version of ConsoleService link

* bumping up the yew version

* Update src/more/debugging.md

Co-authored-by: Justin Starry <[email protected]>

* Add #[derive(Clone)] in examples (#111)

* Add #[derive(Clone)] in examples

Closes #110

* Add backticks to rust elements

Co-authored-by: Teymour Aldridge <[email protected]>

* Another backtics

Co-authored-by: Teymour Aldridge <[email protected]>

* Fix typo (#112)

* GitBook: [master] 29 pages modified

* Fix spellcheck

* Remove duplicate code of conduct

Co-authored-by: Teymour Aldridge <[email protected]>
Co-authored-by: Franck Royer <[email protected]>
Co-authored-by: Eamon Caton <[email protected]>
Co-authored-by: David Poggi <[email protected]>
Co-authored-by: Stephan Dilly <[email protected]>
Co-authored-by: 洪慈吟 <[email protected]>
Co-authored-by: Michal Kawalec <[email protected]>
Co-authored-by: codec-abc <[email protected]>
Co-authored-by: Anthony Morris <[email protected]>
Co-authored-by: Günter Zöchbauer <[email protected]>
Co-authored-by: Darren Meehan <[email protected]>
Co-authored-by: Nougator <[email protected]>
Co-authored-by: Dirk Puge <[email protected]>
Co-authored-by: hituzi no sippo <[email protected]>
Co-authored-by: Mingun <[email protected]>
Co-authored-by: FIGBERT <[email protected]>
jstarry pushed a commit that referenced this pull request Jul 10, 2020
* Add #[derive(Clone)] in examples

Closes #110

* Add backticks to rust elements

Co-authored-by: Teymour Aldridge <[email protected]>

* Another backtics

Co-authored-by: Teymour Aldridge <[email protected]>
jstarry pushed a commit that referenced this pull request Aug 16, 2020
* Add #[derive(Clone)] in examples

Closes #110

* Add backticks to rust elements

Co-authored-by: Teymour Aldridge <[email protected]>

* Another backtics

Co-authored-by: Teymour Aldridge <[email protected]>
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.

4 participants