Skip to content
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

zetasql/2024.08.2 package update #26865

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

octo-sts[bot]
Copy link
Contributor

@octo-sts octo-sts bot commented Aug 21, 2024

@octo-sts octo-sts bot added request-version-update request for a newer version of a package automated pr labels Aug 21, 2024
Copy link
Contributor Author

octo-sts bot commented Aug 21, 2024

Open AI suggestions to solve the build error:

The error log indicates that there is a missing file (`file.hpp`) in the specified directory, which is causing the build to fail. Here are the key points from the error log:

1. **Missing File**: `file.hpp` is not found in the directory `/home/build/.cache/bazel/_bazel_root/79a1bfc8c8b5b6a6d226b38d072f165b/external/boost/libs/wave/test/testwave/testfiles/utf8-test-ßµ™∃/`.
2. **Build Failure**: This missing file leads to the failure of the Boost build and subsequently the failure of the `zetasql` package build.
3. **Error Codes**: The process completed with exit code 2, indicating an error during the build process.

To resolve this issue, you should:
- Verify the existence of `file.hpp` in the specified directory.
- Ensure the path encoding supports special characters.
- Check if the file was accidentally deleted or moved.
- Update the `BUILD.bazel` file to correct the path if necessary.
- Rebuild the project after making the necessary corrections.

Copy link
Contributor Author

octo-sts bot commented Aug 22, 2024

Open AI suggestions to solve the build error:

The error log indicates issues with missing files and build failures related to the Boost library and the zetasql package. Here are the key points:

1. **Missing File**: The file `file.hpp` in the directory `@boost//:libs/wave/test/testwave/testfiles/utf8-test-ßµ™∃/` is not found.
2. **Boost Library Build Failure**: The Boost library build failed due to the missing file.
3. **Zetasql Package Build Failure**: The zetasql package build failed because of the Boost library build failure.

Steps to resolve:
1. Verify the existence of `file.hpp` in the specified directory.
2. Ensure the path encoding supports special characters.
3. Check for any issues with the Boost library setup.
4. Rebuild the Boost library.
5. Retry building the zetasql package.

Copy link
Contributor Author

octo-sts bot commented Aug 22, 2024

Open AI suggestions to solve the build error:

The error message is: 

ERROR: /home/build/.cache/bazel/_bazel_root/79a1bfc8c8b5b6a6d226b38d072f165b/external/boost/BUILD.bazel:27:12: Foreign Cc - BoostBuild: Building boost failed: error reading file '@boost//:libs/wave/test/testwave/testfiles/utf8-test-ßµ™∃/file.hpp': /home/build/.cache/bazel/_bazel_root/79a1bfc8c8b5b6a6d226b38d072f165b/external/boost/libs/wave/test/testwave/testfiles/utf8-test-ßµ™∃/file.hpp (No such file or directory)
ERROR: /home/build/.cache/bazel/_bazel_root/79a1bfc8c8b5b6a6d226b38d072f165b/external/boost/BUILD.bazel:27:12: Foreign Cc - BoostBuild: Building boost failed: 1 input file(s) are in error
ERROR: /home/build/zetasql/tools/execute_query/BUILD:112:10 Linking zetasql/tools/execute_query/execute_query failed: 1 input file(s) are in error
ERROR: failed to build package. the build environment has been preserved:
INFO workspace dir: /temp/melange-workspace-287737954
INFO guest dir: /temp/melange-guest-2289687969
failed to build package: unable to run package zetasql pipeline: unable to run pipeline: exit status 1
make[1]: *** [Makefile:111: packages/aarch64/zetasql-2024.08.2-r0.apk] Error 1
make[1]: Leaving directory '/github/home'
make: *** [Makefile:101: package/zetasql] Error 2
##[error]Process completed with exit code 2.


1. Verify the file path and ensure `file.hpp` exists.
2. Check for any special character issues in the file path.
3. Update the `BUILD.bazel` file to correct the path if necessary.
4. Rebuild the project.

@mamccorm
Copy link
Member

Looks like its something UTF-8 related?

utf8-test-ßµ™∃/file.hpp

Tried adding: LANG: en_US.UTF-8

Copy link
Contributor Author

octo-sts bot commented Aug 23, 2024

Open AI suggestions to solve the build error:

The error message indicates that there is a missing file named `𞤀𞤣𞤤𞤢𞤥 𞤆𞤵𞤤𞤢𞤪.txt` in the specified directory, which is causing the build to fail. Here are the steps to resolve the issue:

