Browse Source

Use same wine peerdir on Windows target regardless of host - take 2

This PR contains following changes:
1. Unconditional PEERDIR to wine for Windows-targeted builds. This is proven to align UIDs in cross and native builds on Windows for the vast majority of build nodes (.asm built by ml tool and its dependants are  the only notable exceptions as of now)
2. Wine is made host platform resource bundle. This more precisely reflects the nature of tools and allows per-host resource selection without effect on UIDs.
3. Wine  description is modernized to by-platform json and shared between ya,conf.json and ya.make
4. Separate archive added fpr Windows host to avoid unpacking issues of original archive caused by symlinks in it. This is needed because due totest now getting all transitive resources of their build and try to deliver these resources even though they are unused.  In initial experiments this caused tests failures on native Windows in attempts to unpack wine.
5. Brief description of wine resource peculiarities is added.
6. Wine tool reference is fixed in build commands. The resource ID was hardcoded in wine command prefix which is plainly incorrect.

Upon fixingwindows resources may be excluded from JSONs leaving only one platform.
229fbec4453ead9c669bd0ec505a7ba8e5f117fb
spreis 8 months ago
parent
commit
3ec1e3083e

+ 1 - 1
build/conf/toolchains/msvc_toolchain.conf

@@ -2,7 +2,7 @@
 # для любых платформ. Нужно унифицировать с GnuToolchain.
 C_FLAGS_PLATFORM=
 
-_WINE_CMD=${YMAKE_PYTHON} ${input:"build/scripts/run_msvc_wine.py"} ${hide;input:"build/scripts/process_command_files.py"} ${hide;input:"build/scripts/process_whole_archive_option.py"} $(WINE_TOOL-sbr:1093314933)/bin/wine64 -v140 ${env:"WINEPREFIX_SUFFIX=4.0"}
+_WINE_CMD=${YMAKE_PYTHON} ${input:"build/scripts/run_msvc_wine.py"} ${hide;input:"build/scripts/process_command_files.py"} ${hide;input:"build/scripts/process_whole_archive_option.py"} ${WINE_TOOL_RESOURCE_GLOBAL}/bin/wine64 -v140 ${env:"WINEPREFIX_SUFFIX=4.0"}
 
 _WINE_C_PREFIX=
 _WINE_CXX_PREFIX=

+ 3 - 0
build/platform/wine/readme.md

@@ -0,0 +1,3 @@
+## These are resources of wine (Windows execution layer for Linux)
+- wine32.json and wine.json describe wine for 32bit (i686) and 64bit (x86_64) tests. It is unclear why separate packages are needed. As of now this is hard-coded in ya-bin even though both resources contain wine (32bit) and wine64 (64bit) binaries. Build uses only latter since 32bit host platform is not supported, tests however use target platform to determine wine flavor to be used and so may use both.
+- JSON's also contain resource for Windows host platform. It is just archive with empty directory needed to unify wine tool description among all platforms supporting Windows-targeted builds. This resource will never be actually used but as of now may be downloaded by tests due to deficiecy of implementation (YA-789). Just preserve these resources as they are upon wine updates.

+ 10 - 0
build/platform/wine/wine.json

@@ -0,0 +1,10 @@
+{
+     "by_platform": {
+         "linux-x86_64": {
+             "uri": "sbr:1093314933"
+         },
+         "win32-x86_64": {
+             "uri": "sbr:6566731101"
+         }
+     }
+}

+ 10 - 0
build/platform/wine/wine32.json

@@ -0,0 +1,10 @@
+{
+     "by_platform": {
+         "linux-x86_64": {
+             "uri": "sbr:2264052281"
+         },
+         "win32-x86_64": {
+             "uri": "sbr:6566731101"
+         }
+     }
+}

+ 2 - 3
build/platform/wine/ya.make

@@ -1,8 +1,7 @@
 RESOURCES_LIBRARY()
 
-# do not forget to update resources in ya.conf.json
-DECLARE_EXTERNAL_RESOURCE(WINE_TOOL sbr:1093314933)
-DECLARE_EXTERNAL_RESOURCE(WINE32_TOOL sbr:2264052281)
+DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE_BY_JSON(WINE_TOOL wine.json)
+DECLARE_EXTERNAL_HOST_RESOURCES_BUNDLE_BY_JSON(WINE32_TOOL wine32.json)
 
 SET(NEED_PLATFORM_PEERDIRS no)
 END()

+ 1 - 2
build/ymake_conf.py

@@ -1926,8 +1926,7 @@ class MSVCToolchain(MSVC, Toolchain):
 
         if self.tc.from_arcadia and not self.tc.ide_msvs:
             self.platform_projects.append('build/internal/platform/msvc')
-            if tc.under_wine_compiler or tc.under_wine_tools:
-                self.platform_projects.append('build/platform/wine')
+            self.platform_projects.append('build/platform/wine')
 
     def print_toolchain(self):
         super(MSVCToolchain, self).print_toolchain()