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 fails: error executing 'git rev-parse --abbrev-ref=loose HEAD': No such file or directory (os error 2) #3308

Closed
yurivict opened this issue Feb 18, 2024 · 10 comments · Fixed by #3309
Assignees

Comments

@yurivict
Copy link

What type of bug is this?

Other

What subsystems are affected?

Other

Minimal reproduce step

command:
cd /usr/ports/databases/greptimedb/work/greptimedb-0.6.0; /usr/bin/env CARGO_FREEBSD_PORTS_SKIP_GIT_UPDATE=1 /usr/bin/env XDG_DATA_HOME=/usr/ports/databases/greptimedb/work XDG_CONFIG_HOME=/usr/ports/databases/greptimedb/work XDG_CACHE_HOME=/usr/ports/databases/greptimedb/work/.cache HOME=/usr/ports/databases/greptimedb/work TMPDIR="/usr/ports/databases/greptimedb/work" PATH=/usr/local/libexec/ccache:/usr/ports/databases/greptimedb/work/.bin:/home/yuri/.cargo/bin:/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin PKG_CONFIG_LIBDIR=/usr/ports/databases/greptimedb/work/.pkgconfig:/usr/local/libdata/pkgconfig:/usr/local/share/pkgconfig:/usr/libdata/pkgconfig MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES PREFIX=/usr/local LOCALBASE=/usr/local CC="cc" CFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing " CPP="cpp" CPPFLAGS="" LDFLAGS=" -fstack-protector-strong " LIBS="" CXX="c++" CXXFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing " CCACHE_DIR="/tmp/.ccache" BSD_INSTALL_PROGRAM="install -s -m 555" BSD_INSTALL_LIB="install -s -m 0644" BSD_INSTALL_SCRIPT="install -m 555" BSD_INSTALL_DATA="install -m 0644" BSD_INSTALL_MAN="install -m 444" CARGO_HOME=/usr/ports/databases/greptimedb/work/cargo-home CARGO_BUILD_JOBS=7 CARGO_BUILD_TARGET=x86_64-unknown-freebsd CARGO_TARGET_DIR=/usr/ports/databases/greptimedb/work/target CARGO_TARGET_X86_64_UNKNOWN_FREEBSD_LINKER="cc" RUSTC=/usr/local/bin/rustc RUSTDOC=/usr/local/bin/rustdoc RUSTFLAGS=" -C link-arg=-fstack-protector-strong" RUST_BACKTRACE=1 LIBGIT2_SYS_USE_PKG_CONFIG=1 ZSTD_SYS_USE_PKG_CONFIG=1 CARGO_PROFILE_RELEASE_LTO="true" CARGO_PROFILE_RELEASE_PANIC="abort" CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1 /usr/local/bin/cargo build --manifest-path /usr/ports/databases/greptimedb/work/greptimedb-0.6.0/Cargo.toml --verbose --verbose --release

What did you expect to see?

n/a

What did you see instead?

[servers 0.6.0] cargo:rustc-env=RUSTC_VERSION=rustc 1.76.0-nightly (37b2813a7 2023-11-24) (built from a source tarball)
[servers 0.6.0] thread 'main' panicked at /wrkdirs/usr/ports/databases/greptimedb/work/greptimedb-0.7.0-nightly-20240115-95-gb889d57b32/cargo-crates/build-data-0.1.5/src/lib.rs:630:64:
[servers 0.6.0] called `Result::unwrap()` on an `Err` value: "error executing 'git rev-parse --abbrev-ref=loose HEAD': No such file or directory (os error 2)"
[servers 0.6.0] stack backtrace:
[servers 0.6.0]    0: rust_begin_unwind
[servers 0.6.0]    1: core::panicking::panic_fmt
[servers 0.6.0]    2: core::result::unwrap_failed
[servers 0.6.0]    3: core::result::Result<T,E>::unwrap
[servers 0.6.0]    4: build_data::set_GIT_BRANCH
[servers 0.6.0]    5: build_script_build::main
[servers 0.6.0]    6: core::ops::function::FnOnce::call_once
[servers 0.6.0] note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: failed to run custom build command for `servers v0.6.0 (/wrkdirs/usr/ports/databases/greptimedb/work/greptimedb-0.7.0-nightly-20240115-95-gb889d57b32/src/servers)`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.

