gpg-rs / gpgme

GPGme bindings for Rust
GNU Lesser General Public License v2.1
83 stars 13 forks source link

Experience note: My (sudo: false) Travis build fails #16

Closed FauxFaux closed 6 years ago

FauxFaux commented 6 years ago

My simple sudo: false Travis build fails inside gpgme-sys. I haven't diagnosed it but thought I'd make a note here, in case anyone else has the solution.

e.g. build: https://travis-ci.org/FauxFaux/fapt/jobs/331235428 travis.yml at that build: https://github.com/FauxFaux/fapt/blob/a58706d16515234224e37d1913eaceefb1b5d621/.travis.yml

My guess as to the problem is that the build of embedded gpgme is failing for some unknown reason (perhaps a submodule fetch failed?), and the exterior one is too old according to some check, even though 1.2 looks to be supported. (1.4.3 > 1.2)?

I realise the library itself builds fine on Travis normally.

Log excerpts:

Reading state information...
libgpg-error-dev is already the newest version (1.12-0.2ubuntu1).
Selecting previously unselected package libgpgme11-dev.
Preparing to unpack .../libgpgme11-dev_1.4.3-0.1ubuntu5.1_amd64.deb ...
Running `/home/travis/build/FauxFaux/fapt/target/debug/build/gpgme-sys-956dcc06fe93269b/build-script-build`
error: failed to run custom build command for `gpgme-sys v0.6.1`
process didn't exit successfully: `/home/travis/build/FauxFaux/fapt/target/debug/build/gpgme-sys-956dcc06fe93269b/build-script-build` (exit code: 101)
--- stdout
running: "git" "apply" "../libassuan-remove-doc.patch"
command did not execute successfully: "git" "apply" "../libassuan-remove-doc.patch"
expected success, got: exit code: 1
running: "git" "apply" "../gpgme-remove-doc.patch"
command did not execute successfully: "git" "apply" "../gpgme-remove-doc.patch"
expected success, got: exit code: 1

...

checking for x86_64-unknown-linux-gnu-gpg-error-config... /usr/bin/gpg-error-config
checking for GPG Error - version >= 1.17... no
command did not execute successfully: "sh" "/home/travis/.cargo/registry/src/github.com-1ecc6299db9ec823/gpgme-sys-0.6.1/libassuan/configure" "--build" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--enable-static" "--disable-shared" "--with-libgpg-error-prefix=/usr" "--prefix=/home/travis/build/FauxFaux/fapt/target/debug/build/gpgme-sys-c80c4dc982428462/out"
expected success, got: exit code: 1
running: "sh" "-c" "gpgme-config --version"
--- stderr
error: patch failed: Makefile.am:28
error: Makefile.am: patch does not apply
error: patch failed: configure.ac:459
error: configure.ac: patch does not apply
error: patch failed: Makefile.am:33
error: Makefile.am: patch does not apply
error: patch failed: configure.ac:862
error: configure.ac: patch does not apply
autogen.sh: Running aclocal -I m4 ...
autogen.sh: Running autoheader...
autogen.sh: Running automake --gnu ...
autogen.sh: Running autoconf ...
autogen.sh: You may now run:
  ./configure --enable-maintainer-mode && make
configure: error: libgpg-error was not found

Any suggestions appreciated, but I don't expect anyone to fix this for me.

johnschug commented 6 years ago

The embedded variant is failing to build because the libgpg-error-sys crate, which it depends on, requires more recent versions of automake and gettext to build its embedded variant. After the embedded version fails to build it finds the system variant and checks that the system's version meets the version requested via feature selection, by default the version of the embedded variant:

thread 'main' panicked at 'GPGME version `1.4.3` is less than requested `1.9.0`', /home/travis/.cargo/registry/src/github.com-1ecc6299db9ec823/gpgme-sys-0.6.1/build.rs:269:33

This can be fixed by updating automake and gettext (see .travis.yml for details), using a more recent version of the gpgme crate (>0.7), which uses compile time version detection instead of feature selection, or disabling the default features of the crate and selecting an appropriate minimum supported version.

[dependency.gpgme]
default-features = false
features = ["v1_4_3"]
version = "0.6"