-
Notifications
You must be signed in to change notification settings - Fork 5
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
Allow non IOS builds (for our dev tools) #1
Comments
Hi! Sorry for the late response, clearly something is wrong with my github notifications.
Hmm. I suppose that could be done. It will just produce an empty lib. I'm curious how it breaks your development tools. |
@simlay Oh I don't have the error on hand (I decided against using rust for this purpose). But form looking at my snippet, you can see that it'll panic (see the line fn main() {
let target = std::env::var("TARGET").unwrap();
if !target.contains("apple-ios") {
panic!("uikit-sys requires the ios target");
}
let directory = sdk_path(&target).ok();
build(directory.as_ref().map(String::as_ref), &target);
} This will cause the build to fail and therefore your rust development tools will report an error. Regarding
This isn't necessarily any better, because as soon as you try to reference something from the library, you'll get an undefined error (and obviously no autocomplete). What you want is to produce the same symbols as just stubs that fail when you try to call such at runtime. This is (if I can recall correctly) what the WASM bindgen team does. Update: for an example, running Compiling uikit-sys v0.0.1 (/Users/colbyn/Scratch/uikit-sys)
error: failed to run custom build command for `uikit-sys v0.0.1 (/Users/colbyn/Scratch/uikit-sys)`
Caused by:
process didn't exit successfully: `/Users/colbyn/Scratch/uikit-sys/target/debug/build/uikit-sys-0d40961a6e9dc9ce/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'uikit-sys requires the ios target', build.rs:85:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace |
This check in build.rs breaks my development tools.
I.e.
!target.contains("apple-ios")
in:I believe the rust wasm bindgen team just implemented stubs for non WebAssembly targets. Can this library do the same?
The text was updated successfully, but these errors were encountered: