Skip to content

Conversation

@tats-u
Copy link
Contributor

@tats-u tats-u commented Nov 23, 2025

Description

A clear and concise description of this pull request.

It can be burden for storage to preserve both VS 2022 and 2026.
It is better to allow developers to try building Mozc on newer Visual Studio than 2022.
If there are blockers, developers should report them here.

Issue IDs

Issue and/or discussion IDs related to this pull request.

Fix regression by #1402

Steps to test new behaviors (if any)

A clear and concise description about how to verify new behaviors (if any).

  • OS: [e.g. Windows 11, macOS 13.1, etc] Windows
  • Steps:
    1. Install only VS 2026 (Community is OK)
    2. cd src
    3. python build_tools/update_deps.py && python build_tools/build_qt.py --release --confirm_license

Additional context

Add any other context about the pull request here.

Which Python formatter do you prefer?

@yukawa
Copy link
Collaborator

yukawa commented Nov 24, 2025

Thank you for the pull request, but I have a feeling that we need a bit more preparations to officially support Visual Studio 2026.

I actually considered supporting Visual Studio 2026, but decided to postpone it at that time for the following reasons:

  1. Visual Studio 2026 is not yet available in GitHub Actions runner image we are using. Thus we cannot rely on GitHub Actions to confirm whether all the tests are passing when built with Visual Studio 2026 in a continuous manner.
    Update/Add Visual Studio 2026 actions/runner-images#13291
  2. It's unclear whether GYP supports Visual Studio 2026 or not.

    mozc/src/build_mozc.py

    Lines 253 to 255 in ac096a5

    parser.add_option('--msvs_version', dest='msvs_version',
    default='2022',
    help='Version of the Visual Studio.')
  3. Installer related files need to be updated. (See below the error message I got with your patch)
    'conditions': [
    # https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros
    ['MSVS_VERSION=="2015"', {
    'compiler_target': 'msvs',
    'compiler_host': 'msvs',
    'vcruntime_ver': '140',
    }],
    ['MSVS_VERSION=="2017"', {
    'compiler_target': 'msvs',
    'compiler_host': 'msvs',
    'vcruntime_ver': '141',
    }],
    ['MSVS_VERSION=="2019"', {
    'compiler_target': 'msvs',
    'compiler_host': 'msvs',
    'vcruntime_ver': '142',
    }],
    ['MSVS_VERSION=="2022"', {
    'compiler_target': 'msvs',
    'compiler_host': 'msvs',
    'vcruntime_ver': '143',
    }],
    ],

    redist_64bit = redist_root.joinpath(arch).joinpath('Microsoft.VC143.CRT')
PS D:\mozc\src> bazelisk build package --config oss_windows --config release_build
INFO: Invocation ID: f7e2f585-6012-4183-be29-c1c4ceed6b47
INFO: Analyzed target //:package (32 packages loaded, 790 targets configured).
ERROR: D:/mozc/src/win32/installer/BUILD.bazel:68:8: Executing genrule //win32/installer:installer failed: (Exit 1): bash.exe failed: error executing Genrule command (from target //win32/installer:installer) D:\mozc\src\third_party\msys64\usr\bin\bash.exe -c ... (remaining 1 argument skipped)
C:\Users\yukawa\AppData\Local\Temp\Bazel.runfiles_lfumyi_t\runfiles\_main\build_tools\vs_util.py:152: RuntimeWarning: Using Visual Studio newer than 17 has not been supported yet.
  warnings.warn(f'Using Visual Studio newer than {preferred_vs_version} has not been supported yet.', RuntimeWarning)
