Skip to content
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

meson test failure on MSVC #3379

Closed
eli-schwartz opened this issue Jan 18, 2022 · 11 comments
Closed

meson test failure on MSVC #3379

eli-schwartz opened this issue Jan 18, 2022 · 11 comments
Labels
meson meson build system

Comments

@eli-schwartz
Copy link
Contributor

In mesonbuild/wrapdb#285, attempting to add harfbuzz to the wrapdb, the following testsuite error occurs on the Visual Studio build, but not on the Ubuntu build.

 95/387 harfbuzz:shaping+in-house / item-context                 FAIL             0.09s   exit status 1
>>> HAVE_FREETYPE=1 PATH=D:\a\wrapdb\wrapdb\_build\subprojects\proxy-libintl;D:\a\wrapdb\wrapdb\_build\subprojects\glib-2.70.2\glib;D:\a\wrapdb\wrapdb\_build\subprojects\zlib-1.2.11;D:\a\wrapdb\wrapdb\_build\subprojects\cairo\src;D:\a\wrapdb\wrapdb\_build\subprojects\harfbuzz-3.2.0\src;D:\a\wrapdb\wrapdb\_build\subprojects\pixman\pixman;D:\a\wrapdb\wrapdb\_build\subprojects\freetype-2.11.1;D:\a\wrapdb\wrapdb\_build\subprojects\libpng-1.6.37;C:\Program Files\PowerShell\7;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\\Extensions\Microsoft\IntelliCode\CLI;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Team Tools\Performance Tools\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\\x64;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\;C:\Program Files (x86)\HTML Help Workshop;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\devinit;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\\MSBuild\Current\Bin;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\;C:\Program Files\MongoDB\Server\5.0\bin;C:\aliyun-cli;C:\vcpkg;C:\cf-cli;C:\Program Files (x86)\NSIS\;C:\tools\zstd;C:\Program Files\Mercurial\;C:\hostedtoolcache\windows\stack\2.7.3\x64;C:\cabal\bin;C:\\ghcup\bin;C:\tools\ghc-9.2.1\bin;C:\Program Files\dotnet;C:\mysql\bin;C:\Program Files\R\R-4.1.2\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\bin;C:\Program Files (x86)\pipx_bin;C:\hostedtoolcache\windows\go\1.15.15\x64\bin;C:\hostedtoolcache\windows\Python\3.7.9\x64\Scripts;C:\hostedtoolcache\windows\Python\3.7.9\x64;C:\hostedtoolcache\windows\Ruby\2.5.9\x64\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.312-7\x64\bin;C:\npm\prefix;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\Program Files\Eclipse Foundation\jdk-8.0.302.8-hotspot\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\ProgramData\Chocolatey\bin;C:\Program Files\Docker;C:\Program Files\PowerShell\7\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\nodejs\;C:\Program Files\OpenSSL\bin;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.8.4\bin;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;c:\tools\php;C:\SeleniumWebDrivers\ChromeDriver\;C:\SeleniumWebDrivers\EdgeDriver\;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Amazon\SessionManagerPlugin\bin\;C:\Program Files\Amazon\AWSSAMCLI\bin\;C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin;C:\Program Files (x86)\Microsoft BizTalk Server\;C:\Program Files\LLVM\bin;C:\Users\runneradmin\.dotnet\tools;C:\Users\runneradmin\.cargo\bin;C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Microsoft Visual Studio\Installer;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\Llvm\x64\bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\VC\Linux\bin\ConnectionManagerExe MALLOC_PERTURB_=180 c:\hostedtoolcache\windows\python\3.7.9\x64\python.exe D:\a\wrapdb\wrapdb\subprojects\harfbuzz-3.2.0\test\shape\run-tests.py util\hb-shape.exe D:/a/wrapdb/wrapdb/subprojects/harfbuzz-3.2.0/test/shape/data/in-house/tests/item-context.tests
------------------------------------- 8< -------------------------------------
stdout:
hb-shape.exe: Unknown option --unicodes-before=U+0643,U+0650

