Skip to content

Successful Builds Since 2022? #402

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

Open
smblogger opened this issue Nov 24, 2024 · 10 comments
Open

Successful Builds Since 2022? #402

smblogger opened this issue Nov 24, 2024 · 10 comments

Comments

@smblogger
Copy link

Has anybody successfully build this from scratch for the last few years? I see a lot of deprecation including Rust which is quite old. Just wondering if I am chasing a dead horse or not. Would be nice to know the success rate, and if anybody has any mods to make it finish up it's build without error, (delete source takes forever, try again).

Thanks,

BigWil

@networkException
Copy link
Member

What do you mean by "from scratch"? Our CI builds every release from source as well as the maintainers for testing

@teeminus
Copy link
Contributor

Or did you confuse this repo with the following: https://github.com/macchrome/winchrome

@smblogger
Copy link
Author

smblogger commented Nov 25, 2024

Yes, I understand what the CI does. Though it seems the dependencies are having difficulty working together which I see a lot when something isn't quite maintained over a couple years. I've been through the typically seen build errors here, esbuild, rust, directx, then back to rust, now clang. The inconsistency I find very odd. I've tried in the Visual Code terminal, also cmd terminal all as user and as administrator. Just odd. Last night was my closest and made it to the ninja building. But a las dead in the water.

-- snipped --

@smblogger smblogger changed the title Successful Builds Since 2020? Successful Builds Since 2022? Nov 25, 2024
@smblogger
Copy link
Author

smblogger commented Nov 26, 2024

Probably time to start updating things requiring python 3.10. What I meant by from scratch is from clean directory and Git to the "First-time setup" forward. Re-running under the previous setup environment is probably doing fine for you guys. I think the issue is python 3.10 vs 3.12. Rust is outdated now too.

Many of the tools in the "python3 ungoogled-chromium\utils\clone.py -o build\src" segment are cloning themselves and installing with python3.12 so lets hope those have back compatibility with 3.10.

MSYS2 MSYS "pacman -S quilt python3 vim tar dos2unix" will no longer install 3.10. Forces to 3.12.

So then the patch checks fail, probably related.

$ source devutils/set_quilt_vars.sh
$ cd build/src
$ grep -r ../../patches/ -e "^+++" | awk '{print substr($2,3)}' | xargs dos2unix
$ ./devutils/check_patch_files.sh

++++ readlink -f ./devutils/check_patch_files.sh
+++ dirname /c/users/wil/webapps/chromiumbrowser/buildone/ungoogled-chromium-windows/devutils/check_patch_files.sh
++ dirname /c/users/wil/webapps/chromiumbrowser/buildone/ungoogled-chromium-windows/devutils

  • PLATFORM_ROOT=/c/users/wil/webapps/chromiumbrowser/buildone/ungoogled-chromium-windows
  • UNGOOGLED_REPO=/c/users/wil/webapps/chromiumbrowser/buildone/ungoogled-chromium-windows/ungoogled-chromium
  • /c/users/wil/webapps/chromiumbrowser/buildone/ungoogled-chromium-windows/ungoogled-chromium/devutils/check_patch_files.py -p /c/users/wil/webapps/chromiumbrowser/buildone/ungoogled-chromium-windows/patches
    Traceback (most recent call last):
    File "/c/users/wil/webapps/chromiumbrowser/buildone/ungoogled-chromium-windows/ungoogled-chromium/devutils/check_patch_files.py", line 19, in
    import argparse
    File "/usr/lib/python3.12/argparse.py", line 89, in
    import re as _re
    File "/usr/lib/python3.12/re/init.py", line 124, in
    import enum
    File "/usr/lib/python3.12/enum.py", line 3, in
    from types import MappingProxyType, DynamicClassAttribute
    ModuleNotFoundError: No module named 'types'

Meanwhile back in Cmd

INFO: Unpacking "esbuild" to third_party/devtools-frontend/src/third_party/esbuild ...
Traceback (most recent call last):
File "C:\Users\Wil\WebApps\ChromiumBrowser\buildone\ungoogled-chromium-windows\build.py", line 305, in
main()
File "C:\Users\Wil\WebApps\ChromiumBrowser\buildone\ungoogled-chromium-windows\build.py", line 202, in main
downloads.unpack_downloads(download_info_win, downloads_cache, None, source_tree, False, None, extractors)
File "C:\Users\Wil\WebApps\ChromiumBrowser\buildone\ungoogled-chromium-windows\ungoogled-chromium\utils\downloads.py", line 377, in unpack_downloads
extractor_func(archive_path=download_path,
File "C:\Users\Wil\WebApps\ChromiumBrowser\buildone\ungoogled-chromium-windows\ungoogled-chromium\utils_extraction.py", line 236, in extract_tar_file
_extract_tar_with_7z(sevenzip_bin, archive_path, output_dir, relative_to, skip_unused,
File "C:\Users\Wil\WebApps\ChromiumBrowser\buildone\ungoogled-chromium-windows\ungoogled-chromium\utils_extraction.py", line 116, in _extract_tar_with_7z
_process_relative_to(output_dir, relative_to)
File "C:\Users\Wil\WebApps\ChromiumBrowser\buildone\ungoogled-chromium-windows\ungoogled-chromium\utils_extraction.py", line 87, in _process_relative_to
src_path.rename(dest_path)
File "C:\Users\Wil\AppData\Local\Programs\Python\Python310\lib\pathlib.py", line 1234, in rename
self._accessor.rename(self, target)
FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\Users\Wil\WebApps\ChromiumBrowser\buildone\ungoogled-chromium-windows\build\src\third_party\devtools-frontend\src\third_party\esbuild\package\bin' -> 'C:\Users\Wil\WebApps\ChromiumBrowser\buildone\ungoogled-chromium-windows\build\src\third_party\devtools-frontend\src\third_party\esbuild\bin'

Then more errors out of various others as mentioned before. To reproduce all of this try it on a clean setup using those first time setup instructions. And why it's complaining about file already exists above i have no clue since it was a cleared build/src folder. Everything is just going to hell in a handbasket.

Cleaned src and build.py again...........

warning: trait HasFloat is never used
--> bindgen\ir\item.rs:89:18
|
89 | pub(crate) trait HasFloat {
| ^^^^^^^^
|
= note: #[warn(dead_code)] on by default

warning: bindgen (lib) generated 1 warning
Compiling bindgen-cli v0.69.4 (C:\Users\Wil\WebApps\ChromiumBrowser\buildone\ungoogled-chromium-windows\build\src\third_party\rust-toolchain-intermediate\bindgen-src\bindgen-cli)
Finished release profile [optimized] target(s) in 1m 39s
Installing bindgen to C:\Users\Wil\WebApps\ChromiumBrowser\buildone\ungoogled-chromium-windows\build\src\third_party\rust-toolchain ...

C:\Users\Wil\WebApps\ChromiumBrowser\buildone\ungoogled-chromium-windows\build\src>exit
C:\Users\Wil\WebApps\ChromiumBrowser\buildone\ungoogled-chromium-windows\build\src>call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" >nul

C:\Users\Wil\WebApps\ChromiumBrowser\buildone\ungoogled-chromium-windows\build\src>set DEPOT_TOOLS_WIN_TOOLCHAIN=0

C:\Users\Wil\WebApps\ChromiumBrowser\buildone\ungoogled-chromium-windows\build\src>"third_party\ninja\ninja.exe" "-C" "out\Default" "chrome" "chromedriver" "mini_installer"
ninja: error: win_clang_x64_for_rust_host_build_tools/toolchain.ninja:126: loading 'win_clang_x64_for_rust_host_build_tools/obj/build/rust/tests/test_rlib_crate/test_rlib_crate_associated_bin_test_rlib_crate_associated_bin_vunknown_build_script.ninja': The system cannot find the path specified.

@teeminus
Copy link
Contributor

I set up a new build machine a few months ago following the steps described in the README and it worked fine.

The rust version used during the build process is derived from the version google uses in their build (as described in the README).

Most of the python scripts used are part of the ungoogled-chromium repo which is used as a submodule for the windows build. Any issues with those scripts needs to be reported there.

You are completely right, python 3.10 is outdated. But so are a lot of the tools downloaded and used during the build process. We only update those downloads when needed and that's also true for the python version used. (That's why there is a build-in python version check in the build script so that we don't have to debug errors caused by an unsupported python version)

I noticed your checkout path is quite long/nested. Try moving the checked out folder to the root of your disk and check if this helps.

@smblogger
Copy link
Author

Yes. I did notice that one of the ninja/clang tests was failing and it dawned on me before reading above reply. I commented out that test line for now and ran ninja again and sure enough, it's still compiling. 250 characters exactly in my long path as you mentioned.

ninja: error: win_clang_x64_for_rust_host_build_tools/toolchain.ninja:126: loading 'win_clang_x64_for_rust_host_build_tools/obj/build/rust/tests/test_rlib_crate/test_rlib_crate_associated_bin_test_rlib_crate_associated_bin_vunknown_build_script.ninja': The system cannot find the path specified.

So my python 3.10 install didn't have a "button at end" to set the max_path/LongPathsEnabled registry entry. So I did it myself adding it to the registry through power shell. Guess what you have to do when you add a registry entry for LongPathsEnabled? You need to reboot for that one. A lot of registry entries don't require it these days, but that one does. Might want to add that under "Other build requirements" in the readme file.

So I think the last issue might be the Msys2 setup. How can we keep "pacman -S quilt python3 vim tar dos2unix" from doing it's own thing. I know many a packager but pacman I do not. It insists on 3.12 no matter what I do. We might need a note on that in the readme now too.

@smblogger
Copy link
Author

I was successful in the most simplified build and packaged as well. So it was for sure the max_path that was getting in the way. Those errors could really use some work. I think the pacman install worked okay on the patching even though it's at python 3.12 and throws that error.

Now as I add cutomizations to first run, initial_preferences, icons, constants, and OWNERS, is there a command to run a quick recompile. I tried some various ninja invocations but those result in error. Maybe we need to create a wiki article on customizations.

@Nifury
Copy link
Member

Nifury commented Nov 27, 2024

is there a command to run a quick recompile

python3 build.py --ci might work.

@smblogger
Copy link
Author

smblogger commented Dec 2, 2024

Wouldn't "third_party\ninja\ninja.exe -C out/Default chrome chromedriver mini_installer" from the src be quicker and more granular in the build. Or does it need to rerun everything else for some reason. build.py --ci seems a very long route since everything in src is already prebuilt from the first run. Just wondering.

@smblogger
Copy link
Author

smblogger commented Dec 3, 2024

I give up. Can find no way of rebuilding with modifications after first build. If I wanted a Chromium stock I would just download a binary and be done with it. Too many headaches on Windows I guess. The build tools just don't act right now in 2024 it seems. The following was after a perfect stock build. Does the same whether I adjust src or not; just will not rebuild ever. I hate Windows for things like this, don't know how Microsoft ever made it.

C:\ungoogled-chromium-windows>python3 build.py --ci
C:\ungoogled-chromium-windows\build\src>call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" >nul

C:\ungoogled-chromium-windows\build\src>set DEPOT_TOOLS_WIN_TOOLCHAIN=0

C:\ungoogled-chromium-windows\build\src>"third_party\ninja\ninja.exe" "-C" "out\Default" "chrome" "chromedriver" "mini_installer"
ninja: Entering directory `out\Default'
[1042/49465] ACTION //chrome/updater/app/server/win:updater_idl_idl_action(//build/toolchain/win:win_clang_x64)
FAILED: gen/chrome/updater/app/server/win/updater_idl.h gen/chrome/updater/app/server/win/updater_idl_i.c gen/chrome/updater/app/server/win/updater_idl.tlb gen/chrome/updater/app/server/win/updater_idl.dlldata.c gen/chrome/updater/app/server/win/updater_idl_p.c
C:/Users/Wil/AppData/Local/Programs/Python/Python310/python3.exe ../../build/toolchain/win/midl.py environment.x64 ../../third_party/win_build_output/midl/chrome/updater/app/server/win gen/chrome/updater/app/server/win ignore_proxy_stub, --SNIPPED-- ../../third_party/llvm-build/Release+Asserts/bin/clang-cl.exe gen/chrome/updater/app/server/win/updater_idl.template /char signed /env x64 /Oicf
Traceback (most recent call last):
File "C:\ungoogled-chromium-windows\build\src\build\toolchain\win\midl.py", line 459, in
sys.exit(main(sys.argv[1:]))
File "C:\ungoogled-chromium-windows\build\src\build\toolchain\win\midl.py", line 399, in main
overwrite_guids(
(os.path.join(outdir, file) if file else None
File "C:\ungoogled-chromium-windows\build\src\build\toolchain\win\midl.py", line 237, in overwrite_guids
overwrite_guids_tlb(tlb_file, dynamic_guids)
File "C:\ungoogled-chromium-windows\build\src\build\toolchain\win\midl.py", line 199, in overwrite_guids_tlb
contents, ntypes, type_off, guid_off, guid_len = get_tlb_contents(tlb_file)
File "C:\ungoogled-chromium-windows\build\src\build\toolchain\win\midl.py", line 104, in get_tlb_contents
assert contents[0:8] == b'MSFT\x02\x00\x01\x00'
AssertionError
[1044/49465] ACTION //chrome/updater/app/server/win:updater_legacy_idl_idl_action(//build/toolchain/win:win_clang_x64)
FAILED: gen/chrome/updater/app/server/win/updater_legacy_idl.h gen/chrome/updater/app/server/win/updater_legacy_idl_i.c gen/chrome/updater/app/server/win/updater_legacy_idl.tlb gen/chrome/updater/app/server/win/updater_legacy_idl.dlldata.c gen/chrome/updater/app/server/win/updater_legacy_idl_p.c
C:/Users/Wil/AppData/Local/Programs/Python/Python310/python3.exe ../../build/toolchain/win/midl.py environment.x64 ../../third_party/win_build_output/midl/chrome/updater/app/server/win gen/chrome/updater/app/server/win ignore_proxy_stub, --SNIPPED-- gen/chrome/updater/app/server/win/updater_legacy_idl.template /char signed /env x64 /Oicf
Traceback (most recent call last):
File "C:\ungoogled-chromium-windows\build\src\build\toolchain\win\midl.py", line 459, in
sys.exit(main(sys.argv[1:]))
File "C:\ungoogled-chromium-windows\build\src\build\toolchain\win\midl.py", line 399, in main
overwrite_guids(
(os.path.join(outdir, file) if file else None
File "C:\ungoogled-chromium-windows\build\src\build\toolchain\win\midl.py", line 237, in overwrite_guids
overwrite_guids_tlb(tlb_file, dynamic_guids)
File "C:\ungoogled-chromium-windows\build\src\build\toolchain\win\midl.py", line 199, in overwrite_guids_tlb
contents, ntypes, type_off, guid_off, guid_len = get_tlb_contents(tlb_file)
File "C:\ungoogled-chromium-windows\build\src\build\toolchain\win\midl.py", line 104, in get_tlb_contents
assert contents[0:8] == b'MSFT\x02\x00\x01\x00'
AssertionError
[1051/49465] ACTION //components/policy:generate_policy_templates(//build/toolchain/win:win_clang_x64)
ninja: build stopped: subcommand failed.

C:\ungoogled-chromium-windows\build\src>exit
Traceback (most recent call last):
File "C:\ungoogled-chromium-windows\build.py", line 305, in
main()
File "C:\ungoogled-chromium-windows\build.py", line 294, in main
_run_build_process_timeout('third_party\ninja\ninja.exe', '-C', 'out\Default', 'chrome',
File "C:\ungoogled-chromium-windows\build.py", line 89, in _run_build_process_timeout
raise RuntimeError('Build failed!')
RuntimeError: Build failed!

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

No branches or pull requests

4 participants