Traceback (most recent call last):
  File "C:\Users\yukawa\AppData\Local\Temp\Bazel.runfiles_lfumyi_t\runfiles\_main\win32\installer\build_installer.py", line 196, in <module>
    main()
  File "C:\Users\yukawa\AppData\Local\Temp\Bazel.runfiles_lfumyi_t\runfiles\_main\win32\installer\build_installer.py", line 192, in main
    run_wix4(args)
  File "C:\Users\yukawa\AppData\Local\Temp\Bazel.runfiles_lfumyi_t\runfiles\_main\win32\installer\build_installer.py", line 157, in run_wix4
    exec_command(commands, cwd=os.getcwd())
  File "C:\Users\yukawa\AppData\Local\Temp\Bazel.runfiles_lfumyi_t\runfiles\_main\win32\installer\build_installer.py", line 70, in exec_command
    raise ChildProcessError('\n'.join(msgs))
ChildProcessError: Failed to execute command:

D:\bazel_root\output\3spnzsgp\external\+_repo_rules5+wix\wix.exe build -nologo -arch x64 -define MozcVersion=2.32.5994.100 -define UpgradeCode=DD94B570-B5E2-4100-9D42-61930C611D8A -define OmahaGuid= -define OmahaClientKey= -define OmahaClientStateKey= -define OmahaChannelType=dev -define VSConfigurationName=Release -define ReleaseRedistCrt64Dir=C:\Program Files\Microsoft Visual Studio\18\Community\VC\Redist\MSVC\14.50.35710\x64\Microsoft.VC143.CRT -define AddRemoveProgramIconPath=D:\mozc\src\data\images\win\product_icon.ico -define MozcTIP32Path=D:\bazel_root\output\3spnzsgp\execroot\_main\bazel-out\x64_windows-opt-ST-7ec6741e16dd\bin\win32\tip\mozc_tip32.dll.dll -define MozcTIP64Path=D:\bazel_root\output\3spnzsgp\execroot\_main\bazel-out\x64_windows-opt-ST-47a8c37d97b3\bin\win32\tip\mozc_tip64.dll.dll -define MozcBroker64Path=D:\bazel_root\output\3spnzsgp\execroot\_main\bazel-out\x64_windows-opt-ST-908940cc2e23\bin\win32\broker\mozc_broker.exe.exe -define MozcServer64Path=D:\bazel_root\output\3spnzsgp\execroot\_main\bazel-out\x64_windows-opt-ST-908940cc2e23\bin\server\mozc_server.exe.exe -define MozcCacheService64Path=D:\bazel_root\output\3spnzsgp\execroot\_main\bazel-out\x64_windows-opt-ST-908940cc2e23\bin\win32\cache_service\mozc_cache_service.exe.exe -define MozcRenderer64Path=D:\bazel_root\output\3spnzsgp\execroot\_main\bazel-out\x64_windows-opt-ST-908940cc2e23\bin\renderer\win32\mozc_renderer.exe.exe -define MozcToolPath=D:\bazel_root\output\3spnzsgp\execroot\_main\bazel-out\x64_windows-opt-ST-908940cc2e23\bin\gui\tool\mozc_tool.exe.exe -define CustomActions64Path=D:\bazel_root\output\3spnzsgp\execroot\_main\bazel-out\x64_windows-opt-ST-1d3326959c70\bin\win32\custom_action\mozc_installer_helper.dll.dll -define DocumentsDir=D:\mozc\src\data\installer -define QtDir=D:\bazel_root\output\3spnzsgp\external\+_repo_rules+qt_win -define QtVer=6 -out bazel-out/x64_windows-opt/bin/win32/installer/Mozc64.msi -src win32/installer/installer_oss_64bit.wxs

