-
-
Notifications
You must be signed in to change notification settings - Fork 183
-Werror=unguarded-availability-new
in sysconfig prevents building of watchdog
#210
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
Comments
Assuming you are trying to build watchdog binaries that work on macOS <10.13, this compiler error is absolutely finding a bug in watchdog where it is failing to conditionally guard symbols not available in older macOS versions! On one hand I consider this a feature: we're preventing bugs! On the other, we are inserting I think it is reasonable to strip this - and other custom - compiler flag from the sysconfig data to maintain compatibility with CPython. |
Is this roughly: add some additional replacements to (Do we also need to strip from |
Yeah, this is a modification to It looks like the flag is present in the following:
I'd have to look at which variables are used by Python build tools to propagate compiler flags: those are the ones we want to modify. I'm hesitant to modify flags that denote how the Python distribution itself was built: that would constitute lying. But if a variable is overloaded to both reflect what was used and what to use, then I suppose we must modify it. |
I'm encountering this error when trying to use uv-managed Python to develop Google Cloud Functions (functions-framework depends on watchdog) |
At least in if 'CC' in os.environ:
newcc = os.environ['CC']
if 'LDSHARED' not in os.environ and ldshared.startswith(cc):
# If CC is overridden, use that as the default
# command for LDSHARED as well
ldshared = newcc + ldshared[len(cc) :]
cc = newcc
if 'CXX' in os.environ:
cxx = os.environ['CXX']
if 'LDSHARED' in os.environ:
ldshared = os.environ['LDSHARED']
if 'CPP' in os.environ:
cpp = os.environ['CPP']
else:
cpp = cc + " -E" # not always
if 'LDFLAGS' in os.environ:
ldshared = ldshared + ' ' + os.environ['LDFLAGS']
if 'CFLAGS' in os.environ:
cflags = cflags + ' ' + os.environ['CFLAGS']
ldshared = ldshared + ' ' + os.environ['CFLAGS']
if 'CPPFLAGS' in os.environ:
cpp = cpp + ' ' + os.environ['CPPFLAGS']
cflags = cflags + ' ' + os.environ['CPPFLAGS']
ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
if 'AR' in os.environ:
ar = os.environ['AR']
if 'ARFLAGS' in os.environ:
archiver = ar + ' ' + os.environ['ARFLAGS']
else:
archiver = ar + ' ' + ar_flags So, that would be |
admittedly this is pointing out a real warning in
watchdog
-- but it makes it not installable using specifically these pythons:output:
a workaround is to remove that flag from
_sysconfigdata__darwin_darwin.py
after unpackingThe text was updated successfully, but these errors were encountered: