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

Fix vendor detect in build script #19

Merged
merged 1 commit into from Apr 4, 2022
Merged

Conversation

12101111
Copy link
Contributor

@12101111 12101111 commented Apr 3, 2022

Build script should use envirenment variable rather than cfg() or env! which is compile time things: https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts

> cargo zigbuild --target x86_64-pc-windows-gnu -v
   Compiling dark-light v0.2.0 (/Users/han/Project/rust-dark-light)
       Fresh winapi-x86_64-pc-windows-gnu v0.4.0
       Fresh winapi v0.3.9
       Fresh winreg v0.8.0
     Running `rustc --crate-name build_script_build --edition=2018 build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C metadata=5f6ba9f4eaf70f8d -C extra-filename=-5f6ba9f4eaf70f8d --out-dir /Users/han/.cache/rust/debug/build/dark-light-5f6ba9f4eaf70f8d -C incremental=/Users/han/.cache/rust/debug/incremental -L dependency=/Users/han/.cache/rust/debug/deps`
     Running `/Users/han/.cache/rust/debug/build/dark-light-5f6ba9f4eaf70f8d/build-script-build`
     Running `rustc --crate-name dark_light --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=327c3c6225612277 -C extra-filename=-327c3c6225612277 --out-dir /Users/han/.cache/rust/x86_64-pc-windows-gnu/debug/deps --target x86_64-pc-windows-gnu -C linker=/Users/han/Library/Caches/cargo-zigbuild/0.8.1/zigcc-x86_64-pc-windows-gnu.sh -C incremental=/Users/han/.cache/rust/x86_64-pc-windows-gnu/debug/incremental -L dependency=/Users/han/.cache/rust/x86_64-pc-windows-gnu/debug/deps -L dependency=/Users/han/.cache/rust/debug/deps --extern winreg=/Users/han/.cache/rust/x86_64-pc-windows-gnu/debug/deps/libwinreg-28501b6f85b0e51d.rmeta -l framework=AppKit`
warning: associated function is never used: `rgb`
  --> src/lib.rs:76:8
   |
76 |     fn rgb(r: u32, g: u32, b: u32) -> Self {
   |        ^^^
   |
   = note: `#[warn(dead_code)]` on by default

error: native frameworks are only available on macOS targets

warning: `dark-light` (lib) generated 1 warning
error: could not compile `dark-light` due to previous error; 1 warning emitted

Caused by:
  process didn't exit successfully: `rustc --crate-name dark_light --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=327c3c6225612277 -C extra-filename=-327c3c6225612277 --out-dir /Users/han/.cache/rust/x86_64-pc-windows-gnu/debug/deps --target x86_64-pc-windows-gnu -C linker=/Users/han/Library/Caches/cargo-zigbuild/0.8.1/zigcc-x86_64-pc-windows-gnu.sh -C incremental=/Users/han/.cache/rust/x86_64-pc-windows-gnu/debug/incremental -L dependency=/Users/han/.cache/rust/x86_64-pc-windows-gnu/debug/deps -L dependency=/Users/han/.cache/rust/debug/deps --extern winreg=/Users/han/.cache/rust/x86_64-pc-windows-gnu/debug/deps/libwinreg-28501b6f85b0e51d.rmeta -l framework=AppKit` (exit status: 1)

@Be-ing Be-ing merged commit 7e1a2e0 into frewsxcv:master Apr 4, 2022
@Be-ing
Copy link
Collaborator

Be-ing commented Apr 4, 2022

Thanks for fixing this. @frewsxcv could you make a patch release?

@frewsxcv
Copy link
Owner

frewsxcv commented Apr 4, 2022

@Be-ing done. also just gave you release permissions on crates.io

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.

None yet

3 participants