Skip to content

Commit

Permalink
NDM: Several misc Chromium changes
Browse files Browse the repository at this point in the history
Signed-off-by: RJ Sampson <rj.sampson@chainguard.dev>
  • Loading branch information
EyeCantCU committed Nov 10, 2024
1 parent 1d7fa45 commit de7c32f
Showing 1 changed file with 70 additions and 35 deletions.
105 changes: 70 additions & 35 deletions chromium.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
package:
name: chromium
version: 130.0.6723.116
epoch: 0
epoch: 1
description: "Open souce version of Google's chrome web browser"
copyright:
- license: BSD-3-Clause
resources:
cpu: 65
memory: 128Gi
target-architecture:
- x86_64
dependencies:
runtime:
- font-opensans
Expand All @@ -24,10 +22,14 @@ package:
- icu-data-full
- libnss
- mesa
- mesa-glx
- nss
- systemd
- xdg-utils

vars:
llvm-version: "19"

environment:
contents:
packages:
Expand All @@ -41,6 +43,7 @@ environment:
- bzip2-dev
- ca-certificates-bundle
- cairo-dev
- clang-${{vars.llvm-version}}
- crc32c-dev
- cups-dev
- curl
Expand Down Expand Up @@ -105,11 +108,13 @@ environment:
- libxtst
- libxtst-dev
- linux-headers
- mesa
- llvm-${{vars.llvm-version}}-dev
- llvm-compiler-rt-${{vars.llvm-version}}
- llvm-lld-${{vars.llvm-version}}
- mesa-dev
- mesa-gbm
- minizip
- nghttp2-dev
- nodejs
- openh264-dev
- openssf-compiler-options
- opus-dev
Expand All @@ -124,7 +129,8 @@ environment:
- python3
- qt5-qtbase-dev
- qt6-qtbase-dev
- rust
- rust-bindgen
- rustup
- samurai
- speex-dev
- sqlite-dev
Expand All @@ -135,42 +141,58 @@ environment:
- zlib-dev
- zstd-dev
environment:
# Disable compiler warnings encountered when using system provided libraries
CFLAGS: "$(echo ${CFLAGS}) -Wno-unknown-warning-option -Wno-builtin-macro-redefined -Wno-deprecated-declarations -Wno-shift-count-overflow -Wno-ignored-attributes"
CXXFLAGS: "$(echo ${CXXFLAGS}) -Wno-unknown-warning-option -Wno-builtin-macro-redefined -Wno-deprecated-declarations -Wno-invalid-constexpr"
CPPFLAGS: "$(echo ${CPPFLAGS/-Wp,-D_GLIBCXX_ASSERTIONS/}) -D__DATE__= -D__TIME__= -D__TIMESTAMP__="
AR: "llvm-ar"
CC: "clang"
CXX: "clang++"
NM: "llvm-nm"

pipeline:
- uses: git-checkout
with:
#- uses: git-checkout
#with:
# === INFO === Initial git clone: takes ~3 minutes, needs 6GB disk
repository: https://chromium.googlesource.com/chromium/src.git
tag: ${{package.version}}
depth: 1
expected-commit: 6ac35f94ae3d01152cf1946c896b0678e48f8ec4
destination: /home/src
#repository: https://chromium.googlesource.com/chromium/src.git
#tag: ${{package.version}}
#depth: 1
#expected-commit: 6ac35f94ae3d01152cf1946c896b0678e48f8ec4
#destination: /home/src

- uses: fetch
working-directory: /home/src
with:
uri: https://chromium-tarballs.distfiles.gentoo.org/chromium-${{package.version}}.tar.xz
expected-sha512: e54beef2b445375cba0b1a290a99f7b41b2b9b965c89c0bb062c99be0825ccf64259440bd2b032bb5b1e46eef15b4a4f66fdaeb9974fcfe6f70d55a49ca47850