Caused by:
  process didn't exit successfully: `CARGO=/usr/local/bin/cargo CARGO_CFG_OVERFLOW_CHECKS='' CARGO_CFG_PANIC=unwind CARGO_CFG_RELOCATION_MODEL=pic CARGO_CFG_TARGET_ABI='' CARGO_CFG_TARGET_ARCH=x86_64 CARGO_CFG_TARGET_ENDIAN=little CARGO_CFG_TARGET_ENV='' CARGO_CFG_TARGET_FAMILY=unix CARGO_CFG_TARGET_FEATURE=fxsr,sse,sse2 CARGO_CFG_TARGET_HAS_ATOMIC=16,32,64,8,ptr CARGO_CFG_TARGET_HAS_ATOMIC_EQUAL_ALIGNMENT=16,32,64,8,ptr CARGO_CFG_TARGET_HAS_ATOMIC_LOAD_STORE=16,32,64,8,ptr CARGO_CFG_TARGET_OS=freebsd CARGO_CFG_TARGET_POINTER_WIDTH=64 CARGO_CFG_TARGET_VENDOR=unknown CARGO_CFG_UNIX='' CARGO_ENCODED_RUSTFLAGS='-Clink-arg=-fstack-protector-strong' CARGO_FEATURE_TESTING=1 CARGO_MANIFEST_DIR=/wrkdirs/usr/ports/databases/greptimedb/work/greptimedb-0.7.0-nightly-20240115-95-gb889d57b32/src/servers CARGO_PKG_AUTHORS='' CARGO_PKG_DESCRIPTION='' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE=Apache-2.0 CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=servers CARGO_PKG_README='' CARGO_PKG_REPOSITORY='' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.6.0 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=6 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' DEBUG=false HOST=x86_64-unknown-freebsd LD_LIBRARY_PATH='/wrkdirs/usr/ports/databases/greptimedb/work/target/release/deps:/wrkdirs/usr/ports/databases/greptimedb/work/target/release:/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib' NUM_JOBS=6 OPT_LEVEL=3 OUT_DIR=/wrkdirs/usr/ports/databases/greptimedb/work/target/x86_64-unknown-freebsd/release/build/servers-a6776311a97f263b/out PROFILE=release RUSTC=/usr/local/bin/rustc RUSTC_LINKER=cc RUSTDOC=/usr/local/bin/rustdoc TARGET=x86_64-unknown-freebsd /wrkdirs/usr/ports/databases/greptimedb/work/target/release/build/servers-2dc98a4fd314015f/build-script-build` (exit status: 101)

What operating system did you use?

FreeBSD 14.0

What version of GreptimeDB did you use?

rev. b889d57

Relevant log output and stack trace

No response

@tisonkun
Copy link
Collaborator

It seems that you download the GreptimeDB sources directly instead of clone via Git?

Perhaps we should find a fallback when the sources are built without Git info, or we throw a meaningful error message.

@yurivict
Copy link
Author

Package builders don't use git clones because sources need to be fingerprinted for build reproducibility and security.

@tisonkun
Copy link
Collaborator

Good point. I'm preparing a patch to fix this.

Thanks for your report!

@tisonkun tisonkun self-assigned this Feb 18, 2024
@tisonkun
Copy link
Collaborator

@yurivict you may verify #3309.

Out of curiosity, what are you trying to build on FreeBSD with GreptimeDB? I saw your recent reports all about this topic :D

@tisonkun
Copy link
Collaborator

tisonkun commented Feb 18, 2024

Package builders

But without these build data the produced artifacts may not show version properly. Said 0.7.0 greptimedb-bin may produce "unknown" with --version. Let me try to add a comment on the patch to seek a solution.

@yurivict
Copy link
Author

I am trying to create the FreeBSD port for greptimedb.


--version should be handled in some other way.

@tisonkun
Copy link
Collaborator

I am trying to create the FreeBSD port for greptimedb.

Cool. Please let me know when it is published and I can create a shout-out for you.

--version should be handled in some other way.

Yeah. I'm proposing a metafile generation solution in #3309, or fallback to envvar so that you can configure in the package script (I'm unfamiliar with FreeBSD but AUR works in this way).

@yurivict
Copy link
Author

@tisonkun

Cool. Please let me know when it is published and I can create a shout-out for you.

I've added the FreeBSD port: https://cgit.freebsd.org/ports/tree/databases/greptimedb

Maybe you can add it to the list of systems where GreptimeDB is available?

The command to install it is: pkg install greptimedb

@tisonkun
Copy link
Collaborator

tisonkun commented Feb 19, 2024

@yurivict

Tweet is sent at - https://twitter.com/Greptime/status/1759594238399173066

Maybe you can add it to the list of systems where GreptimeDB is available?

It's filed as GreptimeTeam/docs#809. We should find a way to add such information. If you know how other projects display this info, welcome to share links there.

@yurivict
Copy link
Author

@tisonkun

qBittorrent for example lists the FreeBSD port here.

Some projects are even detecting the type of OS from the browser and display the relevant info automatically based on the OS, but I can't find an example now.

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

Successfully merging a pull request may close this issue.

2 participants