-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
2,104 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
#!/bin/bash | ||
# This file is inspired by the `run.sh` in `ungoogled-chromium-archlinux`, | ||
# which is licenced under BSD-3 Clause. The licence is as listed following. | ||
# | ||
## Copyright 2022 The ungoogled-chromium Authors. All rights reserved. | ||
# | ||
## Redistribution and use in source and binary forms, with or without | ||
## modification, are permitted provided that the following conditions are | ||
## met: | ||
# | ||
## * Redistributions of source code must retain the above copyright | ||
## notice, this list of conditions and the following disclaimer. | ||
## * Redistributions in binary form must reproduce the above | ||
## copyright notice, this list of conditions and the following disclaimer | ||
## in the documentation and/or other materials provided with the | ||
## distribution. | ||
## * Neither the name of the copyright holder nor the names of its | ||
## contributors may be used to endorse or promote products derived from | ||
## this software without specific prior written permission. | ||
# | ||
## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
# | ||
# The origin file URL is: | ||
# https://github.com/ungoogled-software/ungoogled-chromium-archlinux/blob/master/.github/workflows/container/run.sh | ||
|
||
|
||
: "${TUR_CONTINUOUS_FLAG:=false}" | ||
: "${TUR_CONTINUOUS_TIMEOUT:=240m}" | ||
|
||
# Get the builder docker image if necessary. | ||
./scripts/run-docker.sh bash -c "exit 0" | ||
|
||
# Create the output dir, it may be used to construct the status. | ||
./scripts/run-docker.sh bash -c "mkdir -p ./output" | ||
|
||
# Install zstd | ||
echo "==> Installing zstd" | ||
./scripts/run-docker.sh bash -c "sudo apt update && sudo apt install -yq zstd" | ||
|
||
echo "==> Build with continuous flag: $TUR_CONTINUOUS_FLAG" | ||
echo "==> Build with timeout: $TUR_CONTINUOUS_TIMEOUT" | ||
|
||
EXTRA_FLAGS="" | ||
if [ "$TUR_CONTINUOUS_FLAG" != "false" ]; then | ||
EXTRA_FLAGS="-c" | ||
echo "==> Extracting the build deps..." | ||
# Extract build deps to docker | ||
time ./scripts/run-docker.sh bash -c 'sudo tar -I zstd -C / -xf ./build-deps/tur-continuous-deps.tar.zst' | ||
rm -f ./build-deps/tur-continuous-deps.tar.zst | ||
echo "==> Extracting the build status..." | ||
# Extract build status to docker | ||
time ./scripts/run-docker.sh bash -c 'sudo tar -I zstd -C / -xf ./build-status/tur-continuous-status.tar.zst' | ||
rm -f ./build-deps/tur-continuous-status.tar.zst | ||
fi | ||
|
||
echo "==> Current time: $(date)" | ||
|
||
# Start the build process with or without continuous flag | ||
timeout -k 10m -s SIGTERM "$TUR_CONTINUOUS_TIMEOUT" ./scripts/run-docker.sh "$@" $EXTRA_FLAGS | ||
EXIT_CODE=$? | ||
|
||
mkdir -p ./build-status ./build-deps | ||
|
||
if [[ $EXIT_CODE == 0 ]]; then | ||
echo "==> Build successful" | ||
echo "true" > ./build-status/tur-continuous-finished-flag | ||
touch ./build-deps/.placeholder | ||
elif [[ $EXIT_CODE == 124 ]]; then # https://www.gnu.org/software/coreutils/manual/html_node/timeout-invocation.html#timeout-invocation | ||
echo "==> Build timed out" | ||
echo "false" > ./build-status/tur-continuous-finished-flag | ||
echo "==> Generating the build status..." | ||
df -h | ||
# XXX: This will create a pretty large file, hope that Github Action has enough space. | ||
# XXX: I think the build status is just the `build`, `src` and `tmp` folder. `cache` | ||
# XXX: often contains the source tar ball and will not be modified. | ||
# TODO: Parse the package name from command line. | ||
./scripts/run-docker.sh bash -c 'sudo tar -I zstd --remove-files -cf ./build-status/tur-continuous-status.tar.zst /home/builder/.termux-build/chromium/{build,src,tmp}' | ||
echo "==> Successfully generate build status." | ||
# Create the deps file if the package is built the first time. | ||
if [ "$TUR_CONTINUOUS_FLAG" = "false" ]; then | ||
echo "==> Generating the build deps..." | ||
df -h | ||
# XXX: This will create a pretty large file, hope that Github Action has enough space. | ||
./scripts/run-docker.sh bash -c 'sudo tar -I zstd --remove-files -cf ./build-deps/tur-continuous-deps.tar.zst /data /home/builder/.termux-build' | ||
echo "==> Successfully generate build deps." | ||
fi | ||
else | ||
echo "==> Build failed with $EXIT_CODE" | ||
exit $EXIT_CODE | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- a/content/gpu/BUILD.gn | ||
+++ b/content/gpu/BUILD.gn | ||
@@ -139,6 +139,6 @@ | ||
# Use DRI on desktop Linux builds. | ||
if (current_cpu != "s390x" && current_cpu != "ppc64" && is_linux && | ||
!is_castos) { | ||
- configs += [ "//build/config/linux/dri" ] | ||
+ # configs += [ "//build/config/linux/dri" ] | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
tur-continuous/chromium/0002-configure-remove-unsupported-flags.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- a/build/config/compiler/BUILD.gn | ||
+++ b/build/config/compiler/BUILD.gn | ||
@@ -1543,20 +1543,6 @@ | ||
# TODO(thakis): Only for no_chromium_code? http://crbug.com/912662 | ||
"-Wno-ignored-pragma-optimize", | ||
] | ||
- | ||
- if (!is_nacl) { | ||
- cflags += [ | ||
- # TODO(crbug.com/1343975) Evaluate and possibly enable. | ||
- "-Wno-deprecated-builtins", | ||
- | ||
- # TODO(crbug.com/1352183) Evaluate and possibly enable. | ||
- "-Wno-bitfield-constant-conversion", | ||
- ] | ||
- if (is_win) { | ||
- # TODO(https://crbug.com/1363759): Evaluate and possibly enable. | ||
- cflags += [ "-Wno-deprecated-copy-with-user-provided-copy" ] | ||
- } | ||
- } | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
tur-continuous/chromium/0003-configure-use-android-target.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- a/build/config/compiler/BUILD.gn | ||
+++ b/build/config/compiler/BUILD.gn | ||
@@ -915,8 +915,8 @@ | ||
} else if (current_cpu == "arm") { | ||
if (is_clang && !is_android && !is_nacl && | ||
!(is_chromeos_lacros && is_chromeos_device)) { | ||
- cflags += [ "--target=arm-linux-gnueabihf" ] | ||
- ldflags += [ "--target=arm-linux-gnueabihf" ] | ||
+ cflags += [ "--target=armv7a-linux-android24" ] | ||
+ ldflags += [ "--target=armv7a-linux-android24" ] | ||
} | ||
if (!is_nacl) { | ||
cflags += [ | ||
@@ -930,13 +930,13 @@ | ||
} else if (current_cpu == "arm64") { | ||
if (is_clang && !is_android && !is_nacl && !is_fuchsia && | ||
!(is_chromeos_lacros && is_chromeos_device)) { | ||
- cflags += [ "--target=aarch64-linux-gnu" ] | ||
- ldflags += [ "--target=aarch64-linux-gnu" ] | ||
+ cflags += [ "--target=aarch64-linux-android24" ] | ||
+ ldflags += [ "--target=aarch64-linux-android24" ] | ||
} | ||
- if (is_android) { | ||
+ # if (is_android) { | ||
# Outline atomics crash on Exynos 9810. http://crbug.com/1272795 | ||
cflags += [ "-mno-outline-atomics" ] | ||
- } | ||
+ # } | ||
} else if (current_cpu == "mipsel" && !is_nacl) { | ||
ldflags += [ "-Wl,--hash-style=sysv" ] | ||
if (custom_toolchain == "") { |
18 changes: 18 additions & 0 deletions
18
tur-continuous/chromium/0004-breakpad-no-elf_prstatus.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc | ||
+++ b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc | ||
@@ -194,6 +194,7 @@ | ||
// | ||
// The following code only works if notes are ordered as expected. | ||
switch (type) { | ||
+#if !defined(__ANDROID__) | ||
case NT_PRSTATUS: { | ||
if (description.length() != sizeof(elf_prstatus)) { | ||
fprintf(stderr, "Found NT_PRSTATUS descriptor of unexpected size\n"); | ||
@@ -231,6 +232,7 @@ | ||
thread_infos_.push_back(info); | ||
break; | ||
} | ||
+#endif | ||
case NT_SIGINFO: { | ||
if (description.length() != sizeof(siginfo_t)) { | ||
fprintf(stderr, "Found NT_SIGINFO descriptor of unexpected size\n"); |
Oops, something went wrong.