- runs: |
# === INFO === Disable compiler warnings encountered when using system provided libraries
export CFLAGS="$CFLAGS -Wno-unknown-warning-option -Wno-builtin-macro-redefined -Wno-deprecated-declarations -Wno-shift-count-overflow -Wno-ignored-attributes"
export CXXFLAGS="$CXXFLAGS -Wno-unknown-warning-option -Wno-builtin-macro-redefined -Wno-deprecated-declarations -Wno-invalid-constexpr"
export CPPFLAGS="${CPPFLAGS/-Wp,-D_GLIBCXX_ASSERTIONS/} -D__DATE__= -D__TIME__= -D__TIMESTAMP__="
# === INFO === Install rust nightly
# Chromium uses unstable rust options
rustup install nightly
rustup default nightly
export PATH="$HOME/.rustup/toolchains/nightly-${{build.arch}}-unknown-linux-gnu/bin:$PATH"
# === INFO === Setup depot tools
cd /home
time git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH="$PATH:/home/depot_tools"
#time git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
#export PATH="$PATH:/home/depot_tools"
# .gclient must be in one directory above chromium's src
cat <<EOF >/home/.gclient
#cat <<EOF >/home/.gclient
# Setup a .gclient config (handled by 'fetch' in upstream instructions)
solutions = [
{ "name" : "src",
"url" : "https://chromium.googlesource.com/chromium/src.git",
"managed": False,
"custom_deps": {},
"custom_vars": {},
},
]
EOF
cat /home/.gclient
#solutions = [
# { "name" : "src",
# "url" : "https://chromium.googlesource.com/chromium/src.git",
# "managed": False,
# "custom_deps": {},
# "custom_vars": {},
# },
#]
#EOF
#cat /home/.gclient
# === INFO === Sync dependencies: takes about 11 minutes, requires 30 GB of disk
# go back into our chromium src directory
cd /home/src
time gclient sync --no-history
#time gclient sync --no-history
# === INFO === Use system dependencies
# Use USB IDs already provided by hwdata-usb
sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \
Expand Down Expand Up @@ -226,30 +248,43 @@ pipeline:
sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
tools/generate_shim_headers/generate_shim_headers.py
# === INFO === Make node executable: works around permission denial
# === INFO === Use host's node
cd /home/src
chmod +x third_party/node/linux/node-linux-x64/bin/node
mkdir -p third_party/node/linux/node-linux-x64/bin
ln -sv /usr/bin/node third_party/node/linux/node-linux-x64/bin/
# === INFO === Generate config: takes about 30 minutes /
cd /home/src
time gn gen /home/src/out/Default --args="
clang_base_path=\"/usr/lib/llvm-${{vars.llvm-version}}\"
clang_use_chrome_plugins=false
clang_version=\"${{vars.llvm-version}}\"
chrome_pgo_phase=0
custom_toolchain=\"//build/toolchain/linux/unbundle:default\"
enable_nacl=false
enable_nocompile_tests_new=false
enable_rust=true
enable_widevine=true
ffmpeg_branding=\"Chrome\"
host_toolchain=\"//build/toolchain/linux/unbundle:default\"
icu_use_data_file=false
is_cfi=false
is_clang=true
is_component_ffmpeg=true
is_debug=false
is_official_build=true
link_pulseaudio=true
moc_qt6_path=\"/usr/lib/qt6/libexec\"
proprietary_codecs=true
rustc_version=\"yes\"
rust_bindgen_root=\"/usr\"
rust_sysroot_absolute=\"$HOME/.rustup/toolchains/nightly-${{build.arch}}-unknown-linux-gnu\"
safe_browsing_use_unrar=false
symbol_level=0
treat_warnings_as_errors=false
use_custom_libcxx=true
use_lld=true
use_pulseaudio=true
use_qt6=true
use_safe_libstdcxx=false
use_sysroot=false
use_system_freetype=true
use_system_harfbuzz=true
Expand All @@ -261,7 +296,7 @@ pipeline:
"
# === INFO === Compile: takes about 3 hours, 60 GB of disk (on a 32xXeon, 128GBxRAM, 2TBxNVME system)
cd /home/src
time autoninja -C /home/src/out/Default chrome chromedriver.unstripped chrome_crashpad_handler chrome_sandbox
time ninja -C /home/src/out/Default chrome chromedriver.unstripped chrome_crashpad_handler chrome_sandbox
# === INFO === Install the binaries and libraries
cd /home/src/out/Default
mkdir -p ${{targets.destdir}}/usr/bin ${{targets.destdir}}/usr/lib/${{package.name}}
Expand Down

0 comments on commit de7c32f

Please sign in to comment.