cwd=D:\bazel_root\output\3spnzsgp\execroot\_main
-----stdout-----
D:\bazel_root\output\3spnzsgp\execroot\_main\win32\installer\installer_oss_64bit.wxs(296) : error WIX0103: Cannot find the File file 'C:\Program Files\Microsoft Visual Studio\18\Community\VC\Redist\MSVC\14.50.35710\x64\Microsoft.VC143.CRT/msvcp140.dll'. The following paths were checked: C:\Program Files\Microsoft Visual Studio\18\Community\VC\Redist\MSVC\14.50.35710\x64\Microsoft.VC143.CRT/msvcp140.dll
D:\bazel_root\output\3spnzsgp\execroot\_main\win32\installer\installer_oss_64bit.wxs(299) : error WIX0103: Cannot find the File file 'C:\Program Files\Microsoft Visual Studio\18\Community\VC\Redist\MSVC\14.50.35710\x64\Microsoft.VC143.CRT/msvcp140_1.dll'. The following paths were checked: C:\Program Files\Microsoft Visual Studio\18\Community\VC\Redist\MSVC\14.50.35710\x64\Microsoft.VC143.CRT/msvcp140_1.dll
D:\bazel_root\output\3spnzsgp\execroot\_main\win32\installer\installer_oss_64bit.wxs(302) : error WIX0103: Cannot find the File file 'C:\Program Files\Microsoft Visual Studio\18\Community\VC\Redist\MSVC\14.50.35710\x64\Microsoft.VC143.CRT/msvcp140_2.dll'. The following paths were checked: C:\Program Files\Microsoft Visual Studio\18\Community\VC\Redist\MSVC\14.50.35710\x64\Microsoft.VC143.CRT/msvcp140_2.dll
D:\bazel_root\output\3spnzsgp\execroot\_main\win32\installer\installer_oss_64bit.wxs(305) : error WIX0103: Cannot find the File file 'C:\Program Files\Microsoft Visual Studio\18\Community\VC\Redist\MSVC\14.50.35710\x64\Microsoft.VC143.CRT/vcruntime140.dll'. The following paths were checked: C:\Program Files\Microsoft Visual Studio\18\Community\VC\Redist\MSVC\14.50.35710\x64\Microsoft.VC143.CRT/vcruntime140.dll
D:\bazel_root\output\3spnzsgp\execroot\_main\win32\installer\installer_oss_64bit.wxs(308) : error WIX0103: Cannot find the File file 'C:\Program Files\Microsoft Visual Studio\18\Community\VC\Redist\MSVC\14.50.35710\x64\Microsoft.VC143.CRT/vcruntime140_1.dll'. The following paths were checked: C:\Program Files\Microsoft Visual Studio\18\Community\VC\Redist\MSVC\14.50.35710\x64\Microsoft.VC143.CRT/vcruntime140_1.dll

Target //:package failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 4.375s, Critical Path: 3.62s
INFO: 2 processes: 93 action cache hit, 2 internal.
ERROR: Build did NOT complete successfully
PS D:\mozc\src> python build_mozc.py clean && python build_mozc.py gyp && python build_mozc.py build -c Debug package
D:\mozc\src\build_tools\vs_util.py:152: RuntimeWarning: Using Visual Studio newer than 17 has not been supported yet.
  warnings.warn(f'Using Visual Studio newer than {preferred_vs_version} has not been supported yet.', RuntimeWarning)
