swiftlang / swift-corelibs-foundation

The Foundation Project, providing core utilities, internationalization, and OS independence
swift.org
Apache License 2.0
5.29k stars 1.13k forks source link

CFPlatform.c:2214:10: error: call to undeclared function 'posix_spawn_file_actions_addchdir_np' #4762

Open tshortli opened 1 year ago

tshortli commented 1 year ago

Foundation is currently failing to build on Ubuntu:

/home/build-user/swift-corelibs-foundation/CoreFoundation/Base.subproj/CFPlatform.c:2214:10: error: call to undeclared function 'posix_spawn_file_actions_addchdir_np'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  return posix_spawn_file_actions_addchdir_np((posix_spawn_file_actions_t *)file_actions, path);
         ^
1 error generated.

https://ci.swift.org/job/oss-swift-RA-linux-ubuntu-18_04/4169/console

tshortli commented 1 year ago

@Lukasa looks like this may be fallout from https://github.com/apple/swift-corelibs-foundation/pull/4606, could you take a look?

Lukasa commented 1 year ago

The merged PR requires glibc 2.29, but Ubuntu Bionic ships with 2.27. I don't really know what we should do really, the feature simply doesn't work without it.

Lukasa commented 1 year ago

We can revert and keep a fallback to keep the current behaviour if we need to, I suppose.

Lukasa commented 1 year ago

The way we'd add the fallback is to add a way to query the support, which can be implemented using __GLIBC__ and __GLIBC_MINOR__ macros.

tomerd commented 1 year ago

querying + fallback seems reasonable

Lukasa commented 1 year ago

@MaxDesiatov Do you have any bandwidth to do this?

MaxDesiatov commented 1 year ago

I'll have a look, __GLIBC_MINOR__ check makes sense to me.

al45tair commented 1 year ago

This is blocking the nightly builds, FWIW.