Try `hb-shape.exe --help' for more information.

Running tests in D:/a/wrapdb/wrapdb/subprojects/harfbuzz-3.2.0/test/shape/data/in-house/tests/item-context.tests

util\hb-shape.exe D:\a\wrapdb\wrapdb\subprojects\harfbuzz-3.2.0\test\shape\data\in-house\fonts\65984dfce552a785f564422aadf4715fa07795ad.ttf --font-funcs=ft --shaper=ot --verify --unicodes U+0643,U+0650,U+062A,U+064E,U+0627,U+0628,U+064F,U+0646,U+064E,U+0627

util\hb-shape.exe D:\a\wrapdb\wrapdb\subprojects\harfbuzz-3.2.0\test\shape\data\in-house\fonts\65984dfce552a785f564422aadf4715fa07795ad.ttf --font-funcs=ot --shaper=ot --verify --unicodes U+0643,U+0650,U+062A,U+064E,U+0627,U+0628,U+064F,U+0646,U+064E,U+0627

util\hb-shape.exe D:\a\wrapdb\wrapdb\subprojects\harfbuzz-3.2.0\test\shape\data\in-house\fonts\65984dfce552a785f564422aadf4715fa07795ad.ttf --font-funcs=ft --shaper=ot --verify --unicodes U+062A,U+064E,U+0627,U+0628,U+064F,U+0646,U+064E,U+0627 --unicodes-before=U+0643,U+0650

util\hb-shape.exe D:\a\wrapdb\wrapdb\subprojects\harfbuzz-3.2.0\test\shape\data\in-house\fonts\65984dfce552a785f564422aadf4715fa07795ad.ttf --font-funcs=ot --shaper=ot --verify --unicodes U+062A,U+064E,U+0627,U+0628,U+064F,U+0646,U+064E,U+0627 --unicodes-before=U+0643,U+0650

stderr:
Traceback (most recent call last):

  File "D:\a\wrapdb\wrapdb\subprojects\harfbuzz-3.2.0\test\shape\run-tests.py", line 98, in <module>

    glyphs2 = shape_cmd ([fontfile, "--font-funcs=ot"] + extra_options + ["--unicodes", unicodes] + options)

  File "D:\a\wrapdb\wrapdb\subprojects\harfbuzz-3.2.0\test\shape\run-tests.py", line 9, in shape_cmd

    process.stdin.flush ()

OSError: [Errno 22] Invalid argument

Apparently it is somehow missing a CLI option altogether and that doesn't trigger a skip?

@khaledhosny
Copy link
Collaborator

The option should be available, unless somehow it is using an hb-shappe binary other than the one it just built.

@eli-schwartz
Copy link
Contributor Author

The command being run (minus reported environment variables) is:

c:\hostedtoolcache\windows\python\3.7.9\x64\python.exe \
    D:\a\wrapdb\wrapdb\subprojects\harfbuzz-3.2.0\test\shape\run-tests.py \
    util\hb-shape.exe \
    D:/a/wrapdb/wrapdb/subprojects/harfbuzz-3.2.0/test/shape/data/in-house/tests/item-context.tests

I do not have any clue why it would be missing the option, though. :(

@khaledhosny
Copy link
Collaborator

The binary path is relative while the others are absolute, would the current directory by any chance be other than harfbuzz build directory?

@eli-schwartz
Copy link
Contributor Author

No, because:

  • you already set workdir: meson.current_build_dir() / '..' / '..', (from tests/shape/, so this is equivalent to workdir: meson.project_build_root())
    So the current directory of the tests is builddir\subprojects\harfbuzz-3.2.0\ and it is running builddir\subprojects\harfbuzz-3.2.0\util\hb-shape.exe.
  • the argument to the test() function is hb_shape, a variable pointing to a meson executable(), so meson guarantees that no matter where and how it is being run, it will calculate the correct path to that built executable and pass that as the argument to run-tests.py

@khaledhosny khaledhosny added the meson meson build system label Jan 19, 2022
@fanc999
Copy link
Contributor

fanc999 commented Feb 14, 2022

Hi @eli-schwartz,

Can I know what compiler (i.e. Visual Studio version) you are using to build HarfBuzz? For me, it seemed that Visual Studio 2015 silently ate away the options in text-options.hh grouped with --unicodes-before, but thing were just fine in Visual Studio 2017 and later, meaning that all the tests passed when I built with Visual Studio 2017 15.9.x but the test that you mentioned failed with Visual Studio 2015 Update 3.

I guess since we are starting to get problems with Visual Studio 2015 (its C++11 support is more or less complete but has issues in some details), we might want to start to ask people to use Visual Studio 2017 or later, since binaries built with Visual Studio 2017 should be ABI-compatible with Visual Studio 2015 or later, as long as the headers work with Visual Studio 2015, provided that one is not using a Visual Studio CRT runtime package that is not Visual Studio 2017-ready.


Edit: It looks like the code compiled by Visual Studio 2015 called the text_options_t::add_options() (the method in the struct that was inherited) instead of shape_text_options_t::add_options() (the method in the struct that inherited text_options_t, which will also call text_options_t::add_options() along the way)...

Let's see whether we have a way to work around this... ugh :|

Seems that the compiler mixed up the text_options_t in main-font-text.hh in the templatized implementation of

template <typename consumer_t, typename font_options_t, typename text_options_t>
struct main_font_text_t : option_parser_t, font_options_t, text_options_t, consumer_t

with the actual struct type text_options_t. So a simple rename in main-font-text.hh from text_options_t to text_options_type will do the job to fix things on Visual Studio 2015.


With blessings, and cheers!

fanc999 pushed a commit to fanc999/harfbuzz that referenced this issue Feb 16, 2022
Rename text_option_t in the templatized implementation of
main_font_text_t so that we won't confuse between the text_option_t
template with the actual struct type that inherits from the actual
text_option_t structure, which will fix running on Visual Studio 2015.

This will fix harfbuzz#3379.
fanc999 pushed a commit to fanc999/harfbuzz that referenced this issue Feb 17, 2022
Rename text_option_t in the templatized implementation of
main_font_text_t so that we won't confuse between the text_option_t
template with the actual struct type that inherits from the actual
text_option_t structure, which will fix running on Visual Studio 2015.

This will fix harfbuzz#3379.
fanc999 pushed a commit to fanc999/harfbuzz that referenced this issue Feb 17, 2022
Rename text_option_t in the templatized implementation of
main_font_text_t so that we won't confuse between the text_option_t
template with the actual struct type that inherits from the actual
text_option_t structure, which will fix running on Visual Studio 2015.

This will fix harfbuzz#3379.
@fanc999
Copy link
Contributor

fanc999 commented Feb 18, 2022

Hi @eli-schwartz,

I saw that you are running Visual Studio 2019 Enterprise, sorry for missing that. Can I know what is the exact version of it you were running, since I can't reproduce your issue on my Visual Studio 2019 Community installation (16.11.10). As a test, can you do the following:

  • Add a g_message("...") call in text_options_t::add_options() and shape_text_options_t::add_options (the message content should be distinct from each other) in util/text-options.hh, build and run the tests. The g_message("...") call in shape_text_options_t::add_options should be before the parser->add_group () text_options_t::add_options (parser); (sorry for my bad memory in my head mistake) call.
  • In your meson-logs/testlog.txt, you should see at least the text that you put into the g_message("...") calls in text_options_t::add_options(). If you do, then the correct, freshly-built hb-shape.exe is being run.
  • Did you see the text that you put into shape_text_options_t::add_options() before the text you put into text_options_t::add_options()? You should see both. If you only saw the message in text_options_t::add_options() being shown, this would be why you did not have the --unicodes-before option in your hb-shape.exe.

Hi @behdad,

As a follow up to your points in #3448 on the hb-shape.exe (I understand that it is bizarre and hard to believe), This was the test I used on Visual Studio 2015 demonstrated that in the templatized implementation of

template <typename consumer_t, typename font_options_t, typename text_options_t>
struct main_font_text_t : option_parser_t, font_options_t, text_options_t, consumer_t

caused only the text_options_t::add_options() to be called by hb-shape.exe but not the shape_text_options_t::add_options() to be called, which we were expecting, which caused the test failure in my VS2015 case (with the same error message that Eli mentioned in this issue report).


With blessings, thank you!

@eli-schwartz
Copy link
Contributor Author

I added a copy of that file as a WrapDB overlay, modified it so that both functions begin with g_message("begin funcname()"); and end with g_message("end funcname()");

Here are the results: https://github.com/mesonbuild/wrapdb/runs/5242709463?check_suite_focus=true#step:7:4932

 94/386 harfbuzz:shaping+in-house / item-context                 FAIL             0.09s   exit status 1
>>> PATH=D:\a\wrapdb\wrapdb\_build\subprojects\libpng-1.6.37;D:\a\wrapdb\wrapdb\_build\subprojects\pixman\pixman;D:\a\wrapdb\wrapdb\_build\subprojects\glib-2.70.2\glib;D:\a\wrapdb\wrapdb\_build\subprojects\proxy-libintl;D:\a\wrapdb\wrapdb\_build\subprojects\freetype-2.11.1;D:\a\wrapdb\wrapdb\_build\subprojects\cairo\src;D:\a\wrapdb\wrapdb\_build\subprojects\zlib-1.2.11;D:\a\wrapdb\wrapdb\_build\subprojects\harfbuzz-3.2.0\src;C:\Program Files\PowerShell\7;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\\Extensions\Microsoft\IntelliCode\CLI;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.30.30705\bin\HostX64\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\VC\VCPackages;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\bin\Roslyn;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Team Tools\Performance Tools\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\;C:\Program Files (x86)\HTML Help Workshop;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\\x64;C:\Program Files (x86)\Windows Kits\10\bin\\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\\MSBuild\Current\Bin\amd64;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\;C:\Program Files\MongoDB\Server\5.0\bin;C:\aliyun-cli;C:\vcpkg;C:\Program Files (x86)\NSIS\;C:\tools\zstd;C:\Program Files\Mercurial\;C:\hostedtoolcache\windows\stack\2.7.3\x64;C:\cabal\bin;C:\\ghcup\bin;C:\tools\ghc-9.2.1\bin;C:\Program Files\dotnet;C:\mysql\bin;C:\Program Files\R\R-4.1.2\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\bin;C:\Program Files (x86)\pipx_bin;C:\hostedtoolcache\windows\go\1.16.13\x64\bin;C:\hostedtoolcache\windows\Python\3.9.10\x64\Scripts;C:\hostedtoolcache\windows\Python\3.9.10\x64;C:\hostedtoolcache\windows\Ruby\3.0.3\x64\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.322-6\x64\bin;C:\npm\prefix;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\Program Files\Microsoft\jdk-11.0.12.7-hotspot\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\ProgramData\Chocolatey\bin;C:\Program Files\Docker;C:\Program Files\PowerShell\7\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\nodejs\;C:\Program Files\LLVM\bin;C:\Program Files\OpenSSL\bin;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.8.4\bin;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI\;c:\tools\php;C:\SeleniumWebDrivers\ChromeDriver\;C:\SeleniumWebDrivers\EdgeDriver\;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Amazon\SessionManagerPlugin\bin\;C:\Program Files\Amazon\AWSSAMCLI\bin\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Users\runneradmin\.dotnet\tools;C:\Users\runneradmin\.cargo\bin;C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Microsoft Visual Studio\Installer;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\Llvm\x64\bin;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\VC\Linux\bin\ConnectionManagerExe HAVE_FREETYPE=1 MALLOC_PERTURB_=138 C:\hostedtoolcache\windows\Python\3.9.10\x64\python.exe D:\a\wrapdb\wrapdb\subprojects\harfbuzz-3.2.0\test\shape\run-tests.py util\hb-shape.exe D:/a/wrapdb/wrapdb/subprojects/harfbuzz-3.2.0/test/shape/data/in-house/tests/item-context.tests
------------------------------------- 8< -------------------------------------
stdout:
** Message: 04:02:07.310: begin text_options_t::add_options()

** Message: 04:02:07.312: end text_options_t::add_options()

** Message: 04:02:07.314: begin text_options_t::add_options()

** Message: 04:02:07.314: end text_options_t::add_options()

** Message: 04:02:07.315: begin text_options_t::add_options()

** Message: 04:02:07.315: end text_options_t::add_options()

hb-shape.exe: Unknown option --unicodes-before=U+0643,U+0650

Try `hb-shape.exe --help' for more information.

