-
Notifications
You must be signed in to change notification settings - Fork 278
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
DNM: Misc Chromium changes #33783
base: main
Are you sure you want to change the base?
DNM: Misc Chromium changes #33783
Conversation
5c7dcc7
to
de7c32f
Compare
Gen AI suggestions to solve the build error: Based on the build error, there's a conflict with the
- runs: |
# Add to existing CFLAGS/CXXFLAGS
export CFLAGS="$CFLAGS -Wno-macro-redefined"
export CXXFLAGS="$CXXFLAGS -Wno-macro-redefined"
- runs: |
export CFLAGS="$CFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
export CXXFLAGS="$CXXFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
environment:
contents:
packages:
# Remove this line
#- openssf-compiler-options Try option 1 first as it's the least invasive change. If that doesn't work, try option 2. Option 3 should be a last resort since security hardening is important. These warnings are occurring because Chromium's build system is trying to set |
Gen AI suggestions to solve the build error: Based on the error output, there seems to be an issue with creating a symbolic link for Node.js during the Chromium build process. The specific error is:
To fix this, you can modify the Node.js setup section in the pipeline to:
Update this section in your melange.yaml: # === INFO === Use host's node
cd /home/src
mkdir -p third_party/node/linux/node-linux-x64/bin
rm -f third_party/node/linux/node-linux-x64/bin/node # Add this line
ln -sv /usr/bin/node third_party/node/linux/node-linux-x64/bin/ This modification will:
The error occurs because the symlink target already exists, and the |
Gen AI suggestions to solve the build error: Based on the build error, there's a conflict with the
- runs: |
# Add -U_FORTIFY_SOURCE before defining it to undefine any previous definition
export CFLAGS="$CFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wno-unknown-warning-option -Wno-builtin-macro-redefined -Wno-deprecated-declarations -Wno-shift-count-overflow -Wno-ignored-attributes"
export CXXFLAGS="$CXXFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wno-unknown-warning-option -Wno-builtin-macro-redefined -Wno-deprecated-declarations -Wno-invalid-constexpr"
time gn gen /home/src/out/Default --args="
# ... existing args ...
enable_iterator_debugging=false
# Add this line:
is_fortify_source=false
# ... rest of existing args ...
" The first approach is recommended since Chromium is typically built with FORTIFY_SOURCE=2, and this will ensure better compatibility. The -U_FORTIFY_SOURCE flag will undefine any previous definition before setting it to 2. These warnings are causing the build to fail because they're being treated as errors. The fix should resolve the macro redefinition conflict and allow the build to proceed. |
Gen AI suggestions to solve the build error: Based on the error output, the main issue appears to be that bindgen cannot find the 'stddef.h' header file when trying to generate Rust bindings for libyuv. Here are some suggestions to fix this:
environment:
contents:
packages:
# Add this near the top of your package list
- libc-dev
# ... rest of your existing packages
environment:
environment:
CFLAGS: "${CFLAGS} -I/usr/lib/llvm-19/lib/clang/19/include"
CXXFLAGS: "${CXXFLAGS} -I/usr/lib/llvm-19/lib/clang/19/include"
environment:
environment:
CPPFLAGS: "${CPPFLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2" Try these changes and see if they resolve the bindgen error. The most important one is likely adding libc-dev as it provides the missing header file. If the issue persists, you can try debugging the bindgen command directly when running melange with --interactive by:
|
de7c32f
to
eccd1b5
Compare
Gen AI suggestions to solve the build error: Based on the build error, it appears the main issue is with the Rust bindgen tool failing to find the
Here are a few suggestions to fix this:
environment:
contents:
packages:
- gcc-dev
# existing packages...
environment:
contents:
packages:
- libc-dev
# existing packages...
Try adding both The error occurs during the rust bindgen step when trying to generate bindings for the libyuv library, so ensuring all required system headers are available is crucial. |
7388673
to
aab4d10
Compare
Gen AI suggestions to solve the build error: Based on the error message, the main issue appears to be:
This suggests that the path structure in the Chromium source code has changed in version 130.0.6723.116. Here are a few steps to fix this:
sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \
-i services/device/public/cpp/usb/BUILD.gn needs to be updated with the correct path.
if [ -f services/device/public/cpp/usb/BUILD.gn ]; then
sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \
-i services/device/public/cpp/usb/BUILD.gn
fi
The underlying issue is likely due to Chromium's source code structure changing between versions, which is common in large projects. The fix involves updating the paths to match the new source code structure. |
Gen AI suggestions to solve the build error: Based on the error message, it appears the build is failing because it can't find the file Here are a few steps to debug and fix this:
- runs: |
# Debug: Check directory structure
find . -name "BUILD.gn" | grep -i usb
# Then update the sed path accordingly
# Update the path if different:
sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \
-i path/to/correct/BUILD.gn
- runs: |
if [ -f services/device/public/cpp/usb/BUILD.gn ]; then
sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \
-i services/device/public/cpp/usb/BUILD.gn
fi
# Comment out temporarily to debug
# sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \
# -i services/device/public/cpp/usb/BUILD.gn Try these approaches one at a time to identify and fix the issue. The most likely solution is that the path needs to be updated to match the current Chromium source structure. |
62f5534
to
d76d027
Compare
Gen AI suggestions to solve the build error: Based on the error output, it seems the build is failing when trying to remove a file named 'FILE' that doesn't exist. This is likely happening during the cleanup phase after the source tarball is downloaded and verified. Here are a few suggestions to fix this issue:
runs: |
rm -f FILE # Instead of just rm FILE
melange build --interactive package.yaml Then you can:
runs: |
scanelf -RA -F "%F" "$HOME" | while read -r elf; do
rm -f "$elf"
done Make sure this operation handles empty/missing files correctly. The most straightforward fix would be to make any |
Gen AI suggestions to solve the build error: Based on the error log, there are two main issues to address:
Let's fix these issues:
- runs: |
# Modified scanelf command to properly handle binaries
find "$HOME" -type f -executable -o -name "*.so*" | while read -r file; do
if file "$file" | grep -q "ELF"; then
rm -f "$file"
fi
done
# Change from:
time ninja -C $HOME/out/Default chrome chromedriver.unstripped chrome_crashpad_handler chrome_sandbox
# To:
time ninja -C /home/src/out/Default chrome chromedriver.unstripped chrome_crashpad_handler chrome_sandbox Also, ensure the gn gen command creates the output directory first: mkdir -p /home/src/out/Default
time gn gen /home/src/out/Default --args=" These changes should:
When debugging interactively, you can verify the correct paths exist using: ls -la /home/src/out/Default # Check if directory exists
pwd # Verify current working directory |
d76d027
to
d81dcc9
Compare
Gen AI suggestions to solve the build error: Based on the error output, the main issue appears to be with the Rust bindgen tool failing to find the
environment:
contents:
packages:
- libc-dev # Add this line
# ... existing packages ...
pipeline:
- runs: |
# Add system include paths to CFLAGS
export CFLAGS="$CFLAGS -I/usr/include"
# ... rest of the build commands ...
environment:
environment:
# Remove or update any _FORTIFY_SOURCE definition to match the system value (3)
CFLAGS: "-D_FORTIFY_SOURCE=3"
environment:
environment:
# Add these to help find necessary headers
CFLAGS: "-I/usr/include -I/usr/lib/llvm-19/lib/clang/19/include"
CXXFLAGS: "-I/usr/include -I/usr/lib/llvm-19/lib/clang/19/include" Try these changes one at a time, starting with adding |
86107c4
to
4dad9b1
Compare
Gen AI suggestions to solve the build error: Based on the error output, there are two main issues:
Here are the suggested fixes:
environment:
contents:
packages:
- musl-dev # Add this package
export CPPFLAGS="${CPPFLAGS/-D_FORTIFY_SOURCE=2/} -D__DATE__= -D__TIME__= -D__TIMESTAMP__="
environment:
contents:
packages:
- clang-dev
- rust-bindgen These changes should resolve the header file missing errors and the macro redefinition warnings. The key issues were missing development headers and conflicting compiler flags. Try these changes and rebuild. If you still encounter issues, you may need to adjust the rust-bindgen configuration or add additional development packages. |
Gen AI suggestions to solve the build error: Based on the error output, there are two main issues to address:
This suggests missing C standard library headers needed for the build.
Here are the suggested fixes:
environment:
contents:
packages:
# Add these packages
- libc-dev
- clang-${{vars.llvm-version}}-dev
# ... rest of existing packages
environment:
environment:
# Add these along with existing environment vars
CPATH: "/usr/include"
C_INCLUDE_PATH: "/usr/include"
CPLUS_INCLUDE_PATH: "/usr/include"
The key focus should be on ensuring the basic C headers are available to the build system by adding the libc-dev package and setting up the include paths correctly. Testing locally with --interactive would allow you to verify the headers are available by checking: ls /usr/include/stddef.h |
@EyeCantCU i'm curious to why we need to switch to gentoo's tarball? |
@tuananh it saves us from needing to run gclient to fetch Chromium's dependencies. gclient pulls down utilities based on arch and a few are only present for linux-x64. The idea actually came from Alpine where they do this to build Chromium for aarch64 natively Gentoo hosts archives for each Chromium revision where they've gone ahead and synced dependencies themselves with gclient and then produced a tarball. I guess we could do that with qemu |
Interesting. Up until now, Wolfi only provide amd64 build for chromium right? |
Exactly |
e4809a5
to
1349bdd
Compare
Gen AI suggestions to solve the build error: Based on the error output, there are two main issues:
Here are the suggested fixes:
environment:
contents:
packages:
# Add these packages
- clang-runtime-${{vars.llvm-version}}
- compiler-rt-${{vars.llvm-version}}
- libc-dev
environment:
environment:
# Remove _FORTIFY_SOURCE=2 from CFLAGS/CXXFLAGS if set
CFLAGS: "-Wno-unknown-warning-option -Wno-builtin-macro-redefined -Wno-deprecated-declarations -Wno-shift-count-overflow -Wno-ignored-attributes"
CXXFLAGS: "-Wno-unknown-warning-option -Wno-builtin-macro-redefined -Wno-deprecated-declarations -Wno-invalid-constexpr"
pipeline:
- runs: |
# Add this before bindgen commands
export BINDGEN_EXTRA_CLANG_ARGS="-I/usr/lib/clang/${{vars.llvm-version}}/include" These changes should help resolve the header file not found errors and the FORTIFY_SOURCE conflict. The key is ensuring the proper header files are available and managing the compiler flags consistently. Try these changes one at a time to identify which resolves the issue while maintaining the security benefits of FORTIFY_SOURCE. |
Gen AI suggestions to solve the build error: Based on the error output, the main issue appears to be that bindgen cannot find the 'stddef.h' header file when trying to generate Rust bindings for the libyuv library. The specific error is:
Here are a few suggestions to fix this:
environment:
contents:
packages:
# Add these packages
- linux-headers
- clang-dev
- glibc-dev-static
environment:
environment:
BINDGEN_EXTRA_CLANG_ARGS: "-I/usr/include -I/usr/lib/clang/19/include"
environment:
environment:
CFLAGS: "-D_FORTIFY_SOURCE=3"
CXXFLAGS: "-D_FORTIFY_SOURCE=3" Try implementing these changes one at a time to see which resolves the issue. The most likely fix is adding the correct header paths for bindgen. |
Gen AI suggestions to solve the build error: Based on the error log, the main issue appears to be with bindgen failing to find the 'stddef.h' header file:
Here are a few steps to help fix this issue:
environment:
contents:
packages:
- clang-dev
# ... existing packages ...
environment:
environment:
CFLAGS: "-I/usr/include"
CXXFLAGS: "-I/usr/include"
environment:
contents:
packages:
- libc-dev
# ... existing packages ...
pipeline:
- runs: |
# Add to existing bindgen command
--clang-arg=-I/usr/include The error appears to be related to missing system headers during the Rust bindgen process. Adding the appropriate development packages and include paths should resolve the issue. Choose the solution that best fits your needs - starting with adding clang-dev and libc-dev would be the most straightforward approach. |
Adds runtimes for LLVM 19 Signed-off-by: RJ Sampson <rj.sampson@chainguard.dev>
Signed-off-by: RJ Sampson <rj.sampson@chainguard.dev>
1349bdd
to
a0c708e
Compare
Gen AI suggestions to solve the build error: Based on the error output, I'll provide a detailed analysis and solution: • Detected Error: • Error Category: Build Configuration • Failure Point: Python script execution in • Root Cause Analysis: The script is trying to replace GN build files for system libraries, but some expected files are missing after the cleanup step. This suggests the cleanup script removed files needed by the build system. • Suggested Fix:
system_libs="
brotli
crc32c
dav1d
double-conversion
# Remove flac from this list
fontconfig
harfbuzz-ng
libdrm
libevent
libjpeg
libsecret
libusb
libwebp
libxml
libxslt
openh264
opus
zlib
zstd
"
\! -path "*third_party/flac/*" \ • Explanation: The current unbundling process is trying to use the system FLAC library but failing to properly handle the build file replacement. By removing FLAC from the system libraries list, we'll let Chromium use its bundled version instead, which is a common approach when system library integration causes issues. • Additional Notes:
• References:
|
Fixes:
Related:
Pre-review Checklist
For new package PRs only
endoflife.date
)For new version streams
name: ${{package.name}}-compat
)provides:
logical unversioned forms of the package (e.g.nodejs
,nodejs-lts
)For package updates (renames) in the base images
When updating packages part of base images (i.e. cgr.dev/chainguard/wolfi-base or ghcr.io/wolfi-dev/sdk)
apk upgrade --latest
successfully upgrades packages or performs no actionsFor security-related PRs
For version bump PRs
epoch
field is reset to 0For PRs that add patches