Commit Graph
16 Commits
Author SHA1 Message Date
Artem Samoilenko c09c613e3d [cr147][Android] Exclude failing lib from breakpad symbols
Otherwise we get errors like:
FAILED: 1117d0ca-aba0-47f3-8a85-d58aa5a81e5c "./dist/brave.breakpad.syms" ACTION //brave/app/android:generate_breakpad_symbols(//build/toolchain/android:android_clang_x64)
err: exit=1
python3 ../../brave/tools/android/generate_breakpad_symbols.py --symbols-dir=/mnt/wd2t/projects/brave-browser-3/src/out/android_Release/dist/brave.breakpad.syms --jobs=16 --build-dir=/mnt/wd2t/projects/brave-browser-3/src/out/android_Release --package-path=/mnt/wd2t/projects/brave-browser-3/src/out/android_Release/apks/BraveMonox64.apk --src-root=/mnt/wd2t/projects/brave-browser-3/src/ --clear --verbose
build step: __brave_app_android_generate_breakpad_symbols___build_toolchain_android_android_clang_x64__rule "./dist/brave.breakpad.syms"
stdout:
Seeing lib don't know the location for: libimpress_api_jni.so
2026-03-26 19:55:50 -04:00
Brian Clifton a5213345b3 Updated WireGuard tunnel library to tag 1.0.20250531 (#31028)
* Updated WireGuard tunnel library to tag `1.0.20250531`

This includes the important commit:
https://git.zx2c4.com/wireguard-android/commit/?id=a57ca57e6c93f7db3253194d2880dcc781ea7c88

Fixes https://github.com/brave/brave-browser/issues/48949

* Added the script used to build the tunnel binary.

* Checkout the specific hash after checking out tag
2025-09-25 09:00:04 -07:00
AlexeyBarabash ff83351b09 Changed presubmit rules severity to error for more rules (p3) (#26924)
Changed presubmit rules severity to error for:
- AvoidStarImport;
- ModifierOrder;
- RedundantImport;
- PackageName;
- SimplifyBooleanExpression;
- SimplifyBooleanReturn;
- TypeName;
- ConstantName.
2025-03-25 16:57:47 +02:00
AlexeyBarabash ba0c0ee2ea Changed ParameterName presubmit rule severity to error (#26794)
Fixes brave/brave-browser#42583
2024-12-06 20:09:16 +02:00
AlexeyBarabash 716ec90292 Changed MethodNameCheck presubmit rule severity to error (#26750)
Changed MethodNameCheck presubmit rule to error severity
2024-11-26 16:35:42 +02:00
AlexeyBarabash 10cd69b171 Fixed breakpad symbols generation.
With cr128 new dir android_clang_arm64_with_system_allocator appeared at out folder.
It caused the `generate_breakpad_symbols.py` script fail. After investigation it turned out
it is safe to remove that check, symbols are generated well. In addition, after
brave-core/pull/20849 we supply only one ABI per package.

Related Chromium change:
https://source.chromium.org/chromium/chromium/src/+/7b17414a82198fe945eb56aa1c50c2608a6a9f63

	Reland "Reland "Reland "Reland "Add toolchains without PartitionAlloc-Everywhere for dump_syms et al""""

	This is a reland of commit 4aceb04adee20a09c1e31760e8c6dafac2563d31
	Which was a reland of commit 5e6def5bd2aa9cdbf69608a8edc32b5de696c091
	Which was a reland of commit 818e126f4350095dd0a54566ded107f0a5065f6f
	Which was a reland of commit 38c00784bc98a5dc885b06f5a0e738386c5f7df7

	When PartitionAlloc is linked into an executable, it takes over the
	system allocator (malloc, new, etc), which is called PartitionAlloc-
	Everywhere (or PA-E). When this occurs in dump_syms, we see that PA
	hits OOM and causes dump_syms to crash while generating the symbols
	for chrome. It's not at all clear why PA hits OOM but the system
	allocator does not, it occurs during construction of a std::string (on
	my machine anyway when I am running it in gdb, maybe elsewhere on bots).
	This happens on all platforms that we run dump_syms on as part of the
	official build: on linux and on mac, building for at least linux,
	android, chromeos, and mac. See also crbug.com/345514993.

	So we want to build dump_syms and other breakpad executables in a way
	that uses the system allocator. To do that we need to disable the
	use_partition_alloc_as_malloc GN variable. As this variable is global,
	we need a separate toolchain in order to disable it.

	We introduce a new toolchain with the suffix `_with_system_allocator`
	that can be used for this purpose. Initially we intended to use the
	Rust host build tools toolchain for this purpose, however we require
	careful naming to avoid toolchain collisions. For instance if building
	on a Linux x64 machine with an Other x64 target, we can have two
	toolchains:
	- default_toolchain: //build/toolchain/other:clang_x64
	- host_toolchain: //build/toolchain/other:clang_x64

	While these have different labels, it is the name at the end that is
	used as their output directory (this is hardcoded in GN). But they
	avoid colliding because the default toolchain is not placed in a
	subdirectory and uses the `root_build_dir`. However when we add another
	toolchain with them, they both get subdirs and collide:
	- for target: //build/toolchain/other:clang_x64_with_system_allocator
	- for host: //build/toolchain/linux:clang_x64_with_system_allocator

	Now both toolchains try to write to the clang_x64_with_system_allocator
	directory which causes errors. To avoid this, we actually make two
	toolchains per toolchain, one with a `host_` tag inside it.
	- target:  //build/toolchain/other:clang_x64_with_system_allocator
	- unused:  //build/toolchain/linux:clang_x64_with_system_allocator
	- unused:  //build/toolchain/other:clang_x64_host_with_system_allocator
	- host:    //build/toolchain/linux:clang_x64_host_with_system_allocator

	Then, when building for the host we choose the `host_` variety, which
	is specified in the `host_system_allocator_toolchain variable`. And
	when building for default target, we choose the non-`host_` one, which
	is specified in the `default_system_allocator_toolchain` variable.

	More clever strategies that try to avoid creating the unused toolchains
	above do not seem possible. Inside the toolchain-creating template,
	it is not clear how to determine which toolchain is being created, as
	the get_label_info() function on `target_name` does not produce
	anything that matches exactly with the string in `default_toolchain` or
	`host_toolchain`. We also tried using the current_cpu and current_os,
	however the `toolchain_args.current_os` is not actually set correctly in
	the default toolchain when targeting ChromeOS. The current_os variable
	is "chromeos" but inside the toolchain_args, it is "linux". So we just
	make extra toolchains (which can't be used or they'd make build errors)
	and we don't refer to them from the `host_system_allocator_toolchain`
	and `default_system_allocator_toolchain` variables, which makes them
	effectively inaccessible.

	In the process we learnt many things about how the breakpad executables
	are built. When you build them for the default toolchain, such as by
	building `//third_party/breakpad:dump_syms`, it redirects to the *host*
	toolchain on many platforms, but not on all platforms. This ends up
	putting a binary that may not work on the target machine in the
	`root_build_dir` which is highly unusual, but it is required by our
	testing scripts/infra.

	The key insight added here is that the toolchain that it should be
	built with is the platform from where the tests on the target will be
	*launched*. On Android, iOS, and ChromeOS, the tests are launched from
	the host machine and that's where the breakpad executables are run. We
	encode this explicitly in the breakpad GN file.

	One additional exception is that the breakpad tools do not build on
	Windows ARM, so when building on Windows x64 for Windows ARM, while
	the tests are launched from the ARM machine, we target the host x64
	machine still. This relies on the ARM machine being able to run the
	x64 binaries through emulation.

	There's no change here in how the breakpad binaries are built, but it
	is now more explicitly encoded and documented. What did change is that
	since we use a separate toolchain for building these tools, we also
	turn off component build in them. This allows us to replace the use
	of symlinks with copying (or hardlinking) the binaries from the
	toolchain's root directory up to the root_build_dir. This enables
	support for building these tools in the default_toolchain on Windows,
	something which was not possible before.

	Additional fixes from the original CL:

	MSAN is disabled in the toolchain with the system allocator as we only
	support MSAN in the default toolchain. If another toolchain has MSAN
	enabled it will try to also generate the MSAN instrumented libraries
	in the default toolchain's directory and they collide. This is similar
	to the rust host build tools toolchain, but there we disable all
	sanitizers. For the system allocator toolchain, we disable MSAN but
	retain the ability to build these tools with ASAN or UBSAN if needed.

	Angle's GN generation is fixed by not setting the PA variable directly
	from the toolchain. We add a variable in toolchain.gni that is always
	present, and set that. Then in the PA gni files, we check for that
	variable before enabling PA-Everywhere (and BRP, etc).

	Devtools standalone overrides BUILDCONFIG.gn but was not re-defining
	the TESTONLY_AND_VISIBILITY variable, so this is done in
	https://chrome-internal-review.googlesource.com/c/devtools/devtools-internal/+/7412037

	iOS official internal builders are now using the path to the
	root_build_dir for its dump_syms exe path from
	https://chrome-internal-review.googlesource.com/c/chrome/ios_internal/+/7411376
	and it expects the executable to be for the host. A TODO is added
	in the breakpad BUILD.gn file regarding cross-compiling for a
	different mac machine architecture that will upload/launch tests to
	the iOS device.

	Mac and Windows internal official builders are fixed by having the
	symupload tool depended on and built for the default toolchain so that
	it's present in the root_build_dir, but making this binary always
	redirect through the host_system_allocator_toolchain. The symupload
	binary is only run on official builders, it's not part of test
	failure reporting like dump_syms.

	Clank orderfile generator had a GN error due to PA-E being off but
	BRP being enabled. This is resolved by the fix for Angle, by turning
	off all PA-E and BRP related stuff when the toolchain turns off PA-E.
	See https://crbug.com/347976629.

	Further additional fixes from the original CL:

	The minidump_fuzzer is added to the default toolchain, redirecting to
	the test-launcher toolchain.

	The windows host system-allocator toolchain is forced to use the host
	cpu, rather than using the the x86 cpu when cross-compiling.

	The Linux-to-Windows cross build avoids putting a `.exe` suffix on
	executables built for the host system-allocator toolchain as targets
	for Linux do not have them, and then GN can't find the requested
	target.

	Even more additional fixes:

	The previous attempt to get the host system-allocator toolchain to use
	the host cpu on Windows was incomplete. It only updated the non-clang
	toolchain, and it missed changing the environment to point to the host
	cpu's sdk. This is now done correctly.

	Removed the redundant output_name field in the windows symupload
	executable target, as the executable target is now named symupload, and
	not symupload_win.

	Explicitly add a `$host_toolchain/symupload` alias on Mac ARM so that
	the recipes which explicitly build and run that path will work when
	this lands. Once it reaches stable we can remove those explicit paths
	from the recipes.

	And additional fixes after that:

	The high-end fuzzer bot does not build minidump_fuzzer so avoid
	generating the copy_exe rule for it there.

	Bug: 345514993, b/342251590, 347976629, 349268750
	Change-Id: Ib6fd0b8cbde33fd69c609c0232de24a337648b73
	Cq-Include-Trybots: luci.chromium.try:linux-centipede-asan-rel
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5675706
2024-08-07 21:32:01 -04:00
Aleksey Khoroshilov a896d5474c Remove .pylintrc in favor of Chromium pylintrc. 2023-12-28 14:48:41 +07:00
mkarolin aa89809c48 //third_party/checkstyle 8.15 -> 10.12.1
Chromium change:

https://chromium.googlesource.com/chromium/src/+/39326acff8e5f1

commit 39326acff8e5f1694d053d659e35f80f7e0228f7
Author: Andrew Grieve <agrieve@chromium.org>
Date:   Wed Jul 5 14:22:49 2023 +0000

    Roll //third_party/checkstyle 8.15 -> 10.12.1

    This makes checkstyle understand newer Java syntax.

    Bug: 1462201
2023-09-06 12:38:50 +01:00
AlexeyBarabash 16169dfe09 Make upstream's remove_unused_imports.py to be usable at Brave repo (#18903)
This PR introduces remove_unused_imports.sh script which wraps the same
upstream's tool and makes it usable at Brave repo.

Fixes brave/brave-browser#31045
2023-06-16 12:05:56 +03:00
AlexeyBarabash 6523c3bace Enable CheckJavaStyle presubmit check (#18761)
* Enable CheckJavaStyle presubmit check

For now severity for all checks except RedundantImport/UnusedImports
is changed from error to warning with brave-style-5.0.xml.

Once all Java style errors will be fixed, check should be switched
back to upstream's original check.

Fixes brave/brave-browser#30823

* Remove all unused/redundant imports from java files
2023-06-07 20:44:28 +03:00
AlexeyBarabash f0c92c1e7f Get rid of python import six.moves.queue when generating Android symbols
fixes brave/brave-browser#22684
2022-05-04 11:23:33 +03:00
Deep 36e3901eb1 Update .gn to address deps in proper way
Update patches
2022-04-19 19:12:12 -04:00
Deep 393e2e42d5 Add always on
Add ARM64 configs

Update gn config for tunnel .so

Update patches
2022-04-19 19:12:12 -04:00
Alexey Barabash effc9617b5 Fixed symbols generating on Android
Related Chromium change:

https://source.chromium.org/chromium/chromium/src/+/9321000e5ad8a564f5f8b9907a198093c1319a02

remove py2 compatiblity from content_shell_crash_test

The test is now running in python3.

Bug: 1288172
Change-Id: I36da2b6269681d590c45de95bda3ed917cb9cea1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3428841
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#965520}
2022-03-18 20:04:17 -04:00
AlexeyBarabash dcae460360 Update python version to 3 for tools/android/generate_breakpad_symbols.py
fixes brave/brave-browser#17809

Related Chromium change https://source.chromium.org/chromium/chromium/src/+/0470f485e51e6ebb07cb96a64fd077fb3e5ff9ee :

build: remove is_python2.py

_is_python2 is always false now.

Bug: 1112471
Change-Id: I049610e59c7f51472b6326a7fcdd82c732725cec
2021-09-13 14:53:49 -04:00
AlexeyBarabash 2fc4fb4dea Generating breakpad symbols for Android libs 2021-08-30 15:39:39 +03:00