Running tests in D:/a/wrapdb/wrapdb/subprojects/harfbuzz-3.2.0/test/shape/data/in-house/tests/item-context.tests

util\hb-shape.exe D:\a\wrapdb\wrapdb\subprojects\harfbuzz-3.2.0\test\shape\data\in-house\fonts\65984dfce552a785f564422aadf4715fa07795ad.ttf --font-funcs=ft --shaper=ot --verify --unicodes U+0643,U+0650,U+062A,U+064E,U+0627,U+0628,U+064F,U+0646,U+064E,U+0627

util\hb-shape.exe D:\a\wrapdb\wrapdb\subprojects\harfbuzz-3.2.0\test\shape\data\in-house\fonts\65984dfce552a785f564422aadf4715fa07795ad.ttf --font-funcs=ot --shaper=ot --verify --unicodes U+0643,U+0650,U+062A,U+064E,U+0627,U+0628,U+064F,U+0646,U+064E,U+0627

util\hb-shape.exe D:\a\wrapdb\wrapdb\subprojects\harfbuzz-3.2.0\test\shape\data\in-house\fonts\65984dfce552a785f564422aadf4715fa07795ad.ttf --font-funcs=ft --shaper=ot --verify --unicodes U+062A,U+064E,U+0627,U+0628,U+064F,U+0646,U+064E,U+0627 --unicodes-before=U+0643,U+0650

