mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
gh-113119: Fix the macOS framework installer build (#113268)
`--enable-framework` builds were failing. we apparently do not have good CI & buildbot coverage here.
This commit is contained in:
parent
893c9ccf48
commit
c895403de0
1 changed files with 10 additions and 1 deletions
|
@ -1557,6 +1557,7 @@ error:
|
||||||
** man environ(7).
|
** man environ(7).
|
||||||
*/
|
*/
|
||||||
#include <crt_externs.h>
|
#include <crt_externs.h>
|
||||||
|
#define USE_DARWIN_NS_GET_ENVIRON 1
|
||||||
#elif !defined(_MSC_VER) && (!defined(__WATCOMC__) || defined(__QNX__) || defined(__VXWORKS__))
|
#elif !defined(_MSC_VER) && (!defined(__WATCOMC__) || defined(__QNX__) || defined(__VXWORKS__))
|
||||||
extern char **environ;
|
extern char **environ;
|
||||||
#endif /* !_MSC_VER */
|
#endif /* !_MSC_VER */
|
||||||
|
@ -1579,7 +1580,7 @@ convertenviron(void)
|
||||||
through main() instead of wmain(). */
|
through main() instead of wmain(). */
|
||||||
(void)_wgetenv(L"");
|
(void)_wgetenv(L"");
|
||||||
e = _wenviron;
|
e = _wenviron;
|
||||||
#elif defined(WITH_NEXT_FRAMEWORK) || (defined(__APPLE__) && defined(Py_ENABLE_SHARED))
|
#elif defined(USE_DARWIN_NS_GET_ENVIRON)
|
||||||
/* environ is not accessible as an extern in a shared object on OSX; use
|
/* environ is not accessible as an extern in a shared object on OSX; use
|
||||||
_NSGetEnviron to resolve it. The value changes if you add environment
|
_NSGetEnviron to resolve it. The value changes if you add environment
|
||||||
variables between calls to Py_Initialize, so don't cache the value. */
|
variables between calls to Py_Initialize, so don't cache the value. */
|
||||||
|
@ -7166,7 +7167,15 @@ py_posix_spawn(int use_posix_spawnp, PyObject *module, path_t *path, PyObject *a
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef USE_DARWIN_NS_GET_ENVIRON
|
||||||
|
// There is no environ global in this situation.
|
||||||
|
char **environ = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (env == Py_None) {
|
if (env == Py_None) {
|
||||||
|
#ifdef USE_DARWIN_NS_GET_ENVIRON
|
||||||
|
environ = *_NSGetEnviron();
|
||||||
|
#endif
|
||||||
envlist = environ;
|
envlist = environ;
|
||||||
} else {
|
} else {
|
||||||
envlist = parse_envlist(env, &envc);
|
envlist = parse_envlist(env, &envc);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue