#1313·memcached

Build failure on macOS 27 due to process sandbox deprecation

Author: ZhongRuoyuCreated Sep 10, 2026Updated Sep 10, 2026

Describe the bug

On macOS 27, build fails with:

darwin_priv.c:17:22: error: use of undeclared identifier 'kSBXProfileNoInternet'
   17 |     if (sandbox_init(kSBXProfileNoInternet, SANDBOX_NAMED, &error) < 0) {
      |                      ^~~~~~~~~~~~~~~~~~~~~
1 error generated.

This is because the sandbox_init profile kSBXProfileNoInternet (and other profiles too) has been removed in the macOS SDK in Xcode 27.

For your reference, below is the sandbox.h from Xcode 27's /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sandbox.h.

sandbox.h
c
/*
 * Copyright (c) 2006-2011,2018 Apple Inc. All rights reserved.
 */


/*
 * This header is deprecated and may be removed in a future release.
 * Developers who wish to sandbox an app should instead adopt the App Sandbox
 * feature described in the App Sandbox Design Guide.
 */


#ifndef _SANDBOX_H_
#define _SANDBOX_H_

#include <os/availability.h>
#include <os/base.h>
#include <stdint.h>
#include <sys/cdefs.h>

__BEGIN_DECLS

/*
 * @function sandbox_init
 * Places the current process in a sandbox with a profile as
 * specified.  If the process is already in a sandbox, the new profile
 * is ignored and sandbox_init() returns an error.
 *
 * @param profile (input)   The Sandbox profile to be used.  The format
 * and meaning of this parameter is modified by the `flags' parameter.
 *
 * @param flags (input)   Must be SANDBOX_NAMED.  All other
 * values are reserved.
 *
 * @param errorbuf (output)   In the event of an error, sandbox_init
 * will set `*errorbuf' to a pointer to a NUL-terminated string
 * describing the error. This string may contain embedded newlines.
 * This error information is suitable for developers and is not
 * intended for end users.
 *
 * If there are no errors, `*errorbuf' will be set to NULL.  The
 * buffer `*errorbuf' should be deallocated with `sandbox_free_error'.
 *
 * @result 0 on success, -1 otherwise.
 */
API_DEPRECATED("No longer supported", macos(10.5, 10.8), ios(2.0, 6.0), tvos(4.0, 4.0), watchos(1.0, 1.0))
API_UNAVAILABLE(macCatalyst)
OS_WARN_RESULT
int sandbox_init(const char *profile, uint64_t flags, char **errorbuf);

/*
 * @define SANDBOX_NAMED  The `profile' argument specifies a Sandbox
 * profile named by one of the kSBXProfile* string constants.
 */
#define SANDBOX_NAMED		0x0001

/*
 * @function sandbox_free_error
 * Deallocates an error string previously allocated by sandbox_init.
 *
 * @param errorbuf (input)   The buffer to be freed.  Must be a pointer
 * previously returned by sandbox_init in the `errorbuf' argument, or NULL.
 *
 * @result void
 */
API_DEPRECATED("No longer supported", macos(10.5, 10.8), ios(2.0, 6.0), tvos(4.0, 4.0), watchos(1.0, 1.0))
API_UNAVAILABLE(macCatalyst)
void sandbox_free_error(char *errorbuf);

__END_DECLS

#endif /* _SANDBOX_H_ */

To Reproduce

  • ./configure --disable-coverage --enable-tls --disable-debug --disable-dependency-tracking --prefix=/opt/homebrew/Cellar/memcached/1.6.45 --libdir=/opt/homebrew/Cellar/memcached/1.6.45/lib
  • make install
  • See error

System Information

  • OS/Distro: macOS
  • Version of OS/distro: macOS 27.0 Golden Gate RC
  • Version of memcached: 1.6.45
  • Hardware detail: arm64

Detail (please include!)

This was discovered while building memcached on macOS 27 for Homebrew. Full build logs: https://github.com/Homebrew/homebrew-core/actions/runs/34467537715/job/102839842253 Formula (package) definition: https://github.com/Homebrew/homebrew-core/blob/8de45ce0827cdc8a0edd069efcf48a1dda35a9f8/Formula/m/memcached.rb