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

packaging gnvim #28

Closed
teto opened this issue Apr 21, 2019 · 5 comments · Fixed by #32
Closed

packaging gnvim #28

teto opened this issue Apr 21, 2019 · 5 comments · Fixed by #32

Comments

@teto
Copy link
Contributor

teto commented Apr 21, 2019

I've been trying to package gnvim master but I hit

  Compiling onig_sys v69.1.0
   Compiling walkdir v2.2.7
   Compiling yaml-rust v0.4.2
error: failed to run custom build command for `gnvim v0.1.0 (/build/gnvim-fd50f79)`
process didn't exit successfully: `/build/gnvim-fd50f79/target/release/build/gnvim-2222836c9fe8348d/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'Failed to get version from git', build.rs:18:9
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:70
             at src/libstd/sys_common/backtrace.rs:58
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:200
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:215
   4: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:478
   5: std::panicking::begin_panic
   6: build_script_build::main
   7: std::rt::lang_start::{{closure}}
   8: std::panicking::try::do_call
             at src/libstd/rt.rs:49
             at src/libstd/panicking.rs:297
   9: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:92
  10: std::rt::lang_start_internal
             at src/libstd/panicking.rs:276
             at src/libstd/panic.rs:388
             at src/libstd/rt.rs:48
  11: main
  12: __libc_start_main
  13: _start
             at ../sysdeps/x86_64/start.S:120

warning: build failed, waiting for other jobs to finish...
error: build failed
note: keeping build directory '/tmp/nix-build-gnvim-0.1.1.drv-3'
builder for '/nix/store/dg5xylxnqp8x0ldiavhxp7czl5dp55hh-gnvim-0.1.1.drv' failed with exit code 101

My package used to work but I think the error is similar to the one in nvie/gitflow#126 , aka git describe fails because I am packaging master's HEAD and not a tag revision. Would it be possible to add the --always flag to the git describe call in build.rs ?
It would make packaging easier.

@vhakulinen
Copy link
Owner

Currently the version number to the final build is extracted from git tags. How would that work with shallow clones? With --always flag and shallow clone, the version number would end up being a git hash, which in it self isn't really describable. Can you do a shallow clone so that it fetches the latest tag too?

@teto
Copy link
Contributor Author

teto commented Apr 21, 2019

Having a git hash is better than lying about the version ? It means it's a dev version. Sounds good to me else how am i supposed to build the dev version ? Btw if the version number should remain static, better write it into the file than using git. Tarballs typically dont contain the .git folder and i myself had to go to extra length to fetch bot the git folder and the tags (not fetchef by default). Otherwise i may patch the build.rs to bypass the git logic.

@badosu
Copy link
Contributor

badosu commented Apr 21, 2019

This script might be helpful: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=gnvim-git

@teto
Copy link
Contributor Author

teto commented Apr 21, 2019

thanks why are there 2 pkgver ? with nix, I think the rust building process will fail if I use the plain make (no internet access during builds) so I have to follow the standard way. It is just a matter of setting a version that upstream an packagers are happy about.

@badosu
Copy link
Contributor

badosu commented Apr 25, 2019

Arch allows for package versions with rel versions, e.g. 0.1.0-a1a1a where a1a1a is the HEAD sha.

If you can't have internet access during installation perhaps you'll have to distribute the binary directly, i.e. building during packaging and just copying the binary on package install.

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.

3 participants