jmacdonald / amp

A complete text editor for your terminal.
https://amp.rs
Other
3.7k stars 106 forks source link

amp 0.7.1: Build fails if git not present at build time #295

Closed nunotexbsd closed 3 days ago

nunotexbsd commented 5 days ago

Hello all,

Updating 0.7.0 -> 0.7.1 build fails if git program is not present at build time. Is this depency really needed or it can be bypassed expecially when building in pkg builders?

Thanks

<snip>
[wayland-protocols 0.29.5] cargo:rerun-if-changed=./protocols/unstable/tablet/tablet-unstable-v1.xml
[amp 0.7.1] thread 'main' panicked at build.rs:107:10:
[amp 0.7.1] Failed to execute git command: Os { code: 2, kind: NotFound, message: "No such file or directory" }
[amp 0.7.1] stack backtrace:
[amp 0.7.1] note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: failed to run custom build command for `amp v0.7.1 (/wrkdirs/usr/ports/editors/amp/work/amp-0.7.1)`
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_PANIC=unwind 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_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_MANIFEST_DIR=/wrkdirs/usr/ports/editors/amp/work/amp-0.7.1 CARGO_PKG_AUTHORS='Jordan MacDonald <jordan@wastedintelligence.com>' CARGO_PKG_DESCRIPTION=
'A complete text editor for your terminal.' CARGO_PKG_HOMEPAGE='https://amp.rs' CARGO_PKG_LICENSE='' CARGO_PKG_LICENSE_FILE=LICENSE CARGO_PKG_NAME=amp CARGO_PKG_README=README.md CARGO_PKG_REPOSITORY='https://gith
ub.com/jmacdonald/amp' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.7.1 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=7 CARGO_PKG_VERSION_PATCH=1 CARGO_PKG_VERSION_PRE='' DEBUG=false HOST=x86_64-unknown-free
bsd LD_LIBRARY_PATH='/wrkdirs/usr/ports/editors/amp/work/target/release/deps:/wrkdirs/usr/ports/editors/amp/work/target/release:/usr/local/lib/rustlib/x86_64-unknown-freebsd/lib' NUM_JOBS=12 OPT_LEVEL=2 OUT_DIR=/wrkdirs/usr/ports/editors/amp/work/target/x86_64-unknown-freebsd/release/build/amp-890a00b322388217/out PROFILE=release RUSTC=/usr/local/bin/rustc RUSTC_LINKER=cc RUSTDOC=/usr/local/bin/rustdoc TARGET=x86_64-unknown-freebsd /wrkdirs/usr/ports/editors/amp/work/target/release/build/amp-174e59e6ce95e8aa/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at build.rs:107:10:
  Failed to execute git command: Os { code: 2, kind: NotFound, message: "No such file or directory" }
  stack backtrace:
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
warning: build failed, waiting for other jobs to finish...
warning: `glob` (lib) generated 7 warnings
warning: `signal-hook` (lib) generated 2 warnings
warning: `wayland-client` (lib) generated 226 warnings
warning: `x11rb` (lib) generated 4 warnings
[wayland-protocols 0.29.5] cargo:rerun-if-changed=./protocols/unstable/tablet/tablet-unstable-v2.xml
warning: `backtrace` (lib) generated 8 warnings
warning: field `0` is never read
  --> /wrkdirs/usr/ports/editors/amp/work/amp-0.7.1/cargo-crates/git2-0.18.1/src/reference.rs:19:21
   |
19 | struct Refdb<'repo>(&'repo Repository);
   |        -----        ^^^^^^^^^^^^^^^^^
   |        |
   |        field in this struct
   |
   = help: consider removing this field
   = note: `#[warn(dead_code)]` on by default
<snip>
jmacdonald commented 4 days ago

Hello!

Amp now displays a build revision on the splash screen that's derived (during the build) from the shorthand git hash for HEAD. If you set the BUILD_REVISION environment variable, it will use that instead, bypassing the default and its need for the git CLI.

nunotexbsd commented 4 days ago

Hello,

Builds fine now without git present by seting BUILD_REVISION at build time.

Since this is a release what's the recomended value of BUILD_REVISION when set? Empty value?

Thanks

nunotexbsd commented 3 days ago

Done, setting it to git hash.

Thanks!