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

meson: Pass -D_DARWIN_C_SOURCE on darwin #567

Merged
merged 1 commit into from
Dec 10, 2023

Conversation

bobby285271
Copy link
Contributor

@bobby285271 bobby285271 commented Dec 10, 2023

This is probably a follow-up for 02ee2d0 ("fix macos build") and unbreaks the build on Nixpkgs x86_64-darwin. I don't know why, probably due to using even older SDKs? 🙃

https://github.com/NixOS/nixpkgs/runs/19486840382
https://logs.ofborg.org/?key=nixos/nixpkgs.273297&attempt_id=05115a28-17b2-4d53-b0e9-d6c2f6a02b63

> In file included from ../src/as-system-info.c:60:
> In file included from /nix/store/51c1k4sj0irwgyvkgbyhqi0ggilyh3j2-Libsystem-1238.60.2/include/sys/sysctl.h:83:
> /nix/store/51c1k4sj0irwgyvkgbyhqi0ggilyh3j2-Libsystem-1238.60.2/include/sys/ucred.h:91:2: error: unknown type name 'u_long'
>         u_long  cr_ref;                 /* reference count */
>         ^
> 1 error generated.
> ninja: build stopped: subcommand failed.

Update: Instead of adding another typedef, apply the suggestions on pull request 556 to pass -D_DARWIN_C_SOURCE, which seems to work fine for us too.

@bobby285271 bobby285271 marked this pull request as draft December 10, 2023 13:02
@bobby285271
Copy link
Contributor Author

bobby285271 commented Dec 10, 2023

Oh I just saw #556 (comment), give me a few sec to try...

Update: Seems to work!

This is probably a follow-up for 02ee2d0 ("fix macos build")
and unbreaks the build on Nixpkgs x86_64-darwin, probably due to
using even older SDKs?

https://github.com/NixOS/nixpkgs/runs/19486840382

```
> In file included from ../src/as-system-info.c:60:
> In file included from /nix/store/51c1k4sj0irwgyvkgbyhqi0ggilyh3j2-Libsystem-1238.60.2/include/sys/sysctl.h:83:
> /nix/store/51c1k4sj0irwgyvkgbyhqi0ggilyh3j2-Libsystem-1238.60.2/include/sys/ucred.h:91:2: error: unknown type name 'u_long'
>         u_long  cr_ref;                 /* reference count */
>         ^
> 1 error generated.
> ninja: build stopped: subcommand failed.
```

Instead of adding another typedef, apply the suggestions on pull
request 556 to pass `-D_DARWIN_C_SOURCE`, which seems to work fine
for us too.
@bobby285271 bobby285271 force-pushed the wip/bobby285271/macos-build branch from cb7701e to e0223cf Compare December 10, 2023 13:23
@bobby285271 bobby285271 changed the title as-system-info: Fix unknown type name 'u_long' on macos meson: Pass -D_DARWIN_C_SOURCE on darwin Dec 10, 2023
@bobby285271 bobby285271 marked this pull request as ready for review December 10, 2023 13:24
@ximion ximion merged commit ccf292f into ximion:main Dec 10, 2023
10 checks passed
@ximion
Copy link
Owner

ximion commented Dec 10, 2023

Awesome, thanks for the patch! This feels like a much better solution than the previous type redefinitions.

@bobby285271 bobby285271 deleted the wip/bobby285271/macos-build branch December 10, 2023 15:50
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.

2 participants