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

Hangs when trying to process rust-bindgen v0.63.0 #29

Open srcshelton opened 1 year ago

srcshelton commented 1 year ago

Running cargo-ebuild ebuild --noaudit in the cloned https://github.com/rust-lang/rust-bindgen.git repo with tag v0.63.0 checked-out causes cargo-ebuild to hang indefinitely without producing any output.

If I run it through ltrace, I see:

[pid 18249] SYS_write(2, "waiting for file lock on package"..., 38 <unfinished ...>
[pid 18248] SYS_read(6 <unfinished ...>
[pid 18249] <... SYS_write resumed> )                                                                 = 38 <0.000063>
[pid 18248] <... SYS_read resumed> , "waiting for file lo", 19)                                       = 19 <0.000024>
[pid 18249] SYS_write(2, "\n", 1 <unfinished ...>
[pid 18248] SYS_read(6 <unfinished ...>
[pid 18249] <... SYS_write resumed> )                                                                 = 1 <0.000029>
[pid 18248] <... SYS_read resumed> , "ck on package cache\n", 32)                                     = 20 <0.000026>
[pid 18249] SYS_flock(3, 2, 1, 0x7e8b5237b929f181 <unfinished ...>
[pid 18248] SYS_read(6 <no return ...>
error: maximum array length seems negative
, "", 12)                                                                                             = -11 <0.000016>
[pid 18248] SYS_poll(0x7ffdaff412d8, 2, -1

… whereupon it hangs until interrupted. This happens with releases 0.5.1 & 0.5.2.

It would be handy if a --verbose option could be added to give more visibility into what is happening internally (what files are being read, what crates have been discovered on the fly, etc.)!

gyakovlev commented 1 year ago

just posting workarounds:

you can also use python version

https://packages.gentoo.org/packages/app-portage/pycargoebuild

or simple trick:

{ export ch="$(mktemp -d)" && CARGO_HOME="${ch}" cargo fetch && ls -1 "${ch}/registry/src/"*/ && echo "crates: ${ch}/registry/cache/" && unset ch ; }

it will print you CRATES variable contents ^ and pre-download crates as a bonus to /tmp/, so you can copy those to portage's DISTDIR.

srcshelton commented 1 year ago

It looks as if the error may be that rust-bindgen's top-level Cargo.toml contains:

[workspace]
members = [
    "bindgen",
    "bindgen-cli",
    "bindgen-integration",
    "bindgen-tests",
    "bindgen-tests/tests/quickchecking",
    "bindgen-tests/tests/expectations",
]

default-members = [
    "bindgen",
    "bindgen-cli",
    "bindgen-tests",
]

… whereas tools seem to expect a package section?