macosx platform tag do not support minor bugfix release#317
Conversation
Codecov Report
@@ Coverage Diff @@
## master #317 +/- ##
==========================================
+ Coverage 64.89% 65.13% +0.24%
==========================================
Files 13 13
Lines 997 1001 +4
==========================================
+ Hits 647 652 +5
+ Misses 350 349 -1
Continue to review full report at Codecov.
|
|
The tests passed before though – is there any way to add a regression test for this? |
f30ecb3 to
1a907d3
Compare
|
Ok. I build proper dylib file and add tests for regression. |
test file is from delocate project
|
I found that during refactor of code I remove handling of I cannot create proper test file but I found such in |
joerick
left a comment
There was a problem hiding this comment.
Hello @agronholm and @Czaki , I took a look at this just now and have a few comments - I hope it's helpful!
| 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) |
There was a problem hiding this comment.
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. min_ver = min_ver[0:2]
There was a problem hiding this comment.
It need changes in more places. I push this changes in separate commit.
|
@Czaki so do you consider this ready for merging or do you need to make more changes still? |
| if len(deploy_target) == 2: | ||
| deploy_target = deploy_target + (0,) | ||
| if len(deploy_target) >= 2: | ||
| deploy_target = deploy_target[0:2] |
There was a problem hiding this comment.
So the information we lose here is not important? There's never an important difference between e.g. 10.14.0 and 10.14.2?
There was a problem hiding this comment.
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.
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.
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.9 is 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 as x.y.z, then? (cfr.
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.
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.
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.
OK, nice find! Better ignore it then, and have a bit of consistency :-)
|
Please note that some python packaging projects (like pip) are planning to (or already) use https://github.com/pypa/packaging/blob/master/packaging/tags.py so most improvements would need to be replicated there. |
|
I would be thrilled if I could throw out the |
remove unused class
|
Last 6 days I was out of internet. Thanks @YannickJadoul for review and especially for language mistakes. @agronholm In this moment I do not see any contradictions to merge. The only thing about I think is if using |
|
Thanks! |
I found that python does not support information about bugfix release of macosx, so adding information about third nonzero value from tuple version create wheel which can not be installed. Example here. The example is created with MACOSX_DEPLOYMENT_TARGET setted to "10.9".
Then I think that removing this information is best idea. Then it may occurs that platform tag suggest that wheel should run, but increasing major version of system is bad idea for me.