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

build: make cargo check pass #1125

Closed
wants to merge 3 commits into from

Conversation

piscisaureus
Copy link
Member

No description provided.


let out_dir = env::var("OUT_DIR").unwrap();
let out_dir = Path::new(&out_dir);
let wrapper_rs = out_dir.join("find_msg_generated.inc.rs");
Copy link
Member

Choose a reason for hiding this comment

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

1337

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

Impressively professional

  1. Can you add cargo check to travis and/or appveyor to ensure we maintain this.
  2. Can you add #[link(name = "libdeno", kind = "static", filename = OUT_DIR/libdeno.a )] in src/libdeno.rs
  3. I'm getting this error
~/src/deno> cargo build
   Compiling idna v0.1.5
   Compiling msg_rs v0.0.0 (file:///Users/rld/src/deno/msg_rs)
   Compiling h2 v0.1.12
   Compiling webpki v0.18.1
error: couldn't read "/Users/rld/src/deno/out/debug/gen/msg_generated.rs": No such file or directory (os error 2)
 --> /Users/rld/src/deno/target/debug/build/msg_rs-f405e9593a5a6ae1/out/find_msg_generated.inc.rs:3:11
  |
3 |       mod msg;
  |           ^^^

error: aborting due to previous error

error: Could not compile `msg_rs`.
warning: build failed, waiting for other jobs to finish...

error: build failed
Error 101 ~/src/deno>

@ry
Copy link
Member

ry commented Oct 31, 2018

I was able to fix this by doing this:

> DENO_BUILD_DIR=target/debug/ ./tools/build.py
> DENO_BUILD_DIR=target/debug/ cargo check

Please rename msg_rs/cargo.toml to msg_rs/Cargo.toml...

Does msg_rs really need to be its own crate? This is something that can be dealt with in a follow up, but we should be able to just import it was as module...

@piscisaureus piscisaureus force-pushed the cargocheck branch 4 times, most recently from 156ab9d to 3fd62a0 Compare October 31, 2018 05:29
@piscisaureus
Copy link
Member Author

piscisaureus commented Oct 31, 2018

Can you add cargo check to travis and/or appveyor to ensure we maintain this.

ok, done

I'm getting this error
«snip»
I was able to fix this by doing this:

> DENO_BUILD_DIR=target/debug/ ./tools/build.py
> DENO_BUILD_DIR=target/debug/ cargo check

That's expected -- build.rs makes no attempt to build or run flatc to generate msg_generated.rs. You have to do that manually before running cargo check.
This could be changed of course but that's for another day/PR.
PS: DENO_BUILD_DIR has no effect on anything.

Please rename msg_rs/cargo.toml to msg_rs/Cargo.toml...

done

Does msg_rs really need to be its own crate? This is something that can be dealt with in a follow up, but we should be able to just import it was as module...

I don't think so necessarily -- although what's nice now is that this hackery is confined in it's own little box. Prefer to deal with this in a follow up PR indeed.

@piscisaureus
Copy link
Member Author

@ry ptal

@ry
Copy link
Member

ry commented Oct 31, 2018

@piscisaureus Please look at #1127 - upgrading flatbuffer coincidentally necessitated making msg_generated.rs a "mod" instead of a crate. I think we should land that first, since there's some complexity in your patch which will not exist after #1127

.cargo/config Outdated
# The location of the cargo build directory can be overridden, but the name of
# the directory itself is best left at 'target'.
# https://github.com/rust-lang/cargo/pull/1657#issue-36459101
target-dir = "out/target"
Copy link
Member

Choose a reason for hiding this comment

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

If possible, let's leave this file out for now.

Starting a path with a slash is equivalent to specifying '**/the_path'.
Removed the leading slash where it seemed unintentional.
@piscisaureus
Copy link
Member Author

Postponed to 2020.

@ry ry mentioned this pull request Oct 31, 2018
@ry
Copy link
Member

ry commented Oct 31, 2018

I'm resurrecting this in #1128

ry added a commit to ry/deno that referenced this pull request Oct 31, 2018
- Based on code from @qti3e and @piscisaureus in denoland#724 and denoland#1125
  respectively.
- TODO The DENO_BUILD_PATH env var must be supplied and must be an
  absolute path, this restriction should be removed in future work.
ry added a commit to ry/deno that referenced this pull request Oct 31, 2018
- Based on code from @qti3e and @piscisaureus in denoland#724 and denoland#1125
  respectively.
- TODO The DENO_BUILD_PATH env var must be supplied and must be an
  absolute path, this restriction should be removed in future work.
ry added a commit to ry/deno that referenced this pull request Oct 31, 2018
- Based on code from @qti3e and @piscisaureus in denoland#724 and denoland#1125
  respectively.
- TODO The DENO_BUILD_PATH env var must be supplied and must be an
  absolute path, this restriction should be removed in future work.
ry added a commit to ry/deno that referenced this pull request Oct 31, 2018
- Based on code from @qti3e and @piscisaureus in denoland#724 and denoland#1125
  respectively.
- TODO The DENO_BUILD_PATH env var must be supplied and must be an
  absolute path, this restriction should be removed in future work.
ry added a commit that referenced this pull request Oct 31, 2018
- Based on code from @qti3e and @piscisaureus in #724 and #1125
  respectively.
- TODO The DENO_BUILD_PATH env var must be supplied and must be an
  absolute path, this restriction should be removed in future work.
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