INFO: Generating version definition file...
INFO: Version string is 2.32.5994.100
INFO: Running: C:\Users\yukawa\AppData\Local\Programs\Python\Python313\python.exe D:\mozc\src\build_tools\ensure_gyp_module_path.py --expected=D:\mozc\src\third_party\gyp\pylib\gyp
INFO: Building GYP command line...
INFO: Running GYP...
INFO: Running: C:\Users\yukawa\AppData\Local\Programs\Python\Python313\python.exe D:\mozc\src\third_party\gyp\gyp_main.py --depth=. --include=./gyp/common_win.gypi -D abs_depth=D:\mozc\src -D ext_third_party_dir=D:\mozc\src\third_party -D python="C:\Users\yukawa\AppData\Local\Programs\Python\Python313\python.exe" ./data/test/session/scenario\scenario.gyp ./data_manager\oss\oss_data_manager.gyp ./data_manager\oss\oss_data_manager_base.gyp ./data_manager\oss\oss_data_manager_test.gyp ./data_manager\testing\mock_data_manager.gyp ./data_manager\testing\mock_data_manager_base.gyp ./data_manager\testing\mock_data_manager_test.gyp ./dictionary\file\dictionary_file.gyp ./dictionary\file\dictionary_file_test.gyp ./dictionary\system\system_dictionary.gyp ./dictionary\system\system_dictionary_test.gyp ./rewriter\calculator\calculator.gyp ./win32\base\win32_base.gyp ./win32\broker\broker.gyp ./win32\build32\build32.gyp ./win32\build64\build64.gyp ./win32\build64\build64_dynamic.gyp ./win32\cache_service\cache_service.gyp ./win32\custom_action\custom_action.gyp ./win32\installer\installer.gyp ./win32\tip\tip.gyp .\base\absl.gyp .\base\base.gyp .\base\base_test.gyp .\client\client.gyp .\client\client_test.gyp .\composer\composer.gyp .\composer\composer_test.gyp .\config\config.gyp .\config\config_test.gyp .\converter\converter.gyp .\converter\converter_base.gyp .\converter\converter_test.gyp .\converter\immutable_converter.gyp .\data_manager\data_manager.gyp .\data_manager\data_manager_base.gyp .\data_manager\data_manager_test.gyp .\dictionary\dictionary.gyp .\dictionary\dictionary_base.gyp .\dictionary\dictionary_test.gyp .\dictionary\pos_matcher.gyp .\engine\engine.gyp .\engine\engine_base.gyp .\engine\engine_test.gyp .\gui\gui.gyp .\gyp\tests.gyp .\ipc\ipc.gyp .\mac\mac.gyp .\prediction\prediction.gyp .\prediction\prediction_base.gyp .\prediction\prediction_test.gyp .\protobuf\protobuf.gyp .\protocol\protocol.gyp .\renderer\renderer.gyp .\request\request.gyp .\rewriter\rewriter.gyp .\rewriter\rewriter_base.gyp .\rewriter\rewriter_test.gyp .\server\server.gyp .\session\session.gyp .\session\session_base.gyp .\session\session_test.gyp .\storage\storage.gyp .\storage\storage_test.gyp .\testing\testing.gyp .\transliteration\transliteration.gyp .\transliteration\transliteration_test.gyp -D version=2.32.5994.100 -D short_version=2.32.5994 -D branding=Mozc -D use_qt=YES -D qt_dir=D:\mozc\src\third_party\qt -D qt_ver=6 -D use_wix=YES -D build_base=D:\mozc\src\out_win -D build_short_base=out_win -D channel_dev=1 -D target_platform=Windows -G msvs_version=2022 --generator-output=. -G output_dir=out_win
Traceback (most recent call last):
  File "D:\mozc\src\third_party\gyp\gyp_main.py", line 16, in <module>
    sys.exit(gyp.script_main())
             ~~~~~~~~~~~~~~~^^
  File "D:\mozc\src\third_party\gyp\pylib\gyp\__init__.py", line 552, in script_main
    return main(sys.argv[1:])
  File "D:\mozc\src\third_party\gyp\pylib\gyp\__init__.py", line 545, in main
    return gyp_main(args)
  File "D:\mozc\src\third_party\gyp\pylib\gyp\__init__.py", line 518, in gyp_main
    [generator, flat_list, targets, data] = Load(
                                            ~~~~^
        build_files, format, cmdline_default_variables, includes, options.depth,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        params, options.check, options.circular_check,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        options.duplicate_basename_check)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\mozc\src\third_party\gyp\pylib\gyp\__init__.py", line 105, in Load
    generator.CalculateVariables(default_variables, params)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\mozc\src\third_party\gyp\pylib\gyp\generator\ninja.py", line 1702, in CalculateVariables
    gyp.msvs_emulation.CalculateCommonVariables(default_variables, params)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\mozc\src\third_party\gyp\pylib\gyp\msvs_emulation.py", line 1107, in CalculateCommonVariables
    msvs_version = gyp.msvs_emulation.GetVSVersion(generator_flags)
  File "D:\mozc\src\third_party\gyp\pylib\gyp\msvs_emulation.py", line 954, in GetVSVersion
    vs_version = gyp.MSVSVersion.SelectVisualStudioVersion(
        generator_flags.get('msvs_version', 'auto'),
        allow_fallback=False)
  File "D:\mozc\src\third_party\gyp\pylib\gyp\MSVSVersion.py", line 531, in SelectVisualStudioVersion
    raise ValueError('Could not locate Visual Studio installation.')