1. Verify the existence of the file `𞤀𞤣𞤤𞤢𞤥 𞤆𞤵𞤤𞤢𞤪.txt` in the directory `/home/build/.cache/bazel/_bazel_root/79a1bfc8c8b5b6a6d226b38d072f165b/external/civetweb/test/nonlatin/`.
2. Ensure the file path is correctly referenced in the `BUILD.bazel` file.
3. Check for any encoding issues with the file name.
4. If the file is missing, add it or update the build script to exclude it.
5. Re-run the build process.

@xnox xnox force-pushed the wolfictl-5e9bb8b1-c101-4619-a89b-7266b77d5e93 branch from 4c3b48a to b5acb50 Compare September 20, 2024 16:54
Copy link
Contributor Author

octo-sts bot commented Sep 20, 2024

Open AI suggestions to solve the build error:

The error message indicates that there is a missing file `utf8-test-ßµ™∃/file.hpp` in the Boost library, which is causing the build to fail. Here are the steps to resolve the issue:

1. Verify the existence of `utf8-test-ßµ™∃/file.hpp` in the specified directory.
2. Ensure the file path is correctly referenced in `BUILD.bazel`.
3. Check for any special character handling issues in file paths.
4. Rebuild the Boost library.
5. Retry building the zetasql package.

@hbh7 hbh7 self-assigned this Oct 2, 2024
@philroche
Copy link
Member

Changes summary:
Total files changed: 300

Total changes: 26070
Total additions: 22237
Total deletions: 3833

Total commits: 2

GitHub compare URL: google/zetasql@f6df697...194cd32

@hbh7
Copy link
Member

hbh7 commented Oct 4, 2024

I was able to resolve the UTF-8 issue by adding the glibc-locale-en package, which added proper support for UTF-8 operations. I believe the original LANG environment variable change wasn't necessary (it still "builds" if I remove it) but it certainly isn't hurting.

However, that uncovered a new build failure issue with civetweb, which I've been unable to resolve with my limited Bazel debugging knowledge. It isn't generating the expected output files and therefore fails the build. Civetweb was added with this version bump, more details here: google/zetasql@f6df697...194cd32. Version 2024.08.1 also does not build.

I tried adding an assortment of potential missing dependencies with no luck:

environment > contents > packages:
- cmake
- openssl
- openssl-dev
- zlib
- zlib-dev
- libstdc++
- libstdc++-dev
- cmake-bootstrap

Relevant logs, with -s added to the bazel build command for extra debug output. The actual amount of useful information in the logs is unfortunately very limited, especially as it relates to civetweb failures. These are the only lines containing the word civetweb.

Click to expand
...
2024/10/04 15:18:41 WARN # Execution platform: @local_config_platform//:host                                                                                                                  
2024/10/04 15:18:41 WARN SUBCOMMAND: # @civetweb//:civetweb [action 'Foreign Cc - CMake: Building civetweb', configuration: 772f2b78b6fc5b9666c4bda72392374662cce78f09a5460b496546271dc56632, 
execution platform: @local_config_platform//:host]                                                                                                                                            
2024/10/04 15:18:41 WARN (cd /home/build/.cache/bazel/_bazel_build/79a1bfc8c8b5b6a6d226b38d072f165b/execroot/com_google_zetasql && \                                                          
2024/10/04 15:18:41 WARN   exec env - \                                                                                                                                                       
2024/10/04 15:18:41 WARN     BAZEL_CXXOPTS='-std=c++17' \                                                                                                                                     
2024/10/04 15:18:41 WARN     CC=/usr/bin/gcc \                                                                                                                                                
2024/10/04 15:18:41 WARN     CCX=/usr/bin/g++ \                                                                                                                                               
2024/10/04 15:18:41 WARN     PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \                                                                                              
2024/10/04 15:18:41 WARN   /bin/bash -c bazel-out/k8-opt/bin/external/civetweb/civetweb_foreign_cc/wrapper_build_script.sh)                                                                   
2024/10/04 15:18:41 WARN # Configuration: 772f2b78b6fc5b9666c4bda72392374662cce78f09a5460b496546271dc56632                                                                                    
2024/10/04 15:18:41 WARN # Execution platform: @local_config_platform//:host 
...
2024/10/04 14:57:03 WARN # Execution platform: @local_config_platform//:host
2024/10/04 14:57:04 WARN ERROR: /home/build/.cache/bazel/_bazel_build/79a1bfc8c8b5b6a6d226b38d072f165b/external/civetweb/BUILD.bazel:30:6: output 'external/civetweb/civetweb/lib/libcivetweb.a' was not created
2024/10/04 14:57:04 WARN ERROR: /home/build/.cache/bazel/_bazel_build/79a1bfc8c8b5b6a6d226b38d072f165b/external/civetweb/BUILD.bazel:30:6: output 'external/civetweb/civetweb/lib/libcivetweb-cpp.a' was not created
2024/10/04 14:57:04 WARN ERROR: /home/build/.cache/bazel/_bazel_build/79a1bfc8c8b5b6a6d226b38d072f165b/external/civetweb/BUILD.bazel:30:6: Foreign Cc - CMake: Building civetweb failed: not all outputs were created or valid
2024/10/04 14:57:04 WARN [6,875 / 12,235] Foreign Cc - BoostBuild: Building boost; 56s linux-sandbox
2024/10/04 14:57:06 WARN ERROR: /home/build/zetasql/tools/execute_query/BUILD:112:10 Linking zetasql/tools/execute_query/execute_query failed: not all outputs were created or valid
2024/10/04 14:57:06 WARN INFO: Elapsed time: 148.526s, Critical Path: 115.50s
2024/10/04 14:57:06 WARN INFO: 6876 processes: 4379 internal, 2491 linux-sandbox, 2 local, 4 worker.
2024/10/04 14:57:06 WARN FAILED: Build did NOT complete successfully
2024/10/04 14:57:06 ERRO ERROR: failed to build package. the build environment has been preserved:
2024/10/04 14:57:06 INFO   workspace dir: /home/user/tmp/melange-workspace-2899128937
2024/10/04 14:57:06 INFO   guest dir: /home/user/tmp/melange-guest-155107094
2024/10/04 14:57:06 ERRO failed to build package: unable to run package zetasql pipeline: unable to run pipeline: exit status 1
make[1]: *** [Makefile:111: packages/x86_64/zetasql-2024.08.2-r0.apk] Error 1
make[1]: Leaving directory '/home/user/os'
make: *** [Makefile:101: package/zetasql] Error 2

