-
Notifications
You must be signed in to change notification settings - Fork 182
macosx platform tag do not support minor bugfix release #317
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
Changes from 5 commits
3e213af
1a907d3
0dd9f3e
25c8fb6
80eac7b
b1f3999
496c5c6
b66add5
0570084
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -115,15 +115,15 @@ def calculate_macosx_platform_tag(archive_root, platform_tag): | |
| """ | ||
| prefix, base_version, suffix = platform_tag.split('-') | ||
| base_version = tuple([int(x) for x in base_version.split(".")]) | ||
| if len(base_version) == 2: | ||
| base_version = base_version + (0,) | ||
| if len(base_version) >= 2: | ||
| base_version = base_version[0:2] | ||
|
|
||
| assert len(base_version) == 3 | ||
| assert len(base_version) == 2 | ||
| if "MACOSX_DEPLOYMENT_TARGET" in os.environ: | ||
| deploy_target = tuple([int(x) for x in os.environ[ | ||
| "MACOSX_DEPLOYMENT_TARGET"].split(".")]) | ||
| if len(deploy_target) == 2: | ||
| deploy_target = deploy_target + (0,) | ||
| if len(deploy_target) >= 2: | ||
| deploy_target = deploy_target[0:2] | ||
| if deploy_target < base_version: | ||
| sys.stderr.write( | ||
| "[WARNING] MACOSX_DEPLOYMENT_TARGET is set " | ||
|
|
@@ -132,24 +132,22 @@ def calculate_macosx_platform_tag(archive_root, platform_tag): | |
| else: | ||
| base_version = deploy_target | ||
|
|
||
| assert len(base_version) == 3 | ||
| assert len(base_version) == 2 | ||
| start_version = base_version | ||
| versions_dict = {} | ||
| for (dirpath, dirnames, filenames) in os.walk(archive_root): | ||
| for filename in filenames: | ||
| if filename.endswith('.dylib') or filename.endswith('.so'): | ||
| lib_path = os.path.join(dirpath, filename) | ||
| versions_dict[lib_path] = extract_macosx_min_system_version(lib_path) | ||
| min_ver = extract_macosx_min_system_version(lib_path) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the last field of the version tuple is irrelevant to the compatibility question? If so, should it be moved up here i.e.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It need changes in more places. I push this changes in separate commit.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| if min_ver is not None: | ||
| versions_dict[lib_path] = min_ver[0:2] | ||
|
|
||
| if len(versions_dict) > 0: | ||
| base_version = max(base_version, max(versions_dict.values())) | ||
|
|
||
| if base_version[-1] == 0: | ||
| fin_base_version = base_version[:-1] | ||
| else: | ||
| fin_base_version = base_version | ||
|
|
||
| fin_base_version = "_".join([str(x) for x in fin_base_version]) | ||
| # macosx platform tag do not support minor bugfix release | ||
| fin_base_version = "_".join([str(x) for x in base_version]) | ||
| if start_version < base_version: | ||
| problematic_files = [k for k, v in versions_dict.items() if v > start_version] | ||
| problematic_files = "\n".join(problematic_files) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the information we lose here is not important? There's never an important difference between e.g.
10.14.0and10.14.2?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I'm wondering if we should work with full 3-part versions to make all checks, and only cut off the last version later, when creating the tag string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this option is only valid with major and a minor version numbers
Apologies for old docs, it's all I can find atm
https://developer.apple.com/library/archive/documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-SW129
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, yes, the documentation on this is so crappy that except for that old version of Apple's docs, all I can seem to find is a bunch of SO questions and issues/PRs on GitHub :-|
I was mainly looking at https://stackoverflow.com/a/25362535 where
10.3.9is mentioned, but I can't find that anywhere else (also tried the man page on a mac I have access to; doesn't show the same message anymore).It's also quite funny that the versions in the
dylibs are stored asx.y.z, then? (cfr.wheel/wheel/macosx_libfile.py
Lines 345 to 350 in fcd78f3
At any rate, maybe the value from the environment variable should be checked, then, to make sure it only contains 2 or 3 parts and not more or less? This is some for of user input, after all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whether or not the bugfix might contain relevant information, the platform_tag in Python considers all bugfix releases within the same minor release of macOS as equivalent.
I tend to agree with this, FWIW. I ran a regex on the macOS 10.15 SDK and I can't find any APIs that specify a macOS version to the bugfix release.
Speculating, I think that sometimes Apple do bugfix releases to target new hardware, and those would require such a detailed version string. But I don't think it's used when building against the public SDK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, nice find! Better ignore it then, and have a bit of consistency :-)