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

More yew examples compiling #1410

Conversation

philip-peterson
Copy link
Contributor

Description

Relates to #1289

Allows some Yew examples that weren't building via examples/build.sh to be built successfully. Was able to get every example compiling except for server.

One thing that came up when running ci/run_stable_checks.sh is that for some reason, a warning appears on the crm example yet "fixing" the warnings leads to a compilation error. Without both of these attributes, there is a recursion limit exceeded error when compiling. Maybe this warning should be silenced? This is on Rust 1.44.1.

error: unused attribute
 --> examples/crm/src/lib.rs:1:1
  |
1 | #![recursion_limit = "256"]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `-D unused-attributes` implied by `-D warnings`

error: crate-level attribute should be in the root module
 --> examples/crm/src/lib.rs:1:1
  |
1 | #![recursion_limit = "256"]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors

Checklist:

  • I have run ./ci/run_stable_checks.sh
  • I have reviewed my own code
  • [NA] I have added tests

@philip-peterson philip-peterson force-pushed the peterson/update-main-examples branch from 6fcb0a8 to 6cadd7c Compare July 12, 2020 05:12
@philip-peterson
Copy link
Contributor Author

cc @numerodix

@@ -1,9 +1,9 @@
#![recursion_limit = "256"]

#[macro_use]
extern crate serde_derive;
extern crate common;
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is needed

@@ -4,8 +4,11 @@ version = "0.1.0"
authors = ["Denis Kolodin <[email protected]>"]
edition = "2018"

[lib]
crate-type = ["cdylib", "rlib"]
Copy link
Member

Choose a reason for hiding this comment

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

We should if examples will be built as libraries or binaries. wasm-bindgen builds examples as binaries so I don't think this is needed

@jstarry
Copy link
Member

jstarry commented Jul 12, 2020

@philip-peterson thanks for fixing these up! server isn't an example btw, it's there because some examples require a server to run

@philip-peterson
Copy link
Contributor Author

Sure thing! Thanks for the quick review, it's strange that some of those things I could've sworn were necessary to avoid compile errors.. oh well, they've been removed now. Any thoughts on what we should do regarding the warning? I am thinking it should probably be a bug for Rust, I can't find any existing issue for it so if someone else can reproduce as well, that might be the next step.

@numerodix
Copy link
Contributor

@philip-peterson It's interesting - crm was building without error for me.

For the examples that bring their own static directory (which is ignored by build.sh) I noticed that they all compile (iirc) but many don't run because they are referencing a .js file that doesn't exist in the repo.

@philip-peterson
Copy link
Contributor Author

It's very strange, I noticed a few things were compiling when they weren't before, then checked out master and everything compiled successfully. May have rebased in-between at some point, but I guess we can close this PR, not really sure what happened but if everything is building on master I spose there's nothing to do after all.

@philip-peterson
Copy link
Contributor Author

Thanks @numerodix , good to understand where the remaining issues lie with the examples.

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.

3 participants