ValueError: Could not locate Visual Studio installation.
Traceback (most recent call last):
  File "D:\mozc\src\build_mozc.py", line 911, in <module>
    sys.exit(main())
             ~~~~^^
  File "D:\mozc\src\build_mozc.py", line 893, in main
    GypMain(cmd_opts, cmd_args)
    ~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "D:\mozc\src\build_mozc.py", line 552, in GypMain
    RunOrDie(gyp_command + gyp_options)
    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\mozc\src\build_tools\util.py", line 140, in RunOrDie
    raise RunOrDieError('\n'.join(['',
    ...<2 lines>...
                                   '==========']))
build_tools.util.RunOrDieError:
==========
 ERROR: C:\Users\yukawa\AppData\Local\Programs\Python\Python313\python.exe D:\mozc\src\third_party\gyp\gyp_main.py --depth=. --include=./gyp/common_win.gypi -D abs_depth=D:\mozc\src -D ext_third_party_dir=D:\mozc\src\third_party -D python="C:\Users\yukawa\AppData\Local\Programs\Python\Python313\python.exe" ./data/test/session/scenario\scenario.gyp ./data_manager\oss\oss_data_manager.gyp ./data_manager\oss\oss_data_manager_base.gyp ./data_manager\oss\oss_data_manager_test.gyp ./data_manager\testing\mock_data_manager.gyp ./data_manager\testing\mock_data_manager_base.gyp ./data_manager\testing\mock_data_manager_test.gyp ./dictionary\file\dictionary_file.gyp ./dictionary\file\dictionary_file_test.gyp ./dictionary\system\system_dictionary.gyp ./dictionary\system\system_dictionary_test.gyp ./rewriter\calculator\calculator.gyp ./win32\base\win32_base.gyp ./win32\broker\broker.gyp ./win32\build32\build32.gyp ./win32\build64\build64.gyp ./win32\build64\build64_dynamic.gyp ./win32\cache_service\cache_service.gyp ./win32\custom_action\custom_action.gyp ./win32\installer\installer.gyp ./win32\tip\tip.gyp .\base\absl.gyp .\base\base.gyp .\base\base_test.gyp .\client\client.gyp .\client\client_test.gyp .\composer\composer.gyp .\composer\composer_test.gyp .\config\config.gyp .\config\config_test.gyp .\converter\converter.gyp .\converter\converter_base.gyp .\converter\converter_test.gyp .\converter\immutable_converter.gyp .\data_manager\data_manager.gyp .\data_manager\data_manager_base.gyp .\data_manager\data_manager_test.gyp .\dictionary\dictionary.gyp .\dictionary\dictionary_base.gyp .\dictionary\dictionary_test.gyp .\dictionary\pos_matcher.gyp .\engine\engine.gyp .\engine\engine_base.gyp .\engine\engine_test.gyp .\gui\gui.gyp .\gyp\tests.gyp .\ipc\ipc.gyp .\mac\mac.gyp .\prediction\prediction.gyp .\prediction\prediction_base.gyp .\prediction\prediction_test.gyp .\protobuf\protobuf.gyp .\protocol\protocol.gyp .\renderer\renderer.gyp .\request\request.gyp .\rewriter\rewriter.gyp .\rewriter\rewriter_base.gyp .\rewriter\rewriter_test.gyp .\server\server.gyp .\session\session.gyp .\session\session_base.gyp .\session\session_test.gyp .\storage\storage.gyp .\storage\storage_test.gyp .\testing\testing.gyp .\transliteration\transliteration.gyp .\transliteration\transliteration_test.gyp -D version=2.32.5994.100 -D short_version=2.32.5994 -D branding=Mozc -D use_qt=YES -D qt_dir=D:\mozc\src\third_party\qt -D qt_ver=6 -D use_wix=YES -D build_base=D:\mozc\src\out_win -D build_short_base=out_win -D channel_dev=1 -D target_platform=Windows -G msvs_version=2022 --generator-output=. -G output_dir=out_win
