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

BUILD FAILED: error executing Genrule command (from target //third-party/libvpx:libvpx_build) #1493

Open
devhuy57 opened this issue Aug 15, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@devhuy57
Copy link

ERROR: Telegram-iOS/third-party/libvpx/BUILD:29:8: Executing genrule //third-party/libvpx:libvpx_build failed: (Exit 1): bash failed: error executing Genrule command (from target //third-party/libvpx:libvpx_build)
(cd /private/var/tmp/_bazel_dev.huy/5aa952f8545335523540a75a72b1ea60/execroot/main &&
exec env -
PATH=/usr/bin:/bin:/usr/sbin:/sbin
ZERO_AR_DATE=1
/bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh;
set -ex

if [ "ios_arm64" == "ios_armv7" ]; then
    BUILD_ARCH="armv7"
    PLATFORM_HEADER_DIR="armv7-darwin-gcc"
elif [ "ios_arm64" == "ios_arm64" ]; then
    BUILD_ARCH="arm64"
    PLATFORM_HEADER_DIR="arm64-darwin-gcc"
elif [ "ios_arm64" == "ios_sim_arm64" ]; then
    BUILD_ARCH="sim_arm64"
    PLATFORM_HEADER_DIR="arm64-iphonesimulator-gcc"
elif [ "ios_arm64" == "ios_x86_64" ]; then
    BUILD_ARCH="x86_64"
    PLATFORM_HEADER_DIR="x86_64-iphonesimulator-gcc"
else
    echo "Unsupported architecture ios_arm64"
fi

BUILD_DIR="bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/build_${BUILD_ARCH}"
rm -rf "$BUILD_DIR"
mkdir -p "$BUILD_DIR"

YASM_DIR="$BUILD_DIR/yasm"
rm -rf "$YASM_DIR"
mkdir -p "$YASM_DIR"
tar -xf "bazel-out/darwin_arm64-opt-exec-ST-13d3ddad9198/bin/third-party/yasm/yasm.tar" -C "$YASM_DIR"
ABS_YASM_DIR="$(pwd)/$(dirname $YASM_DIR)/$(basename $YASM_DIR)"

cp third-party/libvpx/build-libvpx-bazel.sh "$BUILD_DIR/"
cp third-party/libvpx/0001-Support-arm64-simulator.patch "$BUILD_DIR/"

SOURCE_PATH="third-party/libvpx/libvpx"

cp -R "$SOURCE_PATH" "$BUILD_DIR/"

pushd "$BUILD_DIR/libvpx"
patch -p1 < ../0001-Support-arm64-simulator.patch
popd

mkdir -p "$BUILD_DIR/Public/libvpx"

PATH="$PATH:$ABS_YASM_DIR" sh $BUILD_DIR/build-libvpx-bazel.sh $BUILD_ARCH "$BUILD_DIR/libvpx" "$BUILD_DIR"
cp -f "$BUILD_DIR/VPX.framework/Headers/vpx/vp8.h" "bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/Public/vpx/vp8.h"

cp -f "$BUILD_DIR/VPX.framework/Headers/vpx/vp8cx.h" "bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/Public/vpx/vp8cx.h"
cp -f "$BUILD_DIR/VPX.framework/Headers/vpx/vp8dx.h" "bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/Public/vpx/vp8dx.h"
cp -f "$BUILD_DIR/VPX.framework/Headers/vpx/vpx_codec.h" "bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/Public/vpx/vpx_codec.h"
cp -f "$BUILD_DIR/VPX.framework/Headers/vpx/vpx_decoder.h" "bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/Public/vpx/vpx_decoder.h"
cp -f "$BUILD_DIR/VPX.framework/Headers/vpx/vpx_encoder.h" "bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/Public/vpx/vpx_encoder.h"
cp -f "$BUILD_DIR/VPX.framework/Headers/vpx/vpx_frame_buffer.h" "bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/Public/vpx/vpx_frame_buffer.h"
cp -f "$BUILD_DIR/VPX.framework/Headers/vpx/vpx_image.h" "bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/Public/vpx/vpx_image.h"
cp -f "$BUILD_DIR/VPX.framework/Headers/vpx/vpx_integer.h" "bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/Public/vpx/vpx_integer.h"
cp -f "$BUILD_DIR/VPX.framework/Headers/vpx/vpx_version.h" "bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/Public/vpx/vpx_version.h"
cp -f "$BUILD_DIR/VPX.framework/Headers/vpx/vpx_ext_ratectrl.h" "bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/Public/vpx/vpx_ext_ratectrl.h"
cp -f "$BUILD_DIR/VPX.framework/Headers/vpx/vpx_tpl.h" "bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/Public/vpx/vpx_tpl.h"
cp -f "$BUILD_DIR/VPX.framework/VPX" "bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/Public/vpx/libVPX.a"
cp -f "$BUILD_DIR/VPX.framework/Headers/vpx/$PLATFORM_HEADER_DIR/vpx_config.h" "bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/Public/vpx/vpx_config.h"')

Configuration: 35f968da6c18d4ea74a32d595333f790c9e938f2f367741cee33bcf9687cfcd2

Execution platform: @@local_config_platform//:host

  • '[' ios_arm64 == ios_armv7 ']'
  • '[' ios_arm64 == ios_arm64 ']'
  • BUILD_ARCH=arm64
  • PLATFORM_HEADER_DIR=arm64-darwin-gcc
  • BUILD_DIR=bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/build_arm64
  • rm -rf bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/build_arm64
  • mkdir -p bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/build_arm64
  • YASM_DIR=bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/build_arm64/yasm
  • rm -rf bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/build_arm64/yasm
  • mkdir -p bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/build_arm64/yasm
  • tar -xf bazel-out/darwin_arm64-opt-exec-ST-13d3ddad9198/bin/third-party/yasm/yasm.tar -C bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/build_arm64/yasm
    ++ pwd
    ++ dirname bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/build_arm64/yasm
    ++ basename bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/build_arm64/yasm
  • ABS_YASM_DIR=/private/var/tmp/_bazel_dev.huy/5aa952f8545335523540a75a72b1ea60/execroot/main/bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/build_arm64/yasm
  • cp third-party/libvpx/build-libvpx-bazel.sh bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/build_arm64/
  • cp third-party/libvpx/0001-Support-arm64-simulator.patch bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/build_arm64/
  • SOURCE_PATH=third-party/libvpx/libvpx
  • cp -R third-party/libvpx/libvpx bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/build_arm64/
  • pushd bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/build_arm64/libvpx
  • patch -p1
    /private/var/tmp/_bazel_dev.huy/5aa952f8545335523540a75a72b1ea60/execroot/main/bazel-out/ios_arm64-opt-ios-arm64-min12.0-applebin_ios-ST-ee6c0995fb68/bin/third-party/libvpx/build_arm64/libvpx /private/var/tmp/_bazel_dev.huy/5aa952f8545335523540a75a72b1ea60/execroot/main
    File to patch:
    No file found--skip this patch? [y]
    3 out of 3 hunks ignored--saving rejects to Oops.rej
    File to patch:
    No file found--skip this patch? [y]
    1 out of 1 hunks ignored--saving rejects to Oops.rej
    Target //Telegram:Telegram failed to build
    INFO: Elapsed time: 2.811s, Critical Path: 1.12s
    INFO: 85 processes: 74 disk cache hit, 11 internal.
    ERROR: Build did NOT complete successfully
    Traceback (most recent call last):
    File "Telegram-iOS/build-system/Make/Make.py", line 1050, in
    build(bazel=bazel_path, arguments=args)
    File "Telegram-iOS/build-system/Make/Make.py", line 606, in build
    bazel_command_line.invoke_build()
    File "Telegram-iOS/build-system/Make/Make.py", line 368, in invoke_build
    call_executable(combined_arguments)
    File "Telegram-iOS/build-system/Make/BuildEnvironment.py", line 81, in call_executable
    subprocess.check_call(resolved_arguments, env=resolved_env)
    File "/opt/homebrew/Cellar/[email protected]/3.12.5/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['Telegram-iOS/build-input/bazel-7.1.1-darwin-arm64', 'build', 'Telegram/Telegram', '--override_repository=build_configuration=Telegram-iOS/build-input/configuration-repository', '--announce_rc', '--features=swift.use_global_module_cache', '--verbose_failures', '--experimental_remote_cache_async', '--features=swift.skip_function_bodies_for_derived_files', '--jobs=10', '--define=buildNumber=1', '--define=telegramVersion=1.0', '--disk_cache=/Users/dev.huy/telegram-bazel-cache', '-c', 'opt', '--ios_multi_cpus=arm64', '--watchos_cpus=arm64_32', '--apple_generate_dsym', '--output_groups=+dsyms', '--features=swift.opt_uses_wmo', '--swiftcopt=-num-threads', '--swiftcopt=1', '--swiftcopt=-j1', '--features=dead_strip', '--objc_enable_binary_stripping']' returned non-zero exit status 1.
@devhuy57 devhuy57 added the bug Something isn't working label Aug 15, 2024
@devhuy57
Copy link
Author

devhuy57 commented Aug 15, 2024

python3 build-system/Make/Make.py \
    --cacheDir="$HOME/telegram-bazel-cache" \
    build \
    --configurationPath=/Telegram-iOS/build-system/appstore-configuration.json \
    --codesigningInformationPath=Telegram-iOS/build-system/codesigning \
    --buildNumber=1 \
    --configuration=release_arm64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant