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

Is it intended that the (library) build succeeds on non-macOS/iOS? #70

Closed
eddyb opened this issue Oct 4, 2022 · 2 comments · Fixed by #74
Closed

Is it intended that the (library) build succeeds on non-macOS/iOS? #70

eddyb opened this issue Oct 4, 2022 · 2 comments · Fixed by #74

Comments

@eddyb
Copy link
Contributor

eddyb commented Oct 4, 2022

ash-molten/build/build.rs

Lines 375 to 378 in 09bed93

#[cfg(not(any(target_os = "macos", target_os = "ios")))]
fn main() {
eprintln!("ash-molten requires either 'macos' or 'ios' target");
}

That build script will just print a message that will never be forwarded to the user, because it also "succeeds" (since it doesn't panic, nor exit with a non-0 return code - either via fn main() -> ... or std::process::exit).

Is this intentional? cargo run, and many other uses of the library, will still fail with a linker error.

@MarijnS95
Copy link
Contributor

I suggested to do the same in #56 (comment), or even replace it with println!("cargo:rustc-link-lib=vulkan"); to be able to build-test this crate on non-Mac (even though that's trivial and part of core ash now).

@eddyb
Copy link
Contributor Author

eddyb commented Oct 4, 2022

Heh, this "bug"(?) made testing my PR (#71) easier, and I could see the appeal.
We could maybe at least emit a cargo:warning= with a message like "this crate doesn't do anything outside of macOS/iOS".

Oh but Cargo isn't printing those for dependencies by default. Maybe the exported function could just panic at runtime?

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 a pull request may close this issue.

2 participants