util\hb-shape.exe D:\a\wrapdb\wrapdb\subprojects\harfbuzz-3.2.0\test\shape\data\in-house\fonts\65984dfce552a785f564422aadf4715fa07795ad.ttf --font-funcs=ot --shaper=ot --verify --unicodes U+062A,U+064E,U+0627,U+0628,U+064F,U+0646,U+064E,U+0627 --unicodes-before=U+0643,U+0650

stderr:
Traceback (most recent call last):

  File "D:\a\wrapdb\wrapdb\subprojects\harfbuzz-3.2.0\test\shape\run-tests.py", line 98, in <module>

    glyphs2 = shape_cmd ([fontfile, "--font-funcs=ot"] + extra_options + ["--unicodes", unicodes] + options)

  File "D:\a\wrapdb\wrapdb\subprojects\harfbuzz-3.2.0\test\shape\run-tests.py", line 9, in shape_cmd

    process.stdin.flush ()

OSError: [Errno 22] Invalid argument

Whatever the cause of the issue (I know nothing about Visual Studio or its versions) your analysis seems to be correct: that second function is not being called.

As for which version of Visual Studio I'm using, I'm using "whatever Github provides in the windows-latest image" and activated by https://github.com/ilammy/msvc-dev-cmd. According to the logs, that is:

