aarch64 OBJC_OLD_DISPATCH_PROTOTYPES=1 ignored
- Dominant language
- JavaScript
- Stars
- 2k
- Forks
- 179
- PR merge metrics
- No merged PRs in 30d
Description
Hi, I'm trying to build a hello world level app using web-view. Builds perfectly on amd64 Linux. On the aarch64 apple m1, I'm running into issues even building.
I did some digging into `OBJC_OLD_DISPATCH_PROTOTYPES=1` and `build.rs` and see you're already using the right flag to activate the old prototype that took three args. I'm confused why this is happening and wondering if this is an aarch64-specific issue? I tried setting `CFLAGS_arch64_apple_darwin` to `-DOBJC_OLD_DISPATCH_PROTOTYPES=1` but this probably had no effect since you do this already in `build.rs`. I did `-ferror-limit=0` for kicks and got to about 120 errors, so I'm clearly busted. I also tried setting `-framework WebKit` just to see if there was something around that. Also nothing.
If you have any suggestions on a fix, or if you know this is just my environment, I'd appreciate the info.
Build error below:
```
Caused by:
process didn't exit successfully: `~/server/target/debug/build/webview-sys-5d6f4b20218f03fb/build-script-build` (exit status: 1)
--- stdout
cargo:rustc-link-lib=framework=Cocoa
cargo:rustc-link-lib=framework=WebKit
TARGET = Some("aarch64-apple-darwin")
OPT_LEVEL = Some("0")
HOST = Some("aarch64-apple-darwin")
CC_aarch64-apple-darwin = None
CC_aarch64_apple_darwin = None
HOST_CC = None
CC = None
CFLAGS_aarch64-apple-darwin = None
CFLAGS_aarch64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
CARGO_CFG_TARGET_FEATURE = Some("aes,crc,crypto,dpb,fcma,fp,fp16,jsconv,lse,neon,ras,rcpc,rdm,sha2,v8.1a,v8.2a,v8.3a")
CC_aarch64-apple-darwin = None
CC_aarch64_apple_darwin = None
HOST_CC = None
CC = None
CFLAGS_aarch64-apple-darwin = None
CFLAGS_aarch64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
CARGO_CFG_TARGET_FEATURE = Some("aes,crc,crypto,dpb,fcma,fp,fp16,jsconv,lse,neon,ras,rcpc,rdm,sha2,v8.1a,v8.2a,v8.3a")
CC_aarch64-apple-darwin = None
CC_aarch64_apple_darwin = None
HOST_CC = None
CC = None
CFLAGS_aarch64-apple-darwin = None
CFLAGS_aarch64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
CARGO_CFG_TARGET_FEATURE = Some("aes,crc,crypto,dpb,fcma,fp,fp16,jsconv,lse,neon,ras,rcpc,rdm,sha2,v8.1a,v8.2a,v8.3a")
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-arch" "arm64" "-I" "webview.h" "-Wall" "-Wextra" "-x" "objective-c" "-std=c11" "-w" "-DDEBUG" "-DOBJC_OLD_DISPATCH_PROTOTYPES=1" "-o" "~/server/target/debug/build/webview-sys-90d3225d97425bce/out/webview_cocoa.o" "-c" "webview_cocoa.c"
. . . loads of errors related to the objc_msgSend signature. . .
cargo:warning=webview_cocoa.c:185:43: error: too many arguments to function call, expected 0, have 2
cargo:warning= id path = objc_msgSend(url, sel_registerName("path"));
cargo:warning= ~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cargo:warning=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/message.h:63:1: note: 'objc_msgSend' declared here
cargo:warning=objc_msgSend(void /* id self, SEL op, ... */ )
cargo:warning=^
cargo:warning=webview_cocoa.c:181:16: error: too many arguments to function call, expected 0, have 3
cargo:warning= objc_msgSend(savePanel, sel_registerName("beginWithCompletionHandler:"),
cargo:warning= ~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cargo:warning=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/message.h:63:1: note: 'objc_msgSend' declared here
cargo:warning=objc_msgSend(void /* id self, SEL op, ... */ )
cargo:warning=^
cargo:warning=fatal error: too many errors emitted, stopping now [-ferror-limit=]
cargo:warning=20 errors generated.
exit status: 1
--- stderr
error occurred: Command "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-arch" "arm64" "-I" "webview.h" "-Wall" "-Wextra" "-x" "objective-c" "-std=c11" "-w" "-DDEBUG" "-DOBJC_OLD_DISPATCH_PROTOTYPES=1" "-o" "~/server/target/debug/build/webview-sys-90d3225d97425bce/out/webview_cocoa.o" "-c" "webview_cocoa.c" with args "cc" did not execute successfully (status code exit status: 1).
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with build.rs and webview_cocoa.c, then reproduce the reported aarch64-apple-darwin build using the logged compiler command. Compare the arm64 Objective-C message declarations with the existing OBJC_OLD_DISPATCH_PROTOTYPES=1 handling. Done means the example builds successfully on Apple M1 without the objc_msgSend signature errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- objective-c, rust
- Domain
- build-system, desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100