ValueError: path is on mount '\\\\history_cluster_types.mojom-webui.js', start on mount 'C:'

1,116 views
Skip to first unread message

吴锦林

unread,
Jun 30, 2023, 4:28:50 PM6/30/23
to Chromium-dev
Hey, I clone my source code to C:chrome\src, and use autoninja -C out\debug chrome to build chromium... and this error happened..

``` c++
PS C:\chrome\src> autoninja -C out\book chrome
"C:\Users\18f\Desktop\18_floor\source_code\build_chromium_tools\depot_tools\bootstrap-2@3_8_10_chromium_26_bin\python3\bin\python3.exe" C:\Users\18f\Desktop\18_floor\source_code\build_chromium_tools\depot_tools\ninja.py -C out\book chrome -j 22
ninja: Entering directory `out\book'
[212/36225] ACTION //chrome/browser/media:mojo_bindings_ts__generator(//build/toolchain/win:win_clang_x64)
<module 'ntpath' (frozen)>
<module 'ntpath' (frozen)>
[224/36214] ACTION //chrome/browser/new_tab_page/modules/history_clusters:mojo_bindings_ts__generator(//build/toolchain/win:win_clang_x64)
FAILED: gen/chrome/browser/new_tab_page/modules/history_clusters/history_clusters.mojom-webui.ts
C:/Users/18f/AppData/Local/Programs/Python/Python311/python3.exe ../../mojo/public/tools/bindings/mojom_bindings_generator.py --use_bundled_pylibs -o gen generate -d ../../ -I ../../ --bytecode_path gen/mojo/public/tools/bindings --filelist=__chrome_browser_new_tab_page_modules_history_clusters_mojo_bindings_ts__generator___build_toolchain_win_win_clang_x64__rule..rsp -g typescript --scrambled_message_id_salt_path ../../chrome/VERSION
<module 'ntpath' (frozen)>
Traceback (most recent call last):
  File "C:\chrome\src\mojo\public\tools\bindings\mojom_bindings_generator.py", line 418, in <module>
    ret = main()
          ^^^^^^
  File "C:\chrome\src\mojo\public\tools\bindings\mojom_bindings_generator.py", line 413, in main
    return args.func(args, remaining_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\chrome\src\mojo\public\tools\bindings\mojom_bindings_generator.py", line 275, in _Generate
    processor._GenerateModule(
  File "C:\chrome\src\mojo\public\tools\bindings\mojom_bindings_generator.py", line 243, in _GenerateModule
    generator.GenerateFiles(filtered_args)
  File "C:\chrome\src\mojo\public\tools\bindings\generators\mojom_ts_generator.py", line 264, in GenerateFiles
    self.WriteWithComment(self._GenerateWebUiModule(),
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\chrome\src\mojo\public\tools\mojom\mojom\generate\template_expander.py", line 34, in GeneratorInternal
    parameters = generator(*args, **kwargs2)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\chrome\src\mojo\public\tools\bindings\generators\mojom_ts_generator.py", line 250, in _GenerateWebUiModule
    return self._GetParameters()
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\chrome\src\mojo\public\tools\bindings\generators\mojom_ts_generator.py", line 216, in _GetParameters
    self._GetJsModuleImports(),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\chrome\src\mojo\public\tools\bindings\generators\mojom_ts_generator.py", line 617, in _GetJsModuleImports
    os.path.relpath(
  File "<frozen ntpath>", line 754, in relpath
ValueError: path is on mount '\\\\history_cluster_types.mojom-webui.js', start on mount 'C:'
[240/36196] ACTION //chrome/browser/ui/webui/access_code_cast:mojo_bindings_ts__generator(//build/toolchain/win:win_clang_x64)
<module 'ntpath' (frozen)>
[241/36194] ACTION //chrome/browser/ui/webui/app_home:mojo_bindings_ts__generator(//build/toolchain/win:win_clang_x64)
<module 'ntpath' (frozen)>
[245/36190] CXX obj/v8/cppgc_base/allocation.obj
ninja: build stopped: subcommand failed.
PS C:\chrome\src>
```

Anybody know what happened? thx

yn...@vivaldi.com

unread,
Jun 30, 2023, 5:22:39 PM6/30/23
to 1214...@gmail.com, Chromium-dev
Hi,

It sounds like you  are using Python 3.11.2 or newer.

That version of Python cannot be used with Chromium's mojom scripts until https://crbug.com/1422178 (which I reported 4 months ago) has been fixed.

I recommend that you revert to 3.11.1 or older.

The cause of the problem is a change to how relative paths are handled, and some mojom file paths are on the form //foo, which are considered UNC paths by the newer python versions
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/d33ff7b1-d857-448b-be76-119568d20a78n%40chromium.org.

-- 
Sincerely,
Yngve N. Pettersen
Vivaldi Technologies AS

Christian Biesinger

unread,
Jun 30, 2023, 5:25:25 PM6/30/23
to yn...@vivaldi.com, 1214...@gmail.com, Chromium-dev
If that's the case, it could probably be fixed by ensuring that
depot_tools is first in the path (like the build instructions say)?

Christian
> To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/1688159735763.3052491285.4099964465%40vivaldi.com.

yn...@vivaldi.com

unread,
Jun 30, 2023, 5:40:58 PM6/30/23
to Christian Biesinger, 1214...@gmail.com, Chromium-dev

Hi,

In our case we are always using the system Python.

We don't have a main depot_tools on our systems, and only use a very limited set of the third_party module's scripts (essentially CIPD and a heavily customized gclient, since we generally use git submodules)

As I recall we had issues with at least some of the bootstrapped tools, so we are avoiding them after getting burned, and additionally, we have our own versions of several tools in the depot_tools, so we definitely don't want depot_tools at the front of the path.

On 30 June, 2023 17:23:02 (-04:00), Christian Biesinger wrote:

> If that's the case, it could probably be fixed by ensuring that
> depot_tools is first in the path (like the build instructions say)?
>
> Christian
>
> On Fri, Jun 30, 2023 at 5:21 PM yngve via Chromium-dev
> wrote:
> >
> > Hi,
> >
> > It sounds like you are using Python 3.11.2 or newer.
> >
> > That version of Python cannot be used with Chromium's mojom scripts until https://crbug.com/1422178 (which I reported 4 months ago) has been fixed.
> >
> > I recommend that you revert to 3.11.1 or older.
> >
> > The cause of the problem is a change to how relative paths are handled, and some mojom file paths are on the form //foo, which are considered UNC paths by the newer python versions
> >
> > On 29 June, 2023 21:48:39 (-04:00), 吴锦林 wrote:
> >
> > Hey, I clone my source code to C:chrome\src, and use autoninja -C out\debug chrome to build chromium... and this error happened..
> >
> > ``` c++
> > PS C:\chrome\src> autoninja -C out\book chrome
> > "C:\Users\18f\Desktop\18_floor\source_code\build_chromium_tools\depot_tools\bootstrap-2@3_8_10_chromium_26_bin\python3\bin\python3.exe" C:\Users\18f\Desktop\18_floor\source_code\build_chromium_tools\depot_tools\ninja.py -C out\book chrome -j 22
> > ninja: Entering directory `out\book'
> > [212/36225] ACTION //chrome/browser/media:mojo_bindings_ts__generator(//build/toolchain/win:win_clang_x64)
> >
> >
> > [224/36214] ACTION //chrome/browser/new_tab_page/modules/history_clusters:mojo_bindings_ts__generator(//build/toolchain/win:win_clang_x64)
> > FAILED: gen/chrome/browser/new_tab_page/modules/history_clusters/history_clusters.mojom-webui.ts
> > C:/Users/18f/AppData/Local/Programs/Python/Python311/python3.exe ../../mojo/public/tools/bindings/mojom_bindings_generator.py --use_bundled_pylibs -o gen generate -d ../../ -I ../../ --bytecode_path gen/mojo/public/tools/bindings --filelist=__chrome_browser_new_tab_page_modules_history_clusters_mojo_bindings_ts__generator___build_toolchain_win_win_clang_x64__rule..rsp -g typescript --scrambled_message_id_salt_path ../../chrome/VERSION
> >
> > Traceback (most recent call last):
> > File "C:\chrome\src\mojo\public\tools\bindings\mojom_bindings_generator.py", line 418, in
> > ret = main()
> > ^^^^^^
> > File "C:\chrome\src\mojo\public\tools\bindings\mojom_bindings_generator.py", line 413, in main
> > return args.func(args, remaining_args)
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > File "C:\chrome\src\mojo\public\tools\bindings\mojom_bindings_generator.py", line 275, in _Generate
> > processor._GenerateModule(
> > File "C:\chrome\src\mojo\public\tools\bindings\mojom_bindings_generator.py", line 243, in _GenerateModule
> > generator.GenerateFiles(filtered_args)
> > File "C:\chrome\src\mojo\public\tools\bindings\generators\mojom_ts_generator.py", line 264, in GenerateFiles
> > self.WriteWithComment(self._GenerateWebUiModule(),
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > File "C:\chrome\src\mojo\public\tools\mojom\mojom\generate\template_expander.py", line 34, in GeneratorInternal
> > parameters = generator(*args, **kwargs2)
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > File "C:\chrome\src\mojo\public\tools\bindings\generators\mojom_ts_generator.py", line 250, in _GenerateWebUiModule
> > return self._GetParameters()
> > ^^^^^^^^^^^^^^^^^^^^^
> > File "C:\chrome\src\mojo\public\tools\bindings\generators\mojom_ts_generator.py", line 216, in _GetParameters
> > self._GetJsModuleImports(),
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^
> > File "C:\chrome\src\mojo\public\tools\bindings\generators\mojom_ts_generator.py", line 617, in _GetJsModuleImports
> > os.path.relpath(
> > File "", line 754, in relpath
> > ValueError: path is on mount '\\\\history_cluster_types.mojom-webui.js', start on mount 'C:'
> > [240/36196] ACTION //chrome/browser/ui/webui/access_code_cast:mojo_bindings_ts__generator(//build/toolchain/win:win_clang_x64)
> >
> > [241/36194] ACTION //chrome/browser/ui/webui/app_home:mojo_bindings_ts__generator(//build/toolchain/win:win_clang_x64)
> >

K. Moon

unread,
Jun 30, 2023, 5:49:45 PM6/30/23
to yn...@vivaldi.com, Christian Biesinger, 1214...@gmail.com, Chromium-dev
If you know what you're doing (and are prepared to accept the cost of debugging any problems), I think that's a separate case. There's nothing wrong with that, but those working on Chromium itself are expected to use the supported toolchains, especially when asking for help; it's not scalable to support arbitrary other configurations.

yn...@vivaldi.com

unread,
Jun 30, 2023, 7:07:11 PM6/30/23
to K. Moon, Christian Biesinger, 1214...@gmail.com, Chromium-dev
Hi,

We have been running this system for close to 10 years now, so I think we can say that we are doing OK.

In any case, the bottom line is that Chromium's own bootstrapped Python version (which is AFAICT at least 3 major versions behind mainline Python) cannot be updated to 3.11.2+ on Windows before that issue I filed has been resolved.

Bruce Dawson

unread,
Jul 1, 2023, 6:40:08 PM7/1/23
to Chromium-dev, yn...@vivaldi.com, Christian Biesinger, 1214...@gmail.com, Chromium-dev, K. Moon
Have you tried bisecting to find out what change introduced the issue?

Alternately, a fix would be appreciated. As you say, we'll need to upgrade Python versions at some point.

Yngve N. Pettersen

unread,
Jul 4, 2023, 6:42:42 AM7/4/23
to Bruce Dawson, Chromium-dev, Christian Biesinger, 1214...@gmail.com, Chromium-dev, K. Moon
Unfortunately, I suspect that the problem is so fundamental to the system and goes back such a long way that a bisect is probably impractical.

As for fixing it, as I recall, the previous times I tried to fix something major in those scripts, I made a mess of it, so I think that is unlikely. IIRC it took the vewd devs to fix that old issue before a later upstream fix finally solved the issue.

The base issue is rather simple: Some mojom path calculations create a "//path" (which wasn't a problem until Python fixed the UNC relative path calculation on Windows), and it's been doing that for years as I recall, so my current guess is that the whole path calculation system will have to be fundamentally rewritten.

吴锦林

unread,
Jul 4, 2023, 6:42:42 AM7/4/23
to Chromium-dev, yn...@vivaldi.com, Christian Biesinger, 1214...@gmail.com, Chromium-dev, K. Moon
uhhh, Thank u!

Christian Biesinger

unread,
Jul 4, 2023, 1:33:33 PM7/4/23
to yn...@vivaldi.com, K. Moon, 1214...@gmail.com, Chromium-dev
To clarify, my comment was targeted at the OP. I know Yngve is doing
ok with their setup :)

Christian

Hoài Nông (Ohia)

unread,
Feb 26, 2024, 10:51:33 AM2/26/24
to Chromium-dev, 吴锦林
If you have successfully built before, you can type gclient revert in the command prompt.
Vào lúc 03:28:50 UTC+7 ngày Thứ Bảy, 1 tháng 7, 2023, 吴锦林 đã viết:
Reply all
Reply to author
Forward
0 new messages