C compiler for the host machine: cl (msvc 19.30.30709 "Microsoft (R) C/C++ Optimizing Compiler Version 19.30.30709 for x64")

plus numerous string references to C:\Program Files\Microsoft Visual Studio\2022\Enterprise\

My assumption is that whatever Github provides in "windows-latest" ought to be new enough that you definitely want to support it. I can only assume it is Visual Studio 2022, not Visual Studio 2015, 2017, or 2019.

@eli-schwartz
Copy link
Contributor Author

Running locally on Linux I see what you suggested I should see (in addition to passing tests):

----------------------------------- output -----------------------------------
stdout:
** Message: 22:52:45.415: begin shape_text_options_t::add_options()
** Message: 22:52:45.418: begin text_options_t::add_options()
** Message: 22:52:45.418: end text_options_t::add_options()
** Message: 22:52:45.418: end shape_text_options_t::add_options()
** Message: 22:52:45.436: begin shape_text_options_t::add_options()
** Message: 22:52:45.436: begin text_options_t::add_options()
** Message: 22:52:45.436: end text_options_t::add_options()
** Message: 22:52:45.436: end shape_text_options_t::add_options()
** Message: 22:52:45.437: begin shape_text_options_t::add_options()
** Message: 22:52:45.437: begin text_options_t::add_options()
** Message: 22:52:45.437: end text_options_t::add_options()
** Message: 22:52:45.437: end shape_text_options_t::add_options()
[...]

@fanc999
Copy link
Contributor

fanc999 commented Feb 18, 2022

Hi @eli-schwartz,

Thanks for the info...

Hmm, interesting, I couldn't reproduce this either with Visual Studio 2022 Community (17.1.0, cl version Microsoft (R) C/C++ Optimizing Compiler Version 19.31.31104 for x64), nor with the latest Visual Studio 2019 or 2017...

As another test, can you do the following, after restoring util/text-options.hh to the original:

  • Download this patch hb-shape.txt (sorry, I had to use the .txt filename extension, as GITHub does not allow me to use .patch nor .diff), and apply it.
  • Run the tests again.

Thanks a bunch!

@eli-schwartz
Copy link
Contributor Author

https://github.com/mesonbuild/wrapdb/runs/5242978350?check_suite_focus=true

With this patch it passes the tests. (The CI run itself then fails because util/main-font-text.hh is not a permitted file in the WrapDB, since we have a policy against modifying project source code there. But that's fine, all we are trying to do in this ticket is check that meson test succeeds.)

@behdad
Copy link
Member

behdad commented Feb 18, 2022

Thanks for the analysis.

Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meson meson build system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants