mesonbuild / meson

The Meson Build System
http://mesonbuild.com
Apache License 2.0
5.58k stars 1.62k forks source link

How to avoid get_wine_shortpath or avoid adding self.test.extra_paths? #6840

Open mstorsjo opened 4 years ago

mstorsjo commented 4 years ago

When cross compiling for windows from linux with mingw toolchains, a number of directories are added to self.test.extra_paths, but they aren't added when cross compiling with MSVC. Is there any way to opt out from adding these paths (for cases where I'm just building a static executable and don't need to add extra directories to the path)?

When self.test.extra_paths is set, meson tries to execute get_wine_shortpath before actually executing the test. In my setup, executing a binary is costly as my exe_wrapper involves running the built executable in wine on a different host via ssh (exe_wrapper = ['ssh', 'neo4', 'wine64']).

(Additionally, the batch script called in get_wine_shortpath actually fails in this setup, as it's executed with a local path, but the command invoked by ssh on the remote host isn't executed in the same directory. Normal tests run just fine as they're given an absolute path, and the build directory is mounted on the same place on the other host.)

Therefore, each invocation of get_wine_shortpath adds a significant overhead to my meson test runs, spamming the output with error messages - I'd like to opt out from it, either by skipping the get_wine_shortpath step, or by requesting not to add things to self.test.extra_paths.

CC @thiblahute who contributed the get_wine_shortpath feature.

mstorsjo commented 1 month ago

FWIW, since 57909b53d6d2099e45873688b659ce071f6039ef, CC @xclaesse, I see that this issue has been alleviated a fair amount - as long as WINEPATH ends up short enough, none of this gets triggered.

It'd still be interesting to have answers to the questions above - why is extra_paths only populated in mingw builds, but not MSVC builds, and it'd be nice to have a hard opt-out of this feature.

I see that since that commit, this logic is skipped for the Wine >= 6.4 case. But in my remote ssh testing setup, I'm not sure if the version_compare(ExternalProgram('wine', winecmd, silent=True).get_version(), '>=6.4') comparison really works, and even if it does, it's unnecessarily slow to run this for each command we want to execute (essentially doubling the number of ssh connections we need to make).