gentoo / cargo-ebuild

[MIRROR] cargo extension that can generate ebuilds using the in-tree eclasses
https://gitweb.gentoo.org/proj/cargo-ebuild.git
Apache License 2.0
33 stars 10 forks source link

Unable to perform ebuild with dependencies #30

Closed bohdaq closed 1 year ago

bohdaq commented 1 year ago

For some unknown reason unable to install ebuild. Manifest gets generated properly.

Repository: https://github.com/bohdaq/rust-tls-server

Ebuild:

# Copyright 2017-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# Auto-Generated by cargo-ebuild 0.3.1

EAPI=7

CRATES="
autocfg-1.1.0
base64-0.13.1
bitflags-1.3.2
bumpalo-3.11.1
cc-1.0.78
cfg-if-1.0.0
foreign-types-0.3.2
foreign-types-shared-0.1.1
js-sys-0.3.60
libc-0.2.139
log-0.4.17
once_cell-1.16.0
openssl-0.10.45
openssl-macros-0.1.0
openssl-src-111.24.0+1.1.1s
openssl-sys-0.9.80
pem-1.1.0
pkg-config-0.3.26
proc-macro2-1.0.49
quote-1.0.23
rcgen-0.10.0
ring-0.16.20
rust-web-server-8.0.6
serde-1.0.152
spin-0.5.2
syn-1.0.107
time-0.3.17
time-core-0.1.0
unicode-ident-1.0.6
untrusted-0.7.1
vcpkg-0.2.15
wasm-bindgen-0.2.83
wasm-bindgen-backend-0.2.83
wasm-bindgen-macro-0.2.83
wasm-bindgen-macro-support-0.2.83
wasm-bindgen-shared-0.2.83
web-sys-0.3.60
winapi-0.3.9
winapi-i686-pc-windows-gnu-0.4.0
winapi-x86_64-pc-windows-gnu-0.4.0
yasna-0.5.1
"

inherit cargo

DESCRIPTION="rust-tls-server is a web server capable of serving static content over https."
# Double check the homepage as the cargo_metadata crate
# does not provide this value so instead repository is used
HOMEPAGE="https://github.com/bohdaq/rust-web-server"
SRC_URI="https://github.com/bohdaq/rust-tls-server/archive/refs/tags/8.0.6.tar.gz"
RESTRICT="mirror"
# License set may be more restrictive as OR is not respected
# use cargo-license for a more accurate license picture
LICENSE="(MIT Apache-2.0 Apache-2.0) CC-BY-4.0 ISC LGPL-3.0-or-later MIT Unicode-DFS-2016"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""

DEPEND=""
RDEPEND=""

Ebuild clean install merge:

localhost /home/bohdan_tsap/rts/rust-tls-server/rts/rust-tls-server # ebuild rust-tls-server-8.0.6.ebuild clean install merge
Appending /home/bohdan_tsap/rts/rust-tls-server to PORTDIR_OVERLAY...
!!! Repository 'x-rust-tls-server' is missing masters attribute in '/home/bohdan_tsap/rts/rust-tls-server/metadata/layout.conf'
!!! Set 'masters = gentoo' in this file for future compatibility
 * 8.0.6.tar.gz BLAKE2B SHA512 size ;-) ...                                                                                                                                                     [ ok ]
 * checking ebuild checksums ;-) ...                                                                                                                                                            [ ok ]
>>> Unpacking source...
>>> Unpacking 8.0.6.tar.gz to /var/tmp/portage/rts/rust-tls-server-8.0.6/work
...
>>> Source unpacked in /var/tmp/portage/rts/rust-tls-server-8.0.6/work
>>> Preparing source in /var/tmp/portage/rts/rust-tls-server-8.0.6/work/rust-tls-server-8.0.6 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/rts/rust-tls-server-8.0.6/work/rust-tls-server-8.0.6 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/rts/rust-tls-server-8.0.6/work/rust-tls-server-8.0.6 ...
 * cargo build --release
