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

[Bug]: librav1e compilation error: libz.so is incompatible with elf64-x86-64 #20100

Closed
xaionaro opened this issue May 11, 2024 · 19 comments · Fixed by #20412
Closed

[Bug]: librav1e compilation error: libz.so is incompatible with elf64-x86-64 #20100

xaionaro opened this issue May 11, 2024 · 19 comments · Fixed by #20412
Labels
bug report Something is not working properly. packaging Issue related to building packages, not affecting end users directly.

Comments

@xaionaro
Copy link

xaionaro commented May 11, 2024

Problem description

Seems related to #14603

I want to compile ffmpeg. One of the dependencies there is librav1e and it fails to build with error:

ld: error: /data/data/com.termux/files/usr/lib/libz.so is incompatible with elf64-x86-64
          collect2: error: ld returned 1 exit status

Here is the full log:

xaionaro@void:~/src/termux-packages$ ./scripts/run-docker.sh ./build-package.sh librav1e
Running container 'termux-package-builder' from image 'ghcr.io/termux/package-builder'...
termux - building librav1e for arch aarch64...
info: downloading installer
info: profile set to 'default'
info: default host triple is x86_64-unknown-linux-gnu
warning: Updating existing toolchain, profile choice will be ignored
info: syncing channel updates for '1.78.0-x86_64-unknown-linux-gnu'
info: default toolchain set to '1.78.0-x86_64-unknown-linux-gnu'

  1.78.0-x86_64-unknown-linux-gnu unchanged - rustc 1.78.0 (9b00956e5 2024-04-29)


Rust is installed now. Great!

To get started you may need to restart your current shell.
This would reload your PATH environment variable to include
Cargo's bin directory ($HOME/.cargo/bin).

To configure your current shell, you need to source
the corresponding env file under $HOME/.cargo.

This is usually done by running one of the following (note the leading DOT):
. "$HOME/.cargo/env"            # For sh/bash/zsh/ash/dash/pdksh
source "$HOME/.cargo/env.fish"  # For fish
info: component 'rust-std' for target 'aarch64-linux-android' is up to date
  Installing rav1e v0.7.1 (/home/builder/.termux-build/librav1e/src)
    Updating crates.io index
   Compiling crossbeam-utils v0.8.19
   Compiling proc-macro2 v1.0.76
   Compiling unicode-ident v1.0.12
   Compiling autocfg v1.1.0
   Compiling libc v0.2.152
   Compiling rayon-core v1.12.0
   Compiling pkg-config v0.3.28
   Compiling vcpkg v0.2.15
   Compiling tinyvec_macros v0.1.1
   Compiling rustix v0.38.28
   Compiling percent-encoding v2.3.1
   Compiling unicode-bidi v0.3.14
   Compiling linux-raw-sys v0.4.12
   Compiling either v1.9.0
   Compiling bitflags v2.4.1
   Compiling utf8parse v0.2.1
   Compiling colorchoice v1.0.0
   Compiling anstyle v1.0.4
   Compiling cfg-if v1.0.0
   Compiling log v0.4.20
   Compiling anstyle-query v1.0.2
   Compiling tinyvec v1.6.0
   Compiling anstyle-parse v0.2.3
   Compiling form_urlencoded v1.2.1
   Compiling heck v0.4.1
   Compiling thiserror v1.0.56
   Compiling noop_proc_macro v0.3.0
   Compiling clap_lex v0.6.0
   Compiling anyhow v1.0.79
   Compiling minimal-lexical v0.2.1
   Compiling signal-hook v0.3.17
   Compiling anstream v0.6.5
   Compiling memchr v2.7.1
   Compiling paste v1.0.14
   Compiling itertools v0.10.5
   Compiling lab v0.11.0
   Compiling unicode-width v0.1.11
   Compiling arrayvec v0.7.4
   Compiling lazy_static v1.4.0
   Compiling bitstream-io v2.2.0
   Compiling fern v0.6.2
   Compiling itertools v0.12.0
   Compiling new_debug_unreachable v1.0.4
   Compiling scan_fmt v0.2.6
   Compiling once_cell v1.19.0
   Compiling y4m v0.8.0
   Compiling num-traits v0.2.17
   Compiling num-integer v0.1.45
   Compiling num-bigint v0.4.4
   Compiling num-rational v0.4.1
   Compiling nom v7.1.3
   Compiling crossbeam-epoch v0.9.18
   Compiling quote v1.0.35
   Compiling unicode-normalization v0.1.22
   Compiling crossbeam-channel v0.5.11
   Compiling crossbeam-queue v0.3.11
   Compiling ivf v0.1.3 (/home/builder/.termux-build/librav1e/src/ivf)
   Compiling crossbeam-deque v0.8.5
   Compiling syn v2.0.48
   Compiling jobserver v0.1.27
   Compiling simd_helpers v0.1.0
   Compiling crossbeam v0.8.4
   Compiling cc v1.0.83
   Compiling idna v0.5.0
   Compiling rayon v1.8.0
   Compiling errno v0.3.8
   Compiling signal-hook-registry v1.4.1
   Compiling console v0.15.8
   Compiling url v2.5.0
   Compiling libz-sys v1.1.14
   Compiling libgit2-sys v0.16.1+1.7.1
   Compiling terminal_size v0.3.0
   Compiling clap_builder v4.4.14
   Compiling nasm-rs v0.2.5
   Compiling maybe-rayon v0.1.1
   Compiling git2 v0.18.1
   Compiling profiling-procmacros v1.0.13
   Compiling num-derive v0.4.1
   Compiling clap_derive v4.4.7
   Compiling thiserror-impl v1.0.56
   Compiling arg_enum_proc_macro v0.3.4
   Compiling profiling v1.0.13
   Compiling v_frame v0.3.7
   Compiling av1-grain v0.2.3
   Compiling av-metrics v0.9.1
   Compiling clap v4.4.14
   Compiling clap_complete v4.4.6
   Compiling built v0.7.1
   Compiling rav1e v0.7.1 (/home/builder/.termux-build/librav1e/src)
