Skip to content

Conversation

@Nirlah
Copy link
Contributor

@Nirlah Nirlah commented Nov 16, 2025

Regressed in the Zig 0.15 upgrade.

Not sure how the mentioned test passed, can it be specific for macOS 26?
On my machine (macOS 15), calling msgSendSuper fails to compile without this fix.

Regressed in the Zig 0.15 upgrade.
@Nirlah
Copy link
Contributor Author

Nirlah commented Nov 16, 2025

Ok, it fails on the CI environment.
Alongside the header itself, the docs do not mention any change.

Can it be related to something specific to the CI testing environment?

@Nirlah
Copy link
Contributor Author

Nirlah commented Nov 16, 2025

I don’t have experience with using nix, but from my understanding it depends on gnustep-libobjc.

Maybe this can help:
https://github.com/gnustep/libobjc2/blob/7a5114deff221c58b19ce2b18245ab13aac33295/objc/runtime.h#L105

@LaDorade
Copy link

LaDorade commented Dec 30, 2025

same issue with native build on my machine 🫡 (Zig version: 0.15.2
but working with nix develop: Zig version 0.15.1
but no clue if this matter

@amitayas
Copy link

amitayas commented Jan 19, 2026

The correct field is super_class.
The test fails because it is being linked against a very old SDK (MacOSX11.3)

The class field was removed after SDK 12.3, which still has

#if !defined(__cplusplus)  &&  !__OBJC2__
    /* For compatibility with old objc-runtime.h header */
    __unsafe_unretained _Nonnull Class class;
#else
    __unsafe_unretained _Nonnull Class super_class;
#endif

The Objective-C runtime headers(objc/message.h) on my system(macOS Tahoe 26.2) define struct objc_super as

/// Specifies the superclass of an instance. 
struct objc_super {
    /// Specifies an instance of a class.
    __unsafe_unretained _Nonnull id receiver;

    /// Specifies the particular superclass of the instance to message. 
    __unsafe_unretained _Nonnull Class super_class;

    /* super_class is the first class to search */
};
#endif

IMO, changing the field from class to super_class would be the correct, simplest fix.

EDIT:
Seems like __OBJC2__ is not set for 32 bit platforms, so maybe conditionally support both shapes if the goal is to support both architectures?

@mitchellh
Copy link
Owner

Seems like OBJC2 is not set for 32 bit platforms, so maybe conditionally support both shapes if the goal is to support both architectures?

I don't think there's any 32-bit Apple targets left so not worth it.

I think fixing CI to link newer headers should fix this and we can merge it up. :)

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.

4 participants