Supposedly, the build script that's running and then not working correctly:

Click to expand
hunter-harris:~/tmp/melange-workspace-4005349466$ cat ./.cache/bazel/_bazel_build/79a1bfc8c8b5b6a6d226b38d072f165b/execroot/com_google_zetasql/bazel-out/k8-opt/bin/external/civetweb/civetweb_foreign_cc/wrapper_build_script.sh
#!/usr/bin/env bash
function cleanup_function() {
local ecode=$?
if [ $ecode -eq 0 ]; then
cleanup_on_success
else
cleanup_on_failure
fi
}
set -e
function cleanup_on_success() {
  rm -rf $BUILD_TMPDIR $EXT_BUILD_DEPS
}
function cleanup_on_failure() {
echo ""rules_foreign_cc: Build failed!""
echo ""rules_foreign_cc: Keeping temp build directory $BUILD_TMPDIR and dependencies directory $EXT_BUILD_DEPS for debug.""
echo ""rules_foreign_cc: Please note that the directories inside a sandbox are still cleaned unless you specify '--sandbox_debug' Bazel command line flag.""
echo ""rules_foreign_cc: Printing build logs:""
echo ""_____ BEGIN BUILD LOGS _____""
cat "$BUILD_LOG"
echo ""_____ END BUILD LOGS _____""
echo ""rules_foreign_cc: Build wrapper script location: $BUILD_WRAPPER_SCRIPT""
echo ""rules_foreign_cc: Build script location: $BUILD_SCRIPT""
echo ""rules_foreign_cc: Build log location: $BUILD_LOG""
echo """"
}
trap "cleanup_function" EXIT
export BUILD_WRAPPER_SCRIPT="bazel-out/k8-opt/bin/external/civetweb/civetweb_foreign_cc/wrapper_build_script.sh"
export BUILD_SCRIPT="bazel-out/k8-opt/bin/external/civetweb/civetweb_foreign_cc/build_script.sh"
export BUILD_LOG="bazel-out/k8-opt/bin/external/civetweb/civetweb_foreign_cc/CMake.log"
touch $BUILD_LOG
$BUILD_SCRIPT &> $BUILD_LOG

The script called by the previous script (please excuse minor copy paste formatting issues):

Click to expand
hunter-harris:~/tmp/melange-workspace-4005349466$ cat ./.cache/bazel/_bazel_build/79a1bfc8c8b5b6a6d226b38d072f165b/execroot/com_google_zetasql/bazel-out/k8-opt/bin/external/civetweb/civetweb
_foreign_cc/build_script.sh                                                                                           
#!/usr/bin/env bash                                                                                                                                                                           
function symlink_to_dir() {                                                                                                                                                                   
if [[ -z "$1" ]]; then                                                                                                                                                                        
echo "arg 1 to symlink_to_dir is unexpectedly empty"                                                                                                                                          
exit 1                                                                                                                                                                                        
fi                                                                                                                                                                                            
if [[ -z "$2" ]]; then                                                                                                                                                                        
echo "arg 2 to symlink_to_dir is unexpectedly empty"                             
exit 1                                       
fi                                                                                             
local target="$2"                                                                                                                                                                             
mkdir -p "$target"                                                                                                                                                                            
if [[ -f "$1" ]]; then                                                                                                                                                                        
# In order to be able to use `replace_in_files`, we ensure that we create copies of specfieid                                                                                                 
# files so updating them is possible.                                                                                                                                                         
if [[ "$1" == *.pc || "$1" == *.la || "$1" == *-config || "$1" == *.mk || "$1" == *.cmake ]]; then                                                                    
dest="$target/$(basename "$1")"                                                                                                                                                               
cp "$1" "$dest" && chmod +w "$dest" && touch -r "$1" "$dest"                                                                                                                                  
else                                                                                                                                                                                          
ln -sf "$1" "$target/${1##*/}"                                                                                                                                                                
fi                                                                                             
elif [[ -L "$1" && ! -d "$1" ]]; then                                                                                                                                                         cp -pR "$1" "$2"                                                                                                                                                                              elif [[ -d "$1" ]]; then                                                                                                                                                                      
SAVEIFS=$IFS                                                                                                                                                                                  
IFS=$'                                                                                                                                                                                        '                                                                                                                                                                                             local children=($(find -H "$1" -maxdepth 1 -mindepth 1))                                                                                                                                      IFS=$SAVEIFS                                                                                   
local dirname=$(basename "$1")                                                                                                                                                                
mkdir -p "$target/$dirname"                                                                                                                                                                   for child in "${children[@]:-}"; do                                                                                                                                                           if [[ -n "$child" && "$dirname" != *.ext_build_deps ]]; then                                                                                                                                  
symlink_to_dir "$child" "$target/$dirname"                                                                                                                                                    
fi                                                                                                                                                                                            
done                              
else                                                                                           
echo "Can not copy $1"                                                                         
fi                                                                                             
}                                                                                              
function children_to_path() {                                                                  
if [ -d $EXT_BUILD_DEPS/bin ]; then                                                            
local tools=$(find "$EXT_BUILD_DEPS/bin" -maxdepth 1 -mindepth 1)                              
for tool in $tools;                                                                            
do    
if  [[ -d "$tool" ]] || [[ -L "$tool" ]]; then
export PATH=$PATH:$tool                                                                                                                                                                       fi                                                                                                                                                                                            done                                                                                           
fi                                                                                             
}                                                                                                                                                                                             
function replace_in_files() {                                                                                                                                                                 
if [ -d "$1" ]; then                                                                           
SAVEIFS=$IFS                                                                                   
IFS=$'                                                                                         
'                                                                                              
# Find all real files. Symlinks are assumed to be relative to something within the directory we're seaching and thus ignored                                                                  local files=($(find -P "$1" \( -type f -and \( -name "*.pc" -or -name "*.la" -or -name "*-config" -or -name "*.mk" -or -name "*.cmake" \) \)))                                                
IFS=$SAVEIFS                                                                                   
for file in ${files[@]+"${files[@]}"}; do                                                      
local backup=$(mktemp)                                                                         
touch -r "${file}" "${backup}"                                                                                                                                                                
sed -i 's@'"$2"'@'"$3"'@g' "${file}"                                                                                                                                                          
if [[ "$?" -ne "0" ]]; then                                                                                                                                                                   
exit 1                                                                                         
fi                                                                                                                                                                                            
touch -r "${backup}" "${file}"                                                                                                                                                                
rm "${backup}"                                                                                                                                                                                
done                                         
fi                                                                                                                                                                                            
}                                                                                                                                                                                             
echo """"                                                                                                                                                                                     
echo ""Bazel external C/C++ Rules. Building library 'civetweb'""                                                                                                                              
echo """"                                                                                                                                                                                     
set -euo pipefail                                                                                                                                                                             
export EXT_BUILD_ROOT=$(pwd)                                                                                                                                                                  
export INSTALLDIR=$EXT_BUILD_ROOT/bazel-out/k8-opt/bin/external/civetweb/civetweb                                                                                                             
export BUILD_TMPDIR=$INSTALLDIR.build_tmpdir                                                                                                                                                  
export EXT_BUILD_DEPS=$INSTALLDIR.ext_build_deps                                                                                                                                              
export PATH="$EXT_BUILD_ROOT:$PATH"                                                            
rm -rf $BUILD_TMPDIR                         
rm -rf $EXT_BUILD_DEPS                                                                         
mkdir -p $INSTALLDIR                                                                                                                                                                          
mkdir -p $BUILD_TMPDIR                                                                                                                                                                        
mkdir -p $EXT_BUILD_DEPS                                                                                                                                                                      
echo ""Environment:______________""                                                                                                                                                           
env                                                                                                                                                                                           
echo ""__________________________""                                                                                                                                                           
mkdir -p $EXT_BUILD_DEPS/bin                                                                                                                                                                  
symlink_to_dir $EXT_BUILD_ROOT/external/cmake-3.23.2-linux-x86_64/bin $EXT_BUILD_DEPS/bin/                                                                                                    
symlink_to_dir $EXT_BUILD_ROOT/bazel-out/k8-opt-exec-2B5CBBC6/bin/external/rules_foreign_cc/toolchains $EXT_BUILD_DEPS/bin/                                                                   
children_to_path $EXT_BUILD_DEPS/bin                                                                                                                                                          
export PATH="$EXT_BUILD_DEPS/bin:$PATH"                                                        
cd $BUILD_TMPDIR                                                                                                                                                                              __var_CMAKE_AR="/usr/bin/ar"                                                                                                                                                                  __var_CMAKE_ASM_FLAGS_INIT="-U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -D_FORTIFY_SOURCE=1 -DNDEBUG -ffunct
ion-sections -fdata-sections -fno-canonical-system-headers -Wno-builtin-macro-redefined -D__DATE__=\\\\\\\"redacted\\\\\\\" -D__TIMESTAMP__=\\\\\\\"redacted\\\\\\\" -D__TIME__=\\\\\\\"redact
ed\\\\\\\""                                                                                                                                                                                   __var_CMAKE_CXX_COMPILER="/usr/bin/gcc"                                                                                                                                                       __var_CMAKE_CXX_FLAGS_INIT="-U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -D_FORTIFY_SOURCE=1 -DNDEBUG -ffunction-sections -fdata-sections -std=c++17 -fno-canonical-system-headers -Wno-builtin-macro-redefined -D__DATE__=\\\\\\\"redacted\\\\\\\" -D__TIMESTAMP__=\\\\\\\"redacted\\\\\\\" -D__TIME__=\\\
\\\\"redacted\\\\\\\" -Wno-sign-compare -Wno-switch -Wno-unused-function -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Wno-char-subscripts -Wno-nonnull-compare -Wno-return-type
 -Wno-class-memaccess -Wno-deprecated-declarations -Wno-stringop-truncation -fPIC"                                                                                                            __var_CMAKE_C_COMPILER="/usr/bin/gcc"                                                                                                                                                         __var_CMAKE_C_FLAGS_INIT="-U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -D_FORTIFY_SOURCE=1 -DNDEBUG -ffunctio
n-sections -fdata-sections -fno-canonical-system-headers -Wno-builtin-macro-redefined -D__DATE__=\\\\\\\"redacted\\\\\\\" -D__TIMESTAMP__=\\\\\\\"redacted\\\\\\\" -D__TIME__=\\\\\\\"redacted
\\\\\\\" -fPIC"                                                                                                                                                                               
__var_CMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=gold -Wl,-no-as-needed -Wl,-z,relro,-z,now -B/usr/bin -pass-exit-codes -Wl,--gc-sections -lstdc++ -lm -fno-lto -ldl"
__var_CMAKE_SHARED_LINKER_FLAGS_INIT="-shared -fuse-ld=gold -Wl,-no-as-needed -Wl,-z,relro,-z,now -B/usr/bin -pass-exit-codes -Wl,--gc-sections -lstdc++ -lm -fno-lto -ldl"
cat > crosstool_bazel.cmake << EOF                                                             
set(CMAKE_AR "$__var_CMAKE_AR" CACHE FILEPATH "Archiver")                                      
set(CMAKE_ASM_FLAGS_INIT "$__var_CMAKE_ASM_FLAGS_INIT")                                        
set(CMAKE_CXX_COMPILER "$__var_CMAKE_CXX_COMPILER")                                            
set(CMAKE_CXX_FLAGS_INIT "$__var_CMAKE_CXX_FLAGS_INIT")                                        
set(CMAKE_C_COMPILER "$__var_CMAKE_C_COMPILER")                                                
set(CMAKE_C_FLAGS_INIT "$__var_CMAKE_C_FLAGS_INIT")                                            
set(CMAKE_EXE_LINKER_FLAGS_INIT "$__var_CMAKE_EXE_LINKER_FLAGS_INIT")
set(CMAKE_SHARED_LINKER_FLAGS_INIT "$__var_CMAKE_SHARED_LINKER_FLAGS_INIT")
EOF                                                                                                                                                                                           
set -x                                                                                                                                                                                        $EXT_BUILD_ROOT/external/cmake-3.23.2-linux-x86_64/bin/cmake -DCMAKE_TOOLCHAIN_FILE="$BUILD_TMPDIR/crosstool_bazel.cmake" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -D
CMAKE_PREFIX_PATH="$EXT_BUILD_DEPS" -DCMAKE_RANLIB="" -DCIVETWEB_ENABLE_CXX=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_MAKE_PROGRAM=$EXT_BUILD_ROOT/bazel-out/k8-opt-exec-2B5CBBC6/bin/external/rules_
foreign_cc/toolchains/make/bin/make -G 'Unix Makefiles' $EXT_BUILD_ROOT/external/civetweb                                                                                                     
$EXT_BUILD_ROOT/external/cmake-3.23.2-linux-x86_64/bin/cmake --build . --config Release                                                                                                       
$EXT_BUILD_ROOT/external/cmake-3.23.2-linux-x86_64/bin/cmake --install . --config Release      
set +x                                                                                         
replace_in_files $INSTALLDIR $BUILD_TMPDIR \${EXT_BUILD_DEPS}                                  
replace_in_files $INSTALLDIR $EXT_BUILD_DEPS \${EXT_BUILD_DEPS}                                
replace_in_files $INSTALLDIR $EXT_BUILD_ROOT \${EXT_BUILD_ROOT}                                                                                                                               mkdir -p $EXT_BUILD_ROOT/bazel-out/k8-opt/bin/external/civetweb/copy_civetweb/civetweb                                                                                                        
cp -L -r --no-target-directory "$INSTALLDIR" "$EXT_BUILD_ROOT/bazel-out/k8-opt/bin/external/civetweb/copy_civetweb/civetweb" && find "$EXT_BUILD_ROOT/bazel-out/k8-opt/bin/external/civetweb/copy_civetweb/civetweb" -type f -exec touch -r "$INSTALLDIR" "{}" \;                            
cd $EXT_BUILD_ROOT                            
if [[ -L "bazel-out/k8-opt/bin/external/civetweb/civetweb/lib/libcivetweb.a" ]]; then                                                                                                         
  target="$(readlink -f "bazel-out/k8-opt/bin/external/civetweb/civetweb/lib/libcivetweb.a")"  
  rm "bazel-out/k8-opt/bin/external/civetweb/civetweb/lib/libcivetweb.a" && cp -a "${target}" "bazel-out/k8-opt/bin/external/civetweb/civetweb/lib/libcivetweb.a"
fi                                                                                             
                                                                                               
if [[ -L "bazel-out/k8-opt/bin/external/civetweb/civetweb/lib/libcivetweb-cpp.a" ]]; then                                                                                                       target="$(readlink -f "bazel-out/k8-opt/bin/external/civetweb/civetweb/lib/libcivetweb-cpp.a")"                                                                                             
  rm "bazel-out/k8-opt/bin/external/civetweb/civetweb/lib/libcivetweb-cpp.a" && cp -a "${target}" "bazel-out/k8-opt/bin/external/civetweb/civetweb/lib/libcivetweb-cpp.a"                     
fi 

hbh7 added a commit that referenced this pull request Oct 4, 2024
@hbh7 hbh7 added help wanted Extra attention is needed squad:lifecycle labels Oct 4, 2024
@hbh7 hbh7 removed their assignment Oct 4, 2024
Copy link
Contributor Author

octo-sts bot commented Oct 4, 2024

Open AI suggestions to solve the build error:

The error log indicates several issues related to the CivetWeb library during the build process. Here are the key points and suggestions for resolution:

1. **Missing Outputs**: The build process failed to create the expected output files `libcivetweb.a` and `libcivetweb-cpp.a`. This suggests a problem in the build configuration or missing dependencies.

2. **CMake Build Failure**: The error "Foreign Cc - CMake: Building civetweb failed" indicates that the CMake build process for CivetWeb did not complete successfully.

3. **Linking Failure**: The linking process for `zetasql/tools/execute_query/execute_query` also failed, which might be a consequence of the earlier CivetWeb build failure.

4. **General Build Failure**: The overall package build failed, and the environment has been preserved for further investigation.

**Suggestions to Fix the Error**:
- **Verify Dependencies**: Ensure that all dependencies required by CivetWeb are installed and correctly configured.
- **Check Configuration**: Review the `BUILD.bazel` file for any misconfigurations or errors that might affect the build process.
- **CMake Configuration**: Ensure that the CMake configuration for CivetWeb is correct and that all necessary files and settings are in place.
- **Clean Bazel Cache**: Run `bazel clean --expunge` to clear the Bazel cache, which might resolve issues related to stale or corrupted build artifacts.
- **Review Recent Changes**: If there have been recent changes to the CivetWeb or ZetaSQL codebases, review them for potential issues that could affect the build process.

Copy link
Contributor Author

octo-sts bot commented Oct 4, 2024

Open AI suggestions to solve the build error:

The error log indicates several issues related to the CivetWeb build process:

1. The outputs `libcivetweb.a` and `libcivetweb-cpp.a` were not created.
2. The CivetWeb build failed due to missing or invalid outputs.
3. The linking of `zetasql/tools/execute_query/execute_query` failed.
4. The package build failed, and the environment was preserved for debugging.

Suggestions to resolve these errors include:

- Verify that all dependencies for CivetWeb are installed.
- Check the `BUILD.bazel` file for any misconfigurations.
- Ensure that the CMake configuration is correct.
- Clean the Bazel cache using `bazel clean --expunge`.
- Review any recent changes made to CivetWeb or ZetaSQL that might have caused these issues.

wolfi-bot and others added 4 commits October 28, 2024 10:38
Signed-off-by: wolfi-bot <121097084+wolfi-bot@users.noreply.github.com>
Signed-off-by: Mark McCormick <mark.mccormick@chainguard.dev>
@cpanato cpanato force-pushed the wolfictl-5e9bb8b1-c101-4619-a89b-7266b77d5e93 branch from 996bad8 to 935d9a2 Compare October 28, 2024 09:38
Copy link
Contributor Author

octo-sts bot commented Oct 28, 2024

Gen AI suggestions to solve the build error:

The error log indicates a compilation failure with GCC while building the `file_based_test_driver/test_case_options.cc` file. Here are some steps to address the issue:

1. **Check GCC Error Output**: Look for detailed error messages from GCC to understand the specific compilation issue.
2. **Ensure Dependencies**: Verify that all necessary dependencies are installed.
3. **GCC Version Compatibility**: Make sure the GCC version is compatible with the codebase.
4. **Clean Bazel Cache**: Run `bazel clean --expunge` to clear the cache.
5. **Rebuild**: Attempt to rebuild the project using `bazel build //...`.
6. **Review Source Code**: Examine the `test_case_options.cc` file for any potential issues or errors.

Copy link
Contributor Author

octo-sts bot commented Oct 28, 2024

Gen AI suggestions to solve the build error:

The error message indicates a failure in compiling `absl/flags/reflection.cc` due to a GCC error. Here are some steps to address the issue:

1. Verify that GCC is installed and that its version is compatible with the project requirements.
2. Check for any missing dependencies or incorrect paths in the Bazel build file.
3. Clean the Bazel cache using the command `bazel clean --expunge`.
4. Attempt to rebuild the project with `bazel build //...`.
5. Review the detailed GCC error log for more specific issues that might be causing the failure.

Copy link
Contributor Author

octo-sts bot commented Oct 28, 2024

Gen AI suggestions to solve the build error:

The error log indicates a compilation failure with GCC while building the `absl/flags/reflection.cc` file. Here are some steps to address the issue:

1. Verify that GCC is installed and check if its version is compatible with the project requirements.
2. Ensure there are no missing dependencies or incorrect paths in the Bazel build file.
3. Clean the Bazel cache using the command `bazel clean --expunge`.
4. Attempt to rebuild the project with `bazel build //...`.
5. Review the detailed GCC error log for more specific issues that might need attention.

@cpanato
Copy link
Member

cpanato commented Oct 28, 2024

this might require some help from foundations team

cc @xnox

@rawlingsj rawlingsj self-assigned this Nov 5, 2024
@rawlingsj
Copy link
Member

Based on the build error, it appears there's a compilation issue with abseil (Google's C++ library) when building ZetaSQL. The key error is related to a template instantiation problem in the hash policy traits.

Here are a few potential fixes to try in the melange YAML:

  1. Add specific compiler flags to work around the template issue:
environment:
  environment:
    BAZEL_ARGS: "--config=g++ --cxxopt=-std=c++17 --host_cxxopt=-std=c++17"
  1. Try using an older GCC version by modifying the build dependencies:
environment:
  contents:
    packages:
      - gcc-11  # Instead of latest gcc
  1. Add extra Bazel build options to work around the template issue:
environment:
  environment:
    BAZEL_ARGS: "--config=g++ --copt=-Wno-error"
    EXTRA_BAZEL_ARGS: "--tool_java_runtime_version=local_jdk --features=-debug_prefix_map_pwd_is_dot"
  1. Try building with specific Bazel build targets instead of "...":
pipeline:
  - runs: |
      cd zetasql
      bazel build --verbose_failures ${BAZEL_ARGS} $EXTRA_BAZEL_ARGS -c opt //zetasql/...

I would recommend trying these changes one at a time, starting with option #1 since it's the most targeted fix for the template instantiation error.

The core issue seems to be related to C++17 template evaluation rules and how they interact with constexpr expressions in the abseil library. The fixes above aim to either adjust the compiler behavior or work around the problematic code paths.

@rawlingsj
Copy link
Member

Next error:

Based on the build error, the main issue is with Boost dependencies required by the mstch package. The specific error is:

ERROR: no such package '@boost//': error globbing [**] op=FILES: /home/build/.cache/bazel/_bazel_root/79a1bfc8c8b5b6a6d226b38d072f165b/external/boost/tools/build/src/build (No such file or directory)

To fix this, we need to:

  1. Add Boost as a dependency in the environment section:
environment:
  contents:
    packages:
      - bash
      - bazel-6
      - binutils
      - build-base
      - boost-dev # Add this line
      - busybox
      # ... rest of packages

…eed to figure out the bazel cache issue and absil gcc error this should cause

Signed-off-by: James Rawlings <jrawlings@chainguard.dev>
@rawlingsj
Copy link
Member

There seems to be an issue with the bazel cache, boost is fetched in the bazel build but can't be found in the local cache, retry and it seems to get past the error.

This isn't a solution (for now at least as it's bad) just showing some workings

Copy link
Contributor Author

octo-sts bot commented Nov 5, 2024

Gen AI suggestions to solve the build error:

Based on the error logs, the build is failing due to a redefinition of _FORTIFY_SOURCE macro during compilation. Here are some steps to fix this:

  1. The key error is:
<command-line>: error: "_FORTIFY_SOURCE" redefined [-Werror]
  1. To fix this in your melange YAML configuration, you can try:
environment:
  # Undefine _FORTIFY_SOURCE before defining it
  CFLAGS: "-U_FORTIFY_SOURCE" 
  CXXFLAGS: "-U_FORTIFY_SOURCE"
  1. Alternatively, modify the build pipeline to:
pipeline:
  - runs: |
      bazel build --copt=-U_FORTIFY_SOURCE //...
  1. Or if you need to keep _FORTIFY_SOURCE, ensure it's only defined once by removing it from compiler flags:
environment:
  CFLAGS: "-fstack-protector -Wall -O2" # Remove _FORTIFY_SOURCE definition
  CXXFLAGS: "-fstack-protector -Wall -O2"
  1. If the above don't work, you could try disabling -Werror for this specific compilation:
environment:
  CFLAGS: "-Wno-error=builtin-macro-redefined"
  CXXFLAGS: "-Wno-error=builtin-macro-redefined"

These changes should help resolve the _FORTIFY_SOURCE redefinition error during compilation.

@rawlingsj
Copy link
Member

I'm out of ideas on the bazel cache issue, I've pushed a bad change to prove retrying the bazel build after it fetches dependencies such as boost does work, albeit not a good solution. There's also this U_FORTIFY_SOURCE error which I'm not sure about either.

It would be good to have a more expert eye on this.

- git
- glibc-locale-en # This fixes the build failure with UTF-8 filenames, see wolfi-dev/os#26865
- openjdk-17
- openjdk-17-default-jvm
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expect default-jdk here.

@@ -28,25 +30,41 @@ environment:
- tzdata
- wolfi-baselayout
environment:
BAZEL_ARGS: "--config=g++"
EXTRA_BAZEL_ARGS: "--tool_java_runtime_version=local_jdk"
BAZEL_ARGS: "--config=g++ --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --tool_java_runtime_version=local_jdk"
JAVA_HOME: /usr/lib/jvm/java-17-openjdk
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c++17 is old/low; it can cause issues with runtime compat with forexample our icu. But if that is not used, it can also be ok. Higher / default version standard would be nice (unless known to be broken).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants