Closed caesarw closed 1 year ago
Did you build this using makechrootpkg
? I'm working on getting a successful build before I merge and at least one thing, aom
came up as a missing dependency. If you were able to build it at all I'm speculating you did so on your host system that happened to have other packages available and not in a clean chroot, is that correct?
No action required at this point, I'm massaging the sources to get this fixed, just curious to make sure I'm drawing the right conclusions about dependencies.
aom
came up as a missing dependency.
Sorry, I'm too careless and forgot to add system libs to depend
. This should be fixed now.
Thanks. I'd already made that minor adjustment though (and actually the way you did is isn't quite right because it doesn't work with makepkg --printsrcinfo
, but I can fix that easily enough. The real issue is that even your exact version still doesn't build for me in a clean CHROOT. It eventually dies with something along these lines:
error: unknown argument: '-fexperimental-max-bitint-width=256'
[67/2021] CXX obj/third_party/abseil-cpp/absl/strings/cord_internal/cord_rep_btree_navigator.o
FAILED: obj/third_party/abseil-cpp/absl/strings/cord_internal/cord_rep_btree_navigator.o
clang++ -MMD -MF obj/third_party/abseil-cpp/absl/strings/cord_internal/cord_rep_btree_navigator.o.d -DBRAVE_GET_TARGET_FOR_DEFAULT_APP_SETTINGS= -DBRAVE_SCOPED_ALLOW_BASE_SYNC_PRIMITIVES_H= -DBRAVE_INTERNAL_TRACE_LIST_BUILTIN_CATEGORIES\(X\)= -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_OZONE=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DABSL_ALLOCATOR_NOTHROW=1 -I../.. -Igen -I../../third_party/abseil-cpp -Xclang -fexperimental-max-bitint-width=256 -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -no-canonical-prefixes -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wall -Wno-unused-variable -Wno-c++11-narrowing -Wno-unused-but-set-variable -Wno-misleading-indentation -Wno-missing-field-initializers -Wno-unused-parameter -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-psabi -Wno-ignored-pragma-optimize -Wno-deprecated-builtins -Wno-bitfield-constant-conversion -std=c++17 -Wno-trigraphs -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -Wbool-conversion -Wconstant-conversion -Wenum-conversion -Wint-conversion -Wliteral-conversion -Wnon-literal-null-conversion -Wnull-conversion -Wobjc-literal-conversion -Wno-sign-conversion -Wstring-conversion -Wbitfield-enum-conversion -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -flto=auto -Wno-builtin-macro-redefined -Wno-unknown-warning-option -c ../../third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.cc -o obj/third_party/abseil-cpp/absl/strings/cord_internal/cord_rep_btree_navigator.o
error: unknown argument: '-fexperimental-max-bitint-width=256'
[68/2021] ACTION //base:anchor_functions_buildflags(//build/toolchain/linux/unbundle:default)
[69/2021] ACTION //base:cfi_buildflags(//build/toolchain/linux/unbundle:default)
[70/2021] ACTION //base:clang_profiling_buildflags(//build/toolchain/linux/unbundle:default)
[71/2021] ACTION //base:debugging_buildflags(//build/toolchain/linux/unbundle:default)
ninja: build stopped: subcommand failed.
null
null
==> ERROR: A failure occurred in build().
I'd already made that minor adjustment though (and actually the way you did is isn't quite right because it doesn't work with
makepkg --printsrcinfo
, but I can fix that easily enough.
Thanks for pointing out that! Actually for that I was referring to the official PKGBUILD from Arch repo, but it's always nicer to have a better way.
The real issue is that even your exact version still doesn't build for me in a clean CHROOT.
The very direct cause for the error is that clang 14
does not support the compiler option -fexperimental-max-bitint-width=256
. However, on clang 15.0.0
or greater, the option is supported.
For Arch, the official repo is missing out clang 15.0.0
(current version in Arch repo is clang 14.0.6
), as pointed out here:
- This newer version of Brave needs to be built with
clang 15.0.0
or newer (i.e. usellvm-git
from AUR, but oncellvm
in Arch repo is updated, installing from AUR is no longer required for the build)rustup
is preferred overrust
as it automatically installs Rust toolchains which depends onclang 15.0.0
So there's two choices:
llvm-git
from AUR and install the package to the temporary environment that makechrootpkg
generates.clang
and llvm
from makedepends
and add llvm-git
to that section. You could try to use google prebuild clang binary, to build brave - like chromium-dev PKGBUILD. https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=chromium-dev
i think the important lines in chromium-dev PKGBUILD are:
.... _clang_path="${BUILDDIR}${_builddir}/src/chromium-${pkgver}/third_party/llvm-build/Release+Asserts/bin/"
export CC="${_clang_path}clang" export CXX="${_clang_path}clang++" export AR="${_clang_path}llvm-ar" export NM=nm export RANLIB=/usr/bin/true _lld="ld.lld"
....
in prepare() ... msg2 "Download prebuild clang from Google" tools/clang/scripts/update.py ...
just look into the chromium-dev PKGBUILD. I use it for my own (private) ungoogled-chromium build.
You could try to use google prebuild clang binary, to build brave - like chromium-dev PKGBUILD.
This could be an option for the current clang
situation. However, it seems to be a bit against the whole concept of use what the distro provides. I'd stick with llvm-git
until clang
is updated in Arch official repo.
Okay I'll correct the llvm dependency and try again. The correct way by the way is to set depends=('llvm>=15')
and let the end user figure out how to supply it. If the llvm-git
package is setup correctly it will provide that, but so will the stable one when it is updated.
The correct way by the way is to set
depends=('llvm>=15')
and let the end user figure out how to supply it.
That's exactly what I meant, and thanks for correcting me!
Also, I am now testing build for Brave v1.45.133 (Chromium 107.0.5304.141) released just now. If the build is successful, I will update the version on PKGBUILD
.
Unfortunately the llvm-git
package does not specify the version information necessary in the provides to do this correctly. I have suggested a patch to fix it.
@caesarw Have you done any builds in a chroot yet? I'm still trying to get this to build even once in a clean chroot before posting it and am not there yet. I have a special chroot prepared with llvm swapped out for llvm-git, but still get other errors when building this.
but still get other errors when building this
What kind of error specifically?
@alerque I think it's probably due to this
rustup
is preferred overrust
as it automatically installs Rust toolchains which depends onclang 15.0.0
Regular rust
package does not work with llvm-git
as it by default depends on clang 14
. We would have to use rustup
to automatically install a rust toolchain that depends on newer version of clang
.
Sorry I accidentally clicked close PR.
That would be logical and thanks for the reminder. I didn't mention it in my previous comment so I understand why it came to mind, but my chroot actually has rustup with an updated stable toolchain besides just llvm-git. The last error I got was related to aom
somehow. I'll post an actual error if I get stuck at the same place again.
Meanwhile have you done this in a chroot or are you just using your host system to build?
Meanwhile have you done this in a chroot or are you just using your host system to build?
I am now trying to get it built with makechrootpkg
. If there's any error, I would try and fix them.
Just for reference where I am at if you get there too, I'm currently failing with some Python / AOM related stuff still in the prepare section:
==> Starting prepare()...
patching file Makefile
patching file launcher.c
Prepare the environment...
added 28 packages, and audited 29 packages in 807ms
7 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
patching file build/rust/run_cxxbridge.py
patching file script/cargo.py
patching file script/cargo_cbindgen.py
patching file script/deps_config.py
patching file script/download_rust_deps.py
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated multibase@3.1.2: This module has been superseded by the multiformats module
npm WARN deprecated @types/jszip@3.4.1: This is a stub types definition. jszip provides its own type definitions, so you do not need this installed.
npm WARN deprecated @types/array-move@2.0.0: This is a stub types definition. array-move provides its own type definitions, so you do not need this installed.
npm WARN deprecated @storybook/addon-knobs@6.4.0: deprecating @storybook/addon-knobs in favor of @storybook/addon-controls
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
added 2310 packages, and audited 2311 packages in 1m
338 packages are looking for funding
run `npm fund` for details
33 vulnerabilities (3 low, 6 moderate, 24 high)
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
npm notice
npm notice New major version of npm available! 8.19.2 -> 9.1.2
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.1.2>
npm notice Run `npm install -g npm@9.1.2` to update!
npm notice
Running "npm run"
> brave@1.45.133 init
> node ./scripts/init.js --nohooks
Performing initial checkout of brave-core
-------------------------------
/build/brave/src/brave-browser/src/brave
> git rev-parse HEAD
brave-core repo at /build/brave/src/brave-browser/src/brave is at commit ID 3569b5435b1f5372ddbd1153da6cc4936f10229c
-------------------------------
/build/brave/src/brave-browser/src/brave
> npm install
-------------------------------
/build/brave/src/brave-browser/src/brave
> npm run sync -- --init --nohooks
> brave-core@1.45.133 sync
> node ./build/commands/scripts/sync.js --init --nohooks
Brave Browser Sync starting
Running gclient sync...
-------------------------------
/build/brave/src/brave-browser/src
> git rev-parse HEAD
-------------------------------
/build/brave/src/brave-browser/src
> git rev-parse refs/tags/107.0.5304.141
-------------------------------
/build/brave/src/brave-browser/src
> git log -n 1 --pretty=format:%h%d
Chromium repo needs sync.
target is refs/tags/107.0.5304.141 at commit [missing]
current commit is a0cd0714 (HEAD -> makepkg, tag: v1.45.133) at commit a0cd0714b9c1e7f97fc1e4bb016090d19f649d63
latest successful sync is {}
-------------------------------
/build/brave/src/brave-browser
> gclient sync --nohooks --revision src@refs/tags/107.0.5304.141 --reset --with_tags --with_branch_heads --upstream --force
WARNING: Your metrics.cfg file was invalid or nonexistent. A new one will be created.
________ running 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress file:///build/brave/src/chromium /build/brave/src/brave-browser/_gclient_src__2uauyuo' in '/build/brave/src/brave-browser'
Cloning into '/build/brave/src/brave-browser/_gclient_src__2uauyuo'...
remote: Enumerating objects: 19338174, done.
remote: Counting objects: 100% (19338174/19338174), done.
remote: Compressing objects: 100% (4150957/4150957), done.
Receiving objects: 100% (19338174/19338174), 29.87 GiB | 15.99 MiB/s, done.
remote: Total 19338174 (delta 14345276), reused 19209058 (delta 14218025), pack-reused 0
Resolving deltas: 100% (14345276/14345276), done.
Checking objects: 100% (67108864/67108864), done.
59>WARNING: subprocess '"git" "-c" "core.deltaBaseCacheLimit=2g" "clone" "--no-checkout" "--progress" "https://aomedia.googlesource.com/aom.git" "/build/brave/src/brave-browser/src/third_party/libaom/source/_gclient_libaom_szzdjiih"' in /build/brave/src/brave-browser failed; will retry after a short nap...
59>WARNING: subprocess '"git" "-c" "core.deltaBaseCacheLimit=2g" "clone" "--no-checkout" "--progress" "https://aomedia.googlesource.com/aom.git" "/build/brave/src/brave-browser/src/third_party/libaom/source/_gclient_libaom_szzdjiih"' in /build/brave/src/brave-browser failed; will retry after a short nap...
src/third_party/libaom/source/libaom (ERROR)
----------------------------------------
[0:56:35] Started.
[0:56:35]
________ running 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://aomedia.googlesource.com/aom.git /build/brave/src/brave-browser/src/third_party/libaom/source/_gclient_libaom_szzdjiih' in '/build/brave/src/brave-browser'
[0:56:35] Cloning into '/build/brave/src/brave-browser/src/third_party/libaom/source/_gclient_libaom_szzdjiih'...
[0:56:51] fatal: unable to access 'https://aomedia.googlesource.com/aom.git/': Could not resolve host: aomedia.googlesource.com
[0:56:53]
________ running 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://aomedia.googlesource.com/aom.git /build/brave/src/brave-browser/src/third_party/libaom/source/_gclient_libaom_szzdjiih' in '/build/brave/src/brave-browser' attempt 2 / 2
[0:56:53] Cloning into '/build/brave/src/brave-browser/src/third_party/libaom/source/_gclient_libaom_szzdjiih'...
[0:57:05] fatal: unable to access 'https://aomedia.googlesource.com/aom.git/': SSL: no alternative certificate subject name matches target host name 'aomedia.googlesource.com'
Traceback (most recent call last):
File "/build/brave/src/brave-browser/src/brave/vendor/depot_tools/gclient_scm.py", line 1160, in _Clone
self._Run(clone_cmd,
File "/build/brave/src/brave-browser/src/brave/vendor/depot_tools/gclient_scm.py", line 1506, in _Run
gclient_utils.CheckCallAndFilter(cmd, env=env, **kwargs)
File "/build/brave/src/brave-browser/src/brave/vendor/depot_tools/gclient_utils.py", line 715, in CheckCallAndFilter
raise subprocess2.CalledProcessError(
subprocess2.CalledProcessError: Command 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://aomedia.googlesource.com/aom.git /build/brave/src/brave-browser/src/third_party/libaom/source/_gclient_libaom_szzdjiih' returned non-zero exit status 128 in /build/brave/src/brave-browser
[0:57:09] _____ Conflicting directory found in /build/brave/src/brave-browser/src/third_party/libaom/source/libaom. Moving to /build/brave/src/brave-browser/_bad_scm/src/third_party/libaom/source/libaomzc8fr7v2.
----------------------------------------
Warnings:
Conflicting directory /build/brave/src/brave-browser/src/third_party/libaom/source/libaom moved to /build/brave/src/brave-browser/_bad_scm/src/third_party/libaom/source/libaomzc8fr7v2.
Traceback (most recent call last):
File "/build/brave/src/brave-browser/src/brave/vendor/depot_tools/gclient_scm.py", line 647, in update
self._Clone(revision, url, options)
File "/build/brave/src/brave-browser/src/brave/vendor/depot_tools/gclient_scm.py", line 1160, in _Clone
self._Run(clone_cmd,
File "/build/brave/src/brave-browser/src/brave/vendor/depot_tools/gclient_scm.py", line 1506, in _Run
gclient_utils.CheckCallAndFilter(cmd, env=env, **kwargs)
File "/build/brave/src/brave-browser/src/brave/vendor/depot_tools/gclient_utils.py", line 715, in CheckCallAndFilter
raise subprocess2.CalledProcessError(
subprocess2.CalledProcessError: Command 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://aomedia.googlesource.com/aom.git /build/brave/src/brave-browser/src/third_party/libaom/source/_gclient_libaom_szzdjiih' returned non-zero exit status 128 in /build/brave/src/brave-browser
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build/.vpython-root/203055/lib/python3.8/shutil.py", line 791, in move
os.rename(src, real_dst)
FileNotFoundError: [Errno 2] No such file or directory: '/build/brave/src/brave-browser/src/third_party/libaom/source/libaom' -> '/build/brave/src/brave-browser/_bad_scm/src/third_party/libaom/source/libaomzc8fr7v2/libaom'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build/brave/src/brave-browser/src/brave/vendor/depot_tools/metrics.py", line 291, in print_notice_and_exit
yield
File "/build/brave/src/brave-browser/src/brave/vendor/depot_tools/gclient.py", line 3489, in <module>
sys.exit(main(sys.argv[1:]))
File "/build/brave/src/brave-browser/src/brave/vendor/depot_tools/gclient.py", line 3475, in main
return dispatcher.execute(OptionParser(), argv)
File "/build/brave/src/brave-browser/src/brave/vendor/depot_tools/subcommand.py", line 252, in execute
return command(parser, args[1:])
File "/build/brave/src/brave-browser/src/brave/vendor/depot_tools/gclient.py", line 3026, in CMDsync
ret = client.RunOnDeps('update', args)
File "/build/brave/src/brave-browser/src/brave/vendor/depot_tools/gclient.py", line 2020, in RunOnDeps
work_queue.flush(revision_overrides,
File "/build/brave/src/brave-browser/src/brave/vendor/depot_tools/gclient_utils.py", line 1013, in flush
reraise(e[0], e[1], e[2])
File "/build/brave/src/brave-browser/src/brave/vendor/depot_tools/gclient_utils.py", line 70, in reraise
raise value
File "/build/brave/src/brave-browser/src/brave/vendor/depot_tools/gclient_utils.py", line 1090, in run
self.item.run(*self.args, **self.kwargs)
File "/build/brave/src/brave-browser/src/brave/vendor/depot_tools/gclient.py", line 1005, in run
self._got_revision = self._used_scm.RunCommand(command, options, args,
File "/build/brave/src/brave-browser/src/brave/vendor/depot_tools/gclient_scm.py", line 128, in RunCommand
return getattr(self, command)(options, args, file_list)
File "/build/brave/src/brave-browser/src/brave/vendor/depot_tools/gclient_scm.py", line 650, in update
self._DeleteOrMove(options.force)
File "/build/brave/src/brave-browser/src/brave/vendor/depot_tools/gclient_scm.py", line 203, in _DeleteOrMove
shutil.move(self.checkout_path, dest_path)
File "/build/.vpython-root/203055/lib/python3.8/shutil.py", line 811, in move
copy_function(src, real_dst)
File "/build/.vpython-root/203055/lib/python3.8/shutil.py", line 435, in copy2
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/build/.vpython-root/203055/lib/python3.8/shutil.py", line 264, in copyfile
with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: '/build/brave/src/brave-browser/src/third_party/libaom/source/libaom'
null
null
null
null
Also for reference the branch I'm working on is similar to this PR but has a few coding style differences (and commit history to bring in previous PR contributors). I'm in on my bebrave branch with a chroot that includes llvm-git, rustup, and an already downloaded stable rust toolchain.
@alerque I think the issue regarding aom
is more likely to be a network issue. It could be that Google's server is overloaded at that point. I'll keep an eye on this while experimenting my build.
I'm currently failing with some Python / AOM related stuff still in the prepare section
I can almost confirm that this is a network issue. I ran the build for more than three times just to get all third_party
libraries cloned with depot_tools
during a clean build. It's probably caused by too many parallel tasks started by depot_tools
at one time. I would investigate if there's any options to reduce the number of parallel tasks.
You might have to try multiple times in order to get all the libraries downloaded without errors.
I'm going to go ahead and merge the current state from here (actually my bebrave branch but with cherry-pick updates from here) into master and onto the AUR. It still does not build in a chroot properly but clearly this state is less broken than the existing ones and it's hard to get contributions without people seeing clearly what the current status is.
The llvm-git and Rust nightly are holdups for this getting migrated to [community] anyway, and hopefully somebody figures out the build issue from a clean chroot before those blockers are addressed. I suspect it's not just a network issue, it's a race condition.
@alerque It's good to see progress here. However, I can be almost sure that the issue is caused by networking conditions. However, both my network condition and storage is not good enough to test build on a clean chroot. I hope that I can soon find a way to do so. Also, I've been looking into building on Open Build Service (OBS) recently, as I noticed the Arch package of ungoogled-chromium is currently built by the service.
I can be almost sure that the issue is caused by networking conditions.
The 10 GB/s datacenter link I tried this from would beg to differ. Even my home 50 MB/s fiber link would object. I've run it dozens of times and it dies in the same spot every time.
The reason why I think it might be a race condition is you and others seem to be able to build on host systems fine, but in those cases some or all of the build could be "primed", so even if you failed once running it a second time might succeed because the first partial build worked around the race condition present when doing a fully clean build.
You seem to miss my last commit for brave 1.46.140, which not only updates brave version, but also sync patches from upstream Arch chromium build. For the building issue, I will keep an eye on it and see if I can get it built on a clean root.
Sorry about that, my work on getting it merged to the AUR was in progress before those came across, and I ran into a bug in git subtree
making it happen so it took a while. I've added the latest bump now.
This PR updates
brave
to 1.46.133-1, based on #38, #24 andPKGBUILD
in the repo.Changelog
brave
version to 1.46.133chromium
version to 108.0.5359.71chromium
buildTested
Quirks
clang 15.0.0
or newer (i.e. usellvm-git
from AUR, but oncellvm
in Arch repo is updated, installing from AUR is no longer required for the build)rustup
is preferred overrust
as it automatically installs Rust toolchains which depends onclang 15.0.0
src/brave-browser/src/brave/vendor/depot_tools
needs to be deleted upon every rebuild withmakepkg
if you are testing on a dirty buildTodos
.npmrc
(if possible)PKGBUILD
file overall formattingCredits: @alerque @monarc99 @YakoYakoYokuYoku @caesarw Maintainers of Arch community repo