-
Notifications
You must be signed in to change notification settings - Fork 104
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
compiling terminfo #64
Comments
Hi Paul, I haven't tried to build starlark with Bazel yet but I had to use terminfo on some other occasion, you need to declare that build.rs is needed in your
You will need that for starlark itself also:
If you succeed, feel free to send PR to add this to the starlark documentation (or even add a Bazel build to it). |
Thanks, that got me farther. [package]
name = "fake_lib"
version = "0.0.1"
[lib]
path = "lib.rs"
[dependencies]
starlark = "0.1.2"
[raze]
genmode = "Remote"
workspace_path = "//cargo"
[raze.crates.terminfo.'0.6.0']
gen_buildrs = true
[raze.crates.starlark.'0.1.2']
gen_buildrs = true
[raze.crates.typenum.'1.10.0']
gen_buildrs = true Any ideas about this one?
|
#41 (comment) was the answer to lazy static; the general formula is running the build_rs or replicating what it does (eg. by hardcoding flags) |
Thank you! Farther again, but stuck once more. Although proc_macro2 was mentioned in the comment you referenced, applying those cfg values does not seem to resolve the issue within the [package]
name = "fake_lib"
version = "0.0.1"
[lib]
path = "lib.rs"
[dependencies]
starlark = "0.1.2"
[raze]
genmode = "Remote"
workspace_path = "//cargo"
target = "x86_64-unknown-linux-gnu"
[raze.crates.terminfo.'0.6.1']
gen_buildrs = true
[raze.crates.starlark.'0.1.2']
gen_buildrs = true
[raze.crates.typenum.'1.10.0']
gen_buildrs = true
[raze.crates.lazy_static.'1.1.0']
additional_flags = [
"--cfg=lazy_static_heap_impl",
]
# not helping...
[raze.crates.syn.'0.15.6']
gen_buildrs = true
[raze.crates.proc_macro2.'0.4.19']
additional_flags = [
# "--cfg=wrap_proc_macro",
"--cfg=use_proc_macro",
"--cfg=slow_extend",
]
[raze.crates.proc_macro2.'0.3.8']
additional_flags = [
# "--cfg=wrap_proc_macro",
"--cfg=use_proc_macro",
"--cfg=slow_extend",
]
Any additional suggestions? |
I updated the linked post, our file has
I don't recall any difference between Also, I don't see a build.rs in syn but that doesn't look relevant. |
The space didn't seem to matter. If I look at the features of the syn build file, it has both proc-macro and proc-macro2 features. Should these be orthogonal? rust_library(
name = "syn",
crate_root = "src/lib.rs",
crate_type = "lib",
srcs = glob(["**/*.rs"]),
deps = [
"@raze__proc_macro2__0_4_19//:proc_macro2",
"@raze__quote__0_6_8//:quote",
"@raze__unicode_xid__0_1_0//:unicode_xid",
],
rustc_flags = [
"--cap-lints allow",
"--target=x86_64-unknown-linux-gnu",
],
crate_features = [
"clone-impls",
"default",
"derive",
"parsing",
"printing",
"proc-macro",
"proc-macro2",
"quote",
"visit",
],
) |
I don't have much background w/ features.
At a glance https://github.com/dtolnay/syn/blob/master/Cargo.toml doesn't
actually have a proc-macro2 feature, and raze is not seeing the features as
dependency's feature.
…On Sun, Sep 30, 2018 at 4:27 PM Paul Cody Johnston ***@***.***> wrote:
The space didn't seem to matter. If I look at the features of the syn
build file, it has both proc-macro and proc-pmacro2 features. Should these
be orthogonal?
rust_library(
name = "syn",
crate_root = "src/lib.rs",
crate_type = "lib",
srcs = glob(["**/*.rs"]),
deps = [
***@***.***__proc_macro2__0_4_19//:proc_macro2",
***@***.***__quote__0_6_8//:quote",
***@***.***__unicode_xid__0_1_0//:unicode_xid",
],
rustc_flags = [
"--cap-lints allow",
"--target=x86_64-unknown-linux-gnu",
],
crate_features = [
"clone-impls",
"default",
"derive",
"parsing",
"printing",
"proc-macro",
"proc-macro2",
"quote",
"visit",
],
)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#64 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACLjeOjgjfqKKtpMtL5Ob6mpaG4kppXnks5ugSkZgaJpZM4XAi7L>
.
|
Manually removing the Next one is:
The
How would this be expressed with cargo-raze? Thanks for all your responses so far, very much appreciated and sorry to be such a pain. |
The problem isn't in serde_derive, `parse_macro_input!` is not being
produced in syn somehow.. I haven't run into anything like this before.
…On Sun, Sep 30, 2018 at 5:35 PM Paul Cody Johnston ***@***.***> wrote:
Manually removing the proc-macro feature and retaining the proc-macro2
feature did the trick. Is there a way to suppress this in the generator?
Next one is:
INFO: SHA256 (https://crates-io.s3-us-west-1.amazonaws.com/crates/serde_derive/serde_derive-1.0.79.crate) = 31569d901045afbff7a9479f793177fe9259819aff10ab4f89ef69bbc5f567fe
INFO: Analysed target //:docgen (1 packages loaded).
INFO: Found 1 target...
ERROR: /home/pcj/.cache/bazel/_bazel_pcj/9feaf001454c16e46c01ade0d88992bb/external/raze__serde_derive__1_0_79/BUILD.bazel:20:1: error executing shell command: '/bin/bash -c set -e; if [ ! -z "${TMPDIR+x}" ]; then mkdir -p $TMPDIR; fi; rm -rf bazel-out/host/bin/external/raze__serde_derive__1_0_79/serde_derive.deps; mkdir bazel-out/host/bin/external/raze__s...' failed (Exit 101)
error: cannot find macro `parse_macro_input!` in this scope
--> external/raze__serde_derive__1_0_79/src/lib.rs:86:17
|
86 | let input = parse_macro_input!(input as DeriveInput);
| ^^^^^^^^^^^^^^^^^
error: cannot find macro `parse_macro_input!` in this scope
--> external/raze__serde_derive__1_0_79/src/lib.rs:94:17
|
94 | let input = parse_macro_input!(input as DeriveInput);
| ^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
The serde_derive Cargo.toml has:
[lib]
name = "serde_derive"
proc-macro = true
How would this be expressed with cargo-raze? Thanks for all your responses
so far, very much appreciated and sorry to be such a pain.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#64 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACLjeGe05F8rOwEYcgOb5JjisZVJxYvGks5ugTkTgaJpZM4XAi7L>
.
|
I just ran in to this while starting a new project (it's just calling @pcj the proc-macro feature can't be removed (I'm pretty sure that's causing your next issue). I solved the problem with only one change, adding to my Cargo.toml: [raze.crates.proc-macro2.'0.4.20']
additional_flags = [
"--cfg use_proc_macro",
] |
@matt-duch's fix worked for me, although I needed [raze.crates.proc-macro2.'1.0.6']
additional_flags = [
"--cfg=use_proc_macro",
] |
I'm trying to pull in @damienmg's starlark crate and am seeing the folllowing issue.
Her is my
Cargo.toml
file:When the terminfo dependency is compiled, I see the following error:
Any suggestions?
The text was updated successfully, but these errors were encountered: