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

bpo-42504: fix for MACOSX_DEPLOYMENT_TARGET=11 #23556

Open
wants to merge 1 commit into
base: master
from

Conversation

@fxcoudert
Copy link

@fxcoudert fxcoudert commented Nov 29, 2020

This pull request provides a fix for https://bugs.python.org/issue42504

https://bugs.python.org/issue42504

@the-knights-who-say-ni
Copy link

@the-knights-who-say-ni the-knights-who-say-ni commented Nov 29, 2020

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@fxcoudert

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@fxcoudert
Copy link
Author

@fxcoudert fxcoudert commented Nov 29, 2020

I have now signed the CLA

@lewisrobbins
Copy link

@lewisrobbins lewisrobbins commented Nov 29, 2020

Looks good to me 👍

Copy link
Member

@ned-deily ned-deily left a comment

Thanks for the PR. There is more work to be done, though. With:

MACOSX_DEPLOYMENT_TARGET=11 ./configure

making this change in setup.py gets past the first error only to fail later in distutils/spawn.py:

  File "source/Lib/distutils/spawn.py", line 66, in spawn
    if _cfg_target_split > [int(x) for x in cur_target.split('.')]:
TypeError: '>' not supported between instances of 'NoneType' and 'list'

Are there other users of MACOSX_DEPLOYMENT_TARGET in the source that need to be changed as well?

@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Nov 30, 2020

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@ronaldoussoren
Copy link
Contributor

@ronaldoussoren ronaldoussoren commented Nov 30, 2020

A nicer fix is to ensure that sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') evaluates to a string. I haven't checked how easy it would be to do this.

@fxcoudert
Copy link
Author

@fxcoudert fxcoudert commented Nov 30, 2020

@ronaldoussoren the code at https://github.com/python/cpython/blob/3.9/Lib/sysconfig.py#L461 shows it's very deliberate that int-type values are returned as int

@fxcoudert
Copy link
Author

@fxcoudert fxcoudert commented Nov 30, 2020

Two places I am not 100% sure what to do:

@fxcoudert
Copy link
Author

@fxcoudert fxcoudert commented Nov 30, 2020

I have made the requested changes; please review again.
I have confirmed that this makes the formula build on 11.0 when setting MACOSX_DEPLOYMENT_TARGET=11 (https://github.com/Homebrew/homebrew-core/pull/65933/checks?check_run_id=1473199510)


Travis is telling me:

Fixing Python file whitespace ... 1 file:
  Lib/test/test_posix.py

but I haven't changed whitespace in this file, and it is not telling me what the issue actually is.

@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Nov 30, 2020

Thanks for making the requested changes!

@ned-deily: please review the changes made to this pull request.

@bedevere-bot bedevere-bot requested a review from ned-deily Nov 30, 2020
Copy link
Member

@ned-deily ned-deily left a comment

Thanks for the changes. Running test_distutils:
./python(.exe) -m test -w test_distutils

gives a number of failing test cases, basically due to one of two problems.

  1. The missing str() at spawn.py:66

  2. Failures in test_build_ext.py:501:

File "source/Lib/distutils/tests/test_build_ext.py", line 501, in _try_compile_deployment_target
    target = '%02d%02d00' % target
TypeError: not enough arguments for format string

I don't think we need to make any changes to configure.ac or build_installer.py.

@@ -57,7 +57,7 @@ def spawn(cmd, search_path=1, verbose=0, dry_run=0):
_cfg_target = sysconfig.get_config_var(
'MACOSX_DEPLOYMENT_TARGET') or ''
if _cfg_target:
_cfg_target_split = [int(x) for x in _cfg_target.split('.')]
_cfg_target_split = [int(x) for x in str(_cfg_target).split('.')]

This comment has been minimized.

@ned-deily

ned-deily Dec 1, 2020
Member

A similar change is needed below at line 66.

@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Dec 1, 2020

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@fxcoudert fxcoudert mentioned this pull request Dec 1, 2020
0 of 2 tasks complete
@fxcoudert fxcoudert force-pushed the fxcoudert:patch-1 branch from cd26ccb to 884add1 Dec 1, 2020
@fxcoudert
Copy link
Author

@fxcoudert fxcoudert commented Dec 1, 2020

I have made the requested changes; please review again.
There is still a whitespace failure about Lib/test/test_posix.py, but I haven't changed whitespace. I've ran make patchcheck but it fails, maybe I'm not doing it properly.

@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Dec 1, 2020

Thanks for making the requested changes!

@ned-deily: please review the changes made to this pull request.

@nilleb
Copy link

@nilleb nilleb commented Dec 1, 2020

I think there is one more occurrence to fix at subprocess.py line 1739: (👇 this is the fixed version)

                                val = os.fsencode(str(v))

because v is an environment variable value, and integers are not acceptable input values for os.fsencode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

8 participants
You can’t perform that action at this time.