error: linking with `cc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/home/builder/.rustup/toolchains/1.78.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/home/builder/.termux-build/_cache/cargo-c-0.9.20:/home/builder/.cargo/bin:/home/builder/.termux-build/_cache/android-r26b-api-24-v3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" VSLANG="1033" "cc" "-m64" "/tmp/rustc6huwxR/symbols.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.10klz69p50kpsxv2.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.1ablpveksfyl1ydb.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.1blwqtu2uwqodicz.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.1c35euuc7imk6ewp.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.1e2itnjydpdo9no5.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.1g47p5v88zi8wpdr.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.1gqafgq7rbecylx5.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.1ju3862m5j4vlehd.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.1nuryl440p7oyv18.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.1w4g8q1beyeyugqn.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.1yrdlza2f184kvxv.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.1z6mqzzte5ed3ooz.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.2395wzwvapxe0829.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.289982vueba2lw2m.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.29fy6ytvxtmnjfj7.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.2jr3ps2l6fyn11pl.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.2pl35uztwwaz0s7n.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.2qfbhg89q1cqfvoc.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.2r4yy38y84w0g1cy.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.2w4xtqdemj3w206t.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.2xluxupbof3irdlw.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.2yhcxq3kdlwa2oty.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.2yk6n87nbcbbde67.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.30h02709tq2av6ra.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.390jid416xvbdn5r.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.3p2tir9ryx4eddq4.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.3zzw2apysqjz9xex.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.45u6aqrff4atl41y.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.468msvr4gkbjrgry.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.4bbig3nn5i2qdefq.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.4m8tpdbxsjrb61p6.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.4r1lmsqaorrn2mih.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.4tvyxc6ovr7qb9uo.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.5f8nzurs62j46vch.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.5g7fooddopd5cg8t.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.fnmws57n4sh1mxi.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.i33m8hkfky3zhi0.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.ib64ktqx70d1n61.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.kywz1ianezc00f0.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.rmmvemidltfow0p.rcgu.o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2.3xmk6owf4vmg18au.rcgu.o" "-Wl,--as-needed" "-L" "/home/builder/.termux-build/librav1e/src/target/release/deps" "-L" "/home/builder/.termux-build/librav1e/src/target/release/build/libgit2-sys-7e6cb88ebb0268ff/out/build" "-L" "/data/data/com.termux/files/usr/lib" "-L" "/home/builder/.rustup/toolchains/1.78.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/builder/.termux-build/librav1e/src/target/release/deps/libbuilt-95534d445419c8f6.rlib" "/home/builder/.termux-build/librav1e/src/target/release/deps/libgit2-fa22a5a6fdc5129f.rlib" "/home/builder/.termux-build/librav1e/src/target/release/deps/liburl-d12c30725b624834.rlib" "/home/builder/.termux-build/librav1e/src/target/release/deps/libidna-9adc120924c66433.rlib" "/home/builder/.termux-build/librav1e/src/target/release/deps/libunicode_normalization-ee9896ff30661448.rlib" "/home/builder/.termux-build/librav1e/src/target/release/deps/libtinyvec-321599ce0441e8cf.rlib" "/home/builder/.termux-build/librav1e/src/target/release/deps/libtinyvec_macros-fbafa5c7f21ee031.rlib" "/home/builder/.termux-build/librav1e/src/target/release/deps/libunicode_bidi-ef3668e26162e2ef.rlib" "/home/builder/.termux-build/librav1e/src/target/release/deps/libform_urlencoded-656e86e8348fbd08.rlib" "/home/builder/.termux-build/librav1e/src/target/release/deps/libpercent_encoding-04d0dc841a5af717.rlib" "/home/builder/.termux-build/librav1e/src/target/release/deps/liblog-c7987f7589a8bfc4.rlib" "/home/builder/.termux-build/librav1e/src/target/release/deps/liblibgit2_sys-8b00877c60422fe3.rlib" "/home/builder/.termux-build/librav1e/src/target/release/deps/liblibz_sys-5ad49749b4596e5d.rlib" "/home/builder/.termux-build/librav1e/src/target/release/deps/libbitflags-35f3cc23886eefb6.rlib" "/home/builder/.termux-build/librav1e/src/target/release/deps/libcc-e1b55f7d895ff6a9.rlib" "/home/builder/.termux-build/librav1e/src/target/release/deps/libjobserver-92799fbb039129fd.rlib" "/home/builder/.termux-build/librav1e/src/target/release/deps/liblibc-b00b19be59575fdf.rlib" "/home/builder/.termux-build/librav1e/src/target/release/deps/libnasm_rs-d67dc0917c5f5862.rlib" "/home/builder/.termux-build/librav1e/src/target/release/deps/librayon-1b24513d292d6c0a.rlib" "/home/builder/.termux-build/librav1e/src/target/release/deps/librayon_core-0ee4c7745c1bd1c5.rlib" "/home/builder/.termux-build/librav1e/src/target/release/deps/libcrossbeam_deque-cf5b2d9412e65759.rlib" "/home/builder/.termux-build/librav1e/src/target/release/deps/libcrossbeam_epoch-b51eb12ab714e95e.rlib" "/home/builder/.termux-build/librav1e/src/target/release/deps/libcrossbeam_utils-08dcfcafcfdd4053.rlib" "/home/builder/.termux-build/librav1e/src/target/release/deps/libeither-ae90701e191426c4.rlib" "/home/builder/.rustup/toolchains/1.78.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-d2ef02247056996e.rlib" "/home/builder/.rustup/toolchains/1.78.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-fde67f6c4eccaa42.rlib" "/home/builder/.rustup/toolchains/1.78.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-2549d0ec992a5666.rlib" "/home/builder/.rustup/toolchains/1.78.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-bb9bfc0931d5cad0.rlib" "/home/builder/.rustup/toolchains/1.78.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-7c0b91fdc4adc2c5.rlib" "/home/builder/.rustup/toolchains/1.78.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-6ec164769e6c2957.rlib" "/home/builder/.rustup/toolchains/1.78.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-95326caaef561554.rlib" "/home/builder/.rustup/toolchains/1.78.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-704dba0df3717bb7.rlib" "/home/builder/.rustup/toolchains/1.78.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-5f0117cb69112303.rlib" "/home/builder/.rustup/toolchains/1.78.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-7a95907f1ed0cea5.rlib" "/home/builder/.rustup/toolchains/1.78.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-d4aa666f8242aefc.rlib" "/home/builder/.rustup/toolchains/1.78.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-9abec8861e966bc7.rlib" "/home/builder/.rustup/toolchains/1.78.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-863ac378b60eeb30.rlib" "/home/builder/.rustup/toolchains/1.78.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-fc8aa5b7d220f0a9.rlib" "/home/builder/.rustup/toolchains/1.78.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-0cc850f1e941238d.rlib" "/home/builder/.rustup/toolchains/1.78.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-f7b445210e88e768.rlib" "/home/builder/.rustup/toolchains/1.78.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-f37052492751c579.rlib" "/home/builder/.rustup/toolchains/1.78.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-fd15ec7f305d48e7.rlib" "/home/builder/.rustup/toolchains/1.78.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-d700583125da6701.rlib" "-Wl,-Bdynamic" "-lz" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/home/builder/.rustup/toolchains/1.78.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/builder/.termux-build/librav1e/src/target/release/build/rav1e-d1d9b5f8357965f2/build_script_build-d1d9b5f8357965f2" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
  = note: ld: error: /data/data/com.termux/files/usr/lib/libz.so is incompatible with elf64-x86-64
          collect2: error: ld returned 1 exit status


error: could not compile `rav1e` (build script) due to 1 previous error
error: failed to compile `rav1e v0.7.1 (/home/builder/.termux-build/librav1e/src)`, intermediate artifacts can be found at `/home/builder/.termux-build/librav1e/src/target`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

What steps will reproduce the bug?

  • Build glib (use the workaround proposed by gouravkhunger: build with TERMUX_FORCE_BUILD_DEPENDENCIES=true, then delete glib and rebuild without the flag)
  • Run ./scripts/run-docker.sh ./build-package.sh librav1e.

To be more specific:

git clone https://github.com/termux/termux-packages
cd termux-packages
git checkout efa20d206096ce1c299ef2c0e1e3c0f41817e482
curl https://raw.githubusercontent.com/gouravkhunger/termux-packages/20070/fix-glib/packages/glib/build.sh > packages/glib/build.sh
./scripts/run-docker.sh env TERMUX_FORCE_BUILD_DEPENDENCIES=true ./build-package.sh glib
./scripts/run-docker.sh rm -f /data/data/.built-packages/glib
./scripts/run-docker.sh ./build-package.sh glib
./scripts/run-docker.sh ./build-package.sh librav1e

What is the expected behavior?

It successfully builds librav1e

System information

Commit of github.com/termux/termux-packages is: efa20d2

@xaionaro xaionaro added bug report Something is not working properly. untriaged labels May 11, 2024
@Biswa96
Copy link
Contributor

Biswa96 commented May 12, 2024

termux - building librav1e for arch aarch64...
info: downloading installer
info: profile set to 'default'
info: default host triple is x86_64-unknown-linux-gnu

The above output seems incorrect. The build script tries to build for aarch64 but the host triplet is x86_64. Try to add -a aarch64 option after build-package.sh. If it works the build script needs some change so that it works without -a option.

@Biswa96
Copy link
Contributor

Biswa96 commented May 12, 2024

Wait, I have tried ./build-package.sh -I librav1e in the container and it worked just fine 🤔

@xaionaro
Copy link
Author

xaionaro commented May 12, 2024

Thanks for the reply.

Wait, I have tried ./build-package.sh -I librav1e in the container and it worked just fine 🤔

The repro I wrote above did repro the problem for me (just copy&paste the commands one by one). I rechecked it before posting.

Try to add -a aarch64 option after build-package.sh.

Neither -a aarch64 nor -I helped.

@TomJo2000
Copy link
Member

Sometimes build leftovers from prior builds can interfere.
You can use the provided ./clean.sh script to reset the build environment to a fresh state.
i.e. ./scripts/run-docker.sh ./clean.sh

This isn't done automatically because the build system usually caches already downloaded/built dependencies to save time and bandwidth on rebuilds.

@xaionaro
Copy link
Author

Sometimes build leftovers from prior builds can interfere. You can use the provided ./clean.sh script to reset the build environment to a fresh state. i.e. ./scripts/run-docker.sh ./clean.sh

This isn't done automatically because the build system usually caches already downloaded/built dependencies to save time and bandwidth on rebuilds.

Repeated with ./scripts/run-docker.sh ./clean.sh, having the same problem.

@TomJo2000
Copy link
Member

Hmm very odd, I cannot reproduce this issue at all locally.

@xaionaro
Copy link
Author

Hmm very odd, I cannot reproduce this issue at all locally.

Is there any way I can help? I kinda assumed since it is docker it should be pretty reproducible :)

I can pack all the files if needed or something.

@TomJo2000
Copy link
Member

TomJo2000 commented May 12, 2024

since it is docker it should be pretty reproducible

You'd hope so.
I'll check if my package build container is out of date or something.


./scripts/update-docker.sh to pull down the latest version of the package builder container.
That will be a 3.1GB download.

@xaionaro
Copy link
Author

xaionaro commented May 12, 2024

What I can do: I can record the whole process in asciinema if it is of any help.


./scripts/update-docker.sh to pull down the latest version of the package builder container.
That will be a 3.1GB download.

OK, let me retry. Last time I did it was few days ago, may be something changed.

@TomJo2000
Copy link
Member

What I can do, I can record the whole process in asciinema if it of any help.

Could possibly help, though I somewhat doubt it.

@TomJo2000
Copy link
Member

Thanks for the reminder for why I don't build without -I, first run of compiling glib took 22 minutes with having to compile all the dependencies as well.
Second one was significantly quicker since most of the dependencies were already cached (5 minutes 40 seconds).

I can actually reproduce the build failure now.

@truboxl truboxl added the packaging Issue related to building packages, not affecting end users directly. label May 13, 2024
@xaionaro
Copy link
Author

Is there may be an ugly workaround for now? Should I just checkout an older commit?

@TomJo2000
Copy link
Member

Well I can reproduce the issue when checking out the commit you mentioned in your reproduction steps, it does not happen when trying I was not able to replicate it on the latest commit.
I guess I'll try again.

@xaionaro
Copy link
Author

xaionaro commented May 20, 2024

On my end it reproduces even after checkout-ing the latest commit. Also even though it is not important, but just in case: that commit (I mentioned initially) was the latest at the moment of facing the issue :)

@truboxl
Copy link
Contributor

truboxl commented Jun 3, 2024

Not reproducible on the current branch when running only ./scripts/run-docker.sh ./build-package.sh librav1e

Please do not submit bug reports that are based on forks of this repo.

@truboxl truboxl closed this as not planned Won't fix, can't repro, duplicate, stale Jun 3, 2024
@truboxl truboxl added not reproducible / bug report not-bug Issue is not a bug. and removed bug report Something is not working properly. not reproducible / bug report labels Jun 3, 2024
@xaionaro
Copy link
Author

xaionaro commented Jun 3, 2024

This was not based on the fork of this repo! Why would you think this is a fork? I even provided the exact commit used.

@truboxl
Copy link
Contributor

truboxl commented Jun 3, 2024

Changes made by gouravkhunger are forks. We have not merge them in #20081. You should not randomly add patches and then claim they are defects that Termux team need to fix.

If you can reproduce the issue without the patches nor checking out old commits and can reproduce on the latest commit then please comment.

Reopening since ./scripts/run-docker.sh ./build-package.sh glib librav1e is still not possible.

@truboxl truboxl reopened this Jun 3, 2024
@truboxl truboxl added bug report Something is not working properly. and removed not-bug Issue is not a bug. labels Jun 3, 2024
@Grimler91
Copy link
Member

If we can't find a better solution I guess we have to do the same as for rust and hide libz.so during rav1e compilation:
https://github.com/termux/termux-packages/blob/master/packages/rust/build.sh#L113
https://github.com/termux/termux-packages/blob/master/packages/rust/build.sh#L217

@xaionaro
Copy link
Author

xaionaro commented Jun 3, 2024

If you can reproduce the issue without the patches nor checking out old commits and can reproduce on the latest commit then please comment.

If I don't apply any patches then I hit this bug: #20070

The patch just explicitly represents as a code the bootstrap process for glib, which one needs to do anyway. So will I do with the patch or not it will be the same behavior. More specifically since the bootstrap procedure is not described on the "Build environment" I'm using the recommendation from Biswa96:

Build glib using -Dintrospection=disabled option.
Build GI using glib from step1.
Build glib with -Dintrospection=enabled using GI from step2.

So essentially exactly the same thing, as what the patch is doing. But feel free to suggest some other bootstrap procedure (if it does not use a prebuilt glib).


If you can reproduce the issue without the patches nor checking out old commits and can reproduce on the latest commit then please comment.

Since requested, re-doing this once more (the 3rd time):

git clone https://github.com/termux/termux-packages
cd termux-packages
xaionaro@void:~/src/termux-packages$ git show --oneline -s
2aeac6835 (HEAD -> master, origin/master, origin/HEAD) bump(main/libhdf5): 1.14.4.3
xaionaro@void:~/src/termux-packages$ ./scripts/run-docker.sh ./clean.sh
Running container 'termux-package-builder' from image 'ghcr.io/termux/package-builder'...
Creating new container...
79bef00e86d9fbb3157fb4694fe66393c23fbaa1b3f7a7be335f8d2433d59f5e
Changed builder uid/gid... (this may take a while)

Ran:

./scripts/run-docker.sh ./build-package.sh glib

It failed with:

sed: can't read /data/data/com.termux/files/usr/lib/pkgconfig/gobject-introspection-1.0.pc: No such file or directory

So I ran (to follow the recommendation from Biswa96 without editing ./build-package.sh which would be essentially re-introducing the patch that you say I should not use):

./scripts/run-docker.sh env CFLAGS=-Dintrospection=disabled ./build-package.sh glib

It failed with:

glib| Program python3 (packaging) found: NO

../src/subprojects/glib/meson.build:2451:26: ERROR: python is missing modules: packaging

A full log can be found at /home/builder/.termux-build/gobject-introspection/build/meson-logs/meson-log.txt

So I ran:

./scripts/run-docker.sh ./scripts/setup-ubuntu.sh

and re-ran the build command. It didn't help, so I ran:

./scripts/run-docker.sh pip install packaging

It also didn't help.

So I ran:

./scripts/run-docker.sh /home/builder/.termux-build/python-crossenv-prefix-aarch64/cross/bin/python3 -m pip install packaging

It helped, but now the building failed with:

../src/subprojects/glib/gio/gdebugcontrollerdbus.c:361:42: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
                                         _("Not authorized to change debug settings"));
                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Here I realized I just don't have enough free time to reproduce the problem once more. Sorry.


claim they are defects that Termux team need to fix.

I don't claim Termux team needs to do anything; feel free to just close the ticket :)
I reported only because it felt right to report to help others (to help the project to improve). Personally I just excluded librav1e for my build of ffmpeg 3 weeks ago and personally my problem is solved. This ticket exists only and only to help others to avoid/workaround this problem. I did not use forks, I always used the latest comment. But if the problem is non-important then OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Something is not working properly. packaging Issue related to building packages, not affecting end users directly.
Projects
None yet
5 participants