error: no matching package named `openssl` found
location searched: registry `crates-io`
required by package `rts v8.0.6 (/var/tmp/portage/rts/rust-tls-server-8.0.6/work/rust-tls-server-8.0.6)`
As a reminder, you're using offline mode (--offline) which can sometimes cause surprising resolution failures, if this error is too confusing you may wish to retry without the offline flag.
 * ERROR: rts/rust-tls-server-8.0.6::x-rust-tls-server failed (compile phase):
 *   cargo build failed
 * 
 * Call stack:
 *     ebuild.sh, line  136:  Called src_compile
 *   environment, line 1449:  Called cargo_src_compile
 *   environment, line  573:  Called die
 * The specific snippet of code:
 *       "${@}" || die "cargo build failed"
 * 
 * If you need support, post the output of `emerge --info '=rts/rust-tls-server-8.0.6::x-rust-tls-server'`,
 * the complete build log and the output of `emerge -pqv '=rts/rust-tls-server-8.0.6::x-rust-tls-server'`.
 * The complete build log is located at '/var/tmp/portage/rts/rust-tls-server-8.0.6/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/rts/rust-tls-server-8.0.6/temp/environment'.
 * Working directory: '/var/tmp/portage/rts/rust-tls-server-8.0.6/work/rust-tls-server-8.0.6'
 * S: '/var/tmp/portage/rts/rust-tls-server-8.0.6/work/rust-tls-server-8.0.6'

Manual build works properly:

localhost /home/bohdan_tsap/rts/rust-tls-server # cargo build --release >> manual_build.log
   Compiling cc v1.0.78
   Compiling proc-macro2 v1.0.49
   Compiling libc v0.2.139
   Compiling quote v1.0.23
   Compiling unicode-ident v1.0.6
   Compiling autocfg v1.1.0
   Compiling pkg-config v0.3.26
   Compiling openssl-src v111.24.0+1.1.1s
   Compiling syn v1.0.107
   Compiling time-core v0.1.0
   Compiling once_cell v1.16.0
   Compiling openssl-sys v0.9.80
   Compiling ring v0.16.20
   Compiling time v0.3.17
   Compiling untrusted v0.7.1
   Compiling openssl v0.10.45
   Compiling spin v0.5.2
   Compiling foreign-types-shared v0.1.1
   Compiling base64 v0.13.1
   Compiling pem v1.1.0
   Compiling foreign-types v0.3.2
   Compiling yasna v0.5.1
   Compiling openssl-macros v0.1.0
   Compiling cfg-if v1.0.0
   Compiling bitflags v1.3.2
   Compiling rcgen v0.10.0
   Compiling rust-web-server v8.0.6
   Compiling rts v8.0.6 (/home/bohdan_tsap/rts/rust-tls-server)
    Finished release [optimized] target(s) in 45.61s

As a side note I'm able to build and install ebuild for a project without dependencies: https://github.com/bohdaq/rws-gentoo-ebuild
rts.zip

bohdaq commented 1 year ago

I have tried cleaning local cargo repository already

gyakovlev commented 1 year ago

your version of cargo-ebuild is severely out of date btw, version from crates.io is not supported anymore and unfortunately we can't publish it due to https://github.com/gentoo/cargo-ebuild/issues/26

you can build/install cargo-ebuild from this repo if you are not on gentoo and just want a bin locally.

as for your problem - nothing to do with cargo-ebuild. your ebuild is improperly located and written.

also you need to $(cargo_crate_uris) there for cargo.eclass to download/unpack crates like I specified above.

also, specify EAPI=8 instead of 7

hope that helps.

bohdaq commented 1 year ago

@gyakovlev updated Install section in README.md and made pull request

bohdaq commented 1 year ago

@gyakovlev

After updating cargo-ebuild manually and setting provided SRC_URI everything worked perfectly.

Here is the github repo for Rust TLS Server ebuild BTW.

However it's still a bit unclear what's happening at SRC_URI.

Also created pull request to update install howto section