=========

I don't know why you didn't get the errors above, but if it works for you can maintain your patch locally for now?

@yukawa
Copy link
Collaborator

yukawa commented Nov 24, 2025

If there are blockers, developers should report them here.

I created a discussion thread for people to keep posting there findings towards using Visual Studio 2026 to build package for Mozc. Feel free to use it.

@tats-u
Copy link
Contributor Author

tats-u commented Nov 24, 2025

I got a build error in one of the 3 commands, but different error message that shows the hard-code of VS 2022 path and suggests the execution of bazel clean.

It may be better to add a new option like --vs_version=18.

@tats-u
Copy link
Contributor Author

tats-u commented Nov 24, 2025

bazelisk build --config oss_windows --config release_build package fails:

Starting local Bazel server (8.4.1) and connecting to it...
ERROR: Analysis of target '//:package' failed; build aborted: Inconsistent filesystem operations. C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC is no longer an existing directory. Did you delete it during the build? The results of the build are not guaranteed to be correct. You should probably run 'bazel clean' and investigate the filesystem inconsistency (likely due to filesystem updates concurrent with the build)
INFO: Elapsed time: 11.096s, Critical Path: 0.09s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully                                                                                                                                                                                 
FAILED:                                                                                                                                                                                                                    
    Fetching repository @@+_repo_rules5+wix; starting                                                                                                                                                                      
    Fetching repository @@rules_shell++sh_configure+local_config_shell; starting    

build_qt.py went well by this PR.

@yukawa
Copy link
Collaborator

yukawa commented Nov 24, 2025

ERROR: Analysis of target '//:package' failed; build aborted: Inconsistent filesystem operations. C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC is no longer an existing directory. Did you delete it during the build? The results of the build are not guaranteed to be correct. You should probably run 'bazel clean' and investigate the filesystem inconsistency (likely due to filesystem updates concurrent with the build)

If bazel clean didn't work, try the following command.

bazelisk clean --expunge

I suspect that the situation you were hitting is similar to the following case, when the result of pkg-config is updated because of the system-level change in Linux.

@tats-u
Copy link
Contributor Author

tats-u commented Nov 30, 2025

The error message was changed:

ERROR: C:/users/tatsu/_bazel_tatsu/nxrrjfsa/external/rules_swift++non_module_deps+build_bazel_rules_swift_local_config/BUILD:54:58: name 'arch' is not defined
ERROR: package contains errors: : name 'arch' is not defined
ERROR: C:/users/tatsu/_bazel_tatsu/nxrrjfsa/external/rules_cc+/cc/private/toolchain/BUILD:107:14: While resolving toolchains for target @@rules_cc+//cc/private/toolchain:compiler (bbda444): invalid registered toolchain '@build_bazel_rules_swift_local_config//:all': Error evaluating '@build_bazel_rules_swift_local_config//:all': error loading package '@@rules_swift++non_module_deps+build_bazel_rules_swift_local_config//': Package '' contains errors  
ERROR: I:/mozc/src/BUILD.bazel:108:29: errors encountered resolving select() keys for //:compiler_msvc_like                                            
ERROR: I:/mozc/src/renderer/win32/BUILD.bazel:48:26: errors encountered resolving select() keys for //renderer/win32:mozc_renderer.exe                 
ERROR: Analysis of target '//:package' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.507s, Critical Path: 0.04s                                                                                                       
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully                                                                                                             
FAILED:                                                                                                                                                
    Fetching repository @@+_repo_rules5+wix; starting                                                                                                  
    Fetching repository @@rules_cc++cc_configure_extension+local_config_cc; starting 

I do not have sufficient knowledge on Bazel to fix this error by myself unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants