[glib, fltk, cairo, python3] Sequence of adjustments for windows and macos#9593
[glib, fltk, cairo, python3] Sequence of adjustments for windows and macos#9593magicfoo wants to merge 6 commits intomicrosoft:masterfrom
Conversation
8706849 to
a36a356
Compare
+ Fix compilation issues with Xcode 11.3 (catalina)
+ Fix build issues on macos
|
Interesting to see that the original order of the commits in this stack is displayed differently here. I don't guarantee a random order will build properly. Preferably, glib < cairo < fltk < fluid < python < yaml. |
|
/azp run |
ports/python3/portfile.cmake
Outdated
There was a problem hiding this comment.
Could you please merge the code in two 'if (VCPKG_LIBRARY_LINKAGE STREQUAL static)' ?
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
0001-Static-library.patch
0003-Fix-header-for-static-linkage.patch
0004-Remove-linktime-global-optimization.patch
)
endif()
There was a problem hiding this comment.
Same as above, function is deprecated, please use a symbol which resolves to an empty string when not necessary
There was a problem hiding this comment.
0002 collides with 0001 and 0004, so it can't be re-ordered. That said, it is not easy to dissociate the CRT and LIB mode patches. Also, keeping this granularity could be great. But we don't want 4^2 patch files for all combinations of CRT (static or not) and LIB (static or not). Any suggestion? Easy way could be to consider a unique static or not cfg build vs dynamic.
|
@magicfoo, thanks for the PR! The following port failed on CI, could you take a look? for glib:x64-windows-static, it passed on CI testing, could you remove it from from ci.baseline, if some of the failures are expected, please also add it to ci.baseline file. Failed on x86-windows/x64-windows: Failed on x64-windows-static: |
ports/fltk/find-lib-png.patch
Outdated
There was a problem hiding this comment.
modifications from here going on are whitespace-only, am I right?
if so, can you please remove them in order to simplify patchset?
ports/libyaml/portfile.cmake
Outdated
There was a problem hiding this comment.
vcpkg_apply_patches is deprecated. Can you please define something like
if (VCPKG_TARGET_IS_WINDOWS)
set(WIN_PATCH "fix-POSIX_name.patch")
endif()
and then use ${WIN_PATCH} directly above? in this way it is applied only on windows without using a deprecated function (which might trigger a fatal error if the user does not delete buildtrees folder every time!)
There was a problem hiding this comment.
This is more tricky AFAIK. The CRT linkage is not part of the triplet and the original source code is shared by vcpkg between the dynamic and static versions of those 2 builds. To prevent this, this port file duplicates the source code locally into 2 working folders named according to VCPKG_CRT_LINKAGE. Then different patches could be applied to those distinct source dirs, especially the patch 0002 building the lib with static CRT.
The very first lines exclude the configuration (lib=dynamic,crt=static) for good reasons. But the config (lib=static,crt=dynamic) is acceptable, but not managed by vcpkg at this level of granularity. I hope I was clear in my explanations here. A consequence of this is the patches can't be applied to the original source code ('from_github') and must be processed later ... I personally agree this is ugly but I don't see atm better option. The best thing to do IMHO is to manage the CRT linkage as the same level the LIB linkage is exposed by VCPKG to the user, extending the triplet x64-windows-static to a quadruplet x64-windows-static-static?? Not ideal, but at least, this is robust.
There was a problem hiding this comment.
Sorry I lost you. Will need to inspect the port better to understand the problem you are trying to explain
There was a problem hiding this comment.
Let me try a shorter version: The original source code can't be patched directly (using PATCHES arg in the vcpkg_from_github function call) as the patches to apply depend on the CRT and LIB linkage modes. This port duplicates the source code to distinctly apply the proper patches on dedicated copies.
Options could be:
- have vcpkg to generate multiple variants of the source code according to triplet + CRT linkage that could be patched one, and reused later in other builds
- reverse the patches into a single instance of the source code before to patch again in order to patch dynamically based on the current triplet+CRT
Ideally, we would like vcpkg to do the minimal of work each time we run/resume a build, without to redo everything, be reliable and efficient like some build systems do (tuple, scons, etc).
There was a problem hiding this comment.
we would like vcpkg to do the minimal of work each time we run/resume a build, without to redo everything
that's not how vcpkg works. It deletes everything and restarts from scratch, apart from keeping the uncompressed sources files + patches eventually applied
The triplet is unique, in that a single triplet defines CRT linkage and LIB linkage. So ideally you can apply the idea of having symbols that resolves to nothing depending on the proper configuration at build time
There was a problem hiding this comment.
also, remember that vcpkg_apply_patches is really broken if used directly in portfiles. It's NOT robust, not at all! It fails always the second time you run an install with the same parameters without manually deleting buildtrees folder
There was a problem hiding this comment.
apart from keeping the uncompressed sources files + patches eventually applied
This is exactly the reason why we can't apply those patches on the source files provided by vcpkg but have to duplicate the code per LIB+CRT config.
There was a problem hiding this comment.
I rewrote a proposal for the python3 port file which look clean to me. Few things I don't like like the vcpkg_build_msbuild that build for debug and release by itself. At least we should have an option to decide about this behavior. I got around by wrapping the function call forcing one build type at the time.
There was a problem hiding this comment.
This is exactly the reason why we can't apply those patches on the source files provided by vcpkg but have to duplicate the code per LIB+CRT config.
vcpkg calculate a hash for the source files + applied patches. So if the patchset is ok, it recycles the buildtrees source folder, otherwise if the patchset for the new build (different crt linkage, different lib linkage, different os, whatever that makes any symbol be empty for example) is different, the hash will not match and another source tree will be expanded and the appropriate patch files applied.
There was a problem hiding this comment.
If you use modern vcpkg routines, you will find that what you are trying to do manually with code duplication and patch manually applied would be handled automatically
The failing build in x64-windows-static are not really regression, as they never work pass before this commit fixing glib in static build. I checked few of them and they fail on a missing intl static lib. They could be fixed later but IMHO should not block this PR. |
ports/fltk/find-lib-cairo.patch
Outdated
There was a problem hiding this comment.
Can you delete these three lines instead of commenting them out?
Thanks.
ports/fltk/find-lib-png.patch
Outdated
There was a problem hiding this comment.
Can you delete these three lines instead of commenting them out?
Thanks.
ports/fltk/find-lib-png.patch
Outdated
ports/fltk/find-lib-png.patch
Outdated
ports/fltk/portfile.cmake
Outdated
There was a problem hiding this comment.
This directory should be deleted by vcpkg_fixup_cmake_targets, what files does it contain?
ports/libyaml/portfile.cmake
Outdated
There was a problem hiding this comment.
Can you remove this line? We don't need to include it now.
ports/python3/portfile.cmake
Outdated
There was a problem hiding this comment.
We can use conditions to determine whether changes in these patches will be executed, so that these patches can always be applied.
ports/python3/portfile.cmake
Outdated
ports/python3/portfile.cmake
Outdated
ports/python3/portfile.cmake
Outdated
There was a problem hiding this comment.
Can you change these code to vcpkg_configure_make[1] / vcpkg_install_make[2] ?
[1]. https://github.com/microsoft/vcpkg/blob/master/docs/maintainers/vcpkg_configure_make.md
[2]. https://github.com/microsoft/vcpkg/blob/master/docs/maintainers/vcpkg_install_make.md
+ Remove Py_DEBUG in debug build config altering PyModule_Create() symbol + Remove conflicting link time (LT) optimizations in Windows profile
|
Pinging @magicfoo for response. Is work still being done for this PR? |
|
Closing this PR since it seems that no progress is being made. Please reopen if work is still being done. |
This PR provides few minor or more majors adjustments to the following components: