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

darwin: pthread/spawn.h gives unknown type name 'qos_class_t' #62555

Open
matthewbauer opened this issue Jun 3, 2019 · 2 comments
Open

darwin: pthread/spawn.h gives unknown type name 'qos_class_t' #62555

matthewbauer opened this issue Jun 3, 2019 · 2 comments
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: darwin Running or building packages on Darwin

Comments

@matthewbauer
Copy link
Member

matthewbauer commented Jun 3, 2019

Issue description

When updating to Bazel 0.26, an #include <pthread/spawn.h> is added to blaze_util_darwin.cc. This results in darwin: pthread/spawn.h gives unknown type name. A workaround is used by including dispatch/dispatch.h instead.

This is the log:

In file included from src/main/cpp/blaze_util_darwin.cc:24:
/nix/store/mffyf74zc4h2wic5lwx0kyx7gvwif0c5-Libsystem-osx-10.12.6/include/pthread/spawn.h:65:34: error: unknown type name 'qos_class_t'; did you mean 'au_class_t'?
                                 qos_class_t __qos_class);
                                 ^
/nix/store/mffyf74zc4h2wic5lwx0kyx7gvwif0c5-Libsystem-osx-10.12.6/include/bsm/audit.h:176:19: note: 'au_class_t' declared here
typedef u_int32_t       au_class_t;
                        ^
In file included from src/main/cpp/blaze_util_darwin.cc:24:
/nix/store/mffyf74zc4h2wic5lwx0kyx7gvwif0c5-Libsystem-osx-10.12.6/include/pthread/spawn.h:88:34: error: unknown type name 'qos_class_t'; did you mean 'au_class_t'?
                                 qos_class_t * __restrict __qos_class);
                                 ^
/nix/store/mffyf74zc4h2wic5lwx0kyx7gvwif0c5-Libsystem-osx-10.12.6/include/bsm/audit.h:176:19: note: 'au_class_t' declared here
typedef u_int32_t       au_class_t;
                        ^
2 errors generated.

Tried to reproduce this with:

#include <sys/types.h>
#include <sys/resource.h>
#include <sys/sysctl.h>
#include <sys/socket.h>
#include <sys/un.h>

#include <libproc.h>
#include <pthread/spawn.h>
#include <signal.h>
#include <spawn.h>
#include <stdlib.h>
#include <unistd.h>

#include <cerrno>
#include <cstdio>
#include <cstring>

int ConfigureDaemonProcess(posix_spawnattr_t *attrp) {
  return posix_spawnattr_set_qos_class_np(attrp, QOS_CLASS_DEFAULT);
}

but did not get the same error! Need to investigate it further.

@veprbl veprbl added the 6.topic: darwin Running or building packages on Darwin label Jun 6, 2019
@lilyball
Copy link
Member

This sounds very strange; I just tested myself and clang -E pthread/spawn.h with the appropriate system directories set up does declare qos_class_t prior to any uses of it. All I can figure out is that (prior to including the headers) defining _ANSI_SOURCE or _POSIX_C_SOURCE (or defining _XOPEN_SOURCE with a value of 500L or greater) could cause this behavior, except I see no reason why any of these would be defined.

@stale
Copy link

stale bot commented Jun 2, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: darwin Running or building packages on Darwin
Projects
None yet
Development

No branches or pull requests

3 participants