Bug 210017 - devel/cargo: Fails to build with libgit2-sys-0.4.0 errors and curl-0.2.16 errors after lang/rust 1.9.0 update
Summary: devel/cargo: Fails to build with libgit2-sys-0.4.0 errors and curl-0.2.16 err...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords: needs-patch, regression
Depends on:
Blocks:
 
Reported: 2016-06-04 09:10 UTC by Lacey Powers
Modified: 2016-06-07 13:46 UTC (History)
3 users (show)

See Also:
vlad-fbsd: maintainer-feedback? (dumbbell)


Attachments
portmaster build log devel/cargo (10.94 KB, text/x-log)
2016-06-04 09:10 UTC, Lacey Powers
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lacey Powers 2016-06-04 09:10:06 UTC
Created attachment 171000 [details]
portmaster build log devel/cargo

The latest cargo fails to build with on FreeBSD 10.3-RELEASE-p4 amd64 with the following errors under portmaster and synth. Full build log attached.

Please let me know if you need further information. Thank you. =)


/usr/ports/devel/cargo/work/.cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.2.16/src/ffi/easy.rs:68:65: 68:77 error: can't pass `extern "C" fn(*mut u8, usize, usize, *mut http::body::Body<'_>) -> usize {ffi::easy::curl_read_fn}` to variadic function, cast to `extern "C" fn(*mut u8, usize, usize, *mut http::bo
/usr/ports/devel/cargo/work/.cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.2.16/src/ffi/easy.rs:68             ffi::curl_easy_setopt(self.curl, opt::READFUNCTION, curl_read_fn);
                                                                                                                                                                           ^~~~~~~~~~~~
/usr/ports/devel/cargo/work/.cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.2.16/src/ffi/easy.rs:71:66: 71:79 error: can't pass `extern "C" fn(*mut u8, usize, usize, *mut ffi::easy::ResponseBuilder) -> usize {ffi::easy::curl_write_fn}` to variadic function, cast to `extern "C" fn(*mut u8, usize, usize, *mut f
/usr/ports/devel/cargo/work/.cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.2.16/src/ffi/easy.rs:71             ffi::curl_easy_setopt(self.curl, opt::WRITEFUNCTION, curl_write_fn);
                                                                                                                                                                            ^~~~~~~~~~~~~
/usr/ports/devel/cargo/work/.cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.2.16/src/ffi/easy.rs:74:67: 74:81 error: can't pass `extern "C" fn(*mut u8, usize, usize, &mut ffi::easy::ResponseBuilder) -> usize {ffi::easy::curl_header_fn}` to variadic function, cast to `extern "C" fn(*mut u8, usize, usize, &mut 
/usr/ports/devel/cargo/work/.cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.2.16/src/ffi/easy.rs:74             ffi::curl_easy_setopt(self.curl, opt::HEADERFUNCTION, curl_header_fn);
                                                                                                                                                                             ^~~~~~~~~~~~~~
/usr/ports/devel/cargo/work/.cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.2.16/src/ffi/easy.rs:77:69: 77:85 error: can't pass `extern "C" fn(*mut Box<std::ops::FnMut(usize, usize, usize, usize)>, f64, f64, f64, f64) -> i32 {ffi::easy::curl_progress_fn}` to variadic function, cast to `extern "C" fn(*mut Box<
/usr/ports/devel/cargo/work/.cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.2.16/src/ffi/easy.rs:77             ffi::curl_easy_setopt(self.curl, opt::PROGRESSFUNCTION, curl_progress_fn);
                                                                                                                                                                               ^~~~~~~~~~~~~~~~
error: aborting due to 4 previous errors
Build failed, waiting for other jobs to finish...
/usr/ports/devel/cargo/work/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.4.0/lib.rs:539:9: 539:30 error: unresolved import `git_status_show_t::*`. Not a module `git_status_show_t` [E0432]
/usr/ports/devel/cargo/work/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.4.0/lib.rs:539 pub use git_status_show_t::*;
                                                                                                                 ^~~~~~~~~~~~~~~~~~~~~
/usr/ports/devel/cargo/work/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.4.0/lib.rs:539:9: 539:30 help: run `rustc --explain E0432` to see a detailed explanation
error: aborting due to previous error
Could not compile `curl`.

To learn more, run the command again with --verbose.
Makefile:93: recipe for target 'cargo-x86_64-unknown-freebsd' failed
Comment 1 Jan Beich freebsd_committer freebsd_triage 2016-06-04 13:41:06 UTC
Also noticed by pkg-fallout@. I guess, rust-1.9 wants at least cargo-1.10.

http://beefy6.nyi.freebsd.org/data/101amd64-default/416265/logs/errors/cargo-0.9.0.log
Comment 2 Jan Beich freebsd_committer freebsd_triage 2016-06-04 14:30:20 UTC
cargo-1.10 cannot be bootstrapped from cargo-0.2 and there're no new binaries from upstream. Maybe worth to use previous package cached under local-distfiles, extract under WRKDIR, adjust PATH and always pass --local-cargo. i386 or anything else lang/rust also supports would come for free.

 Downloading regex v0.1.58
Unable to get packages from source

Caused by:
  failed to parse manifest at `/.../work/.cargo/registry/src/github.com-1ecc6299db9ec823/regex-0.1.58/Cargo.toml`

Caused by:
  expected a value of type `string` for the key `lib.name`
Comment 3 Jean-Sébastien Pédron freebsd_committer freebsd_triage 2016-06-04 15:31:14 UTC
I wonder if we can use rustup [1] as the bootstrap version of rustc and cargo instead of relying on a real up-to-date bootstrap. rustup provides prebuilt snapshots of stable and nightly channels for FreeBSD/amd64.

At the time of this writing, the latest snapshot was built on 2016-05-31. Rust 1.9.0 and Cargo 0.10.0 are available in the stable channel.

I'm currently trying to build devel/cargo updated to 0.10.0 with --local-cargo pointing to rustup's install.

[1] https://www.rustup.rs/
Comment 4 commit-hook freebsd_committer freebsd_triage 2016-06-06 04:41:18 UTC
A commit references this bug:

Author: jbeich
Date: Mon Jun  6 04:40:20 UTC 2016
New revision: 416441
URL: https://svnweb.freebsd.org/changeset/ports/416441

Log:
  devel/cargo: update to 0.10.0 to unbreak after r416219

  Newer bootstrap snapshots are required, so update src/snapshots.txt
  based on rustup verbose output[1]. I couldn't find one for DragonFly.

    $ fetch -o /tmp/rustup.sh https://sh.rustup.rs
    $ sh /tmp/rustup.sh -v
    [...]
    https://static.rust-lang.org/dist/channel-rust-stable.toml
    [...]
    https://static.rust-lang.org/cargo-dist/2016-04-10/cargo-nightly-x86_64-unknown-freebsd.tar.gz

  PR:		210017
  Reported by:	pkg-fallout, Lacey Powers
  Reported by:	dumbbell (maintainer) [1]

Changes:
  head/devel/cargo/Makefile
  head/devel/cargo/distinfo
  head/devel/cargo/files/patch-src_snapshots.txt
Comment 5 Jan Beich freebsd_committer freebsd_triage 2016-06-07 13:46:40 UTC
cargo-0.10 package should be available shortly:
http://beefy6.nyi.freebsd.org/data/101amd64-default/416491/logs/cargo-0.10.0.log
http://pkg.freebsd.org/freebsd:10:x86:64/latest/All/cargo-0.10.0.txz

(In reply to Jean-Sébastien Pédron from comment #3)
If you still want to pursue rustup integration open a separate bug/review. I expect you to hit the same issues as with any foreign packaging system:
- poudriere forbids networking during fetch phase
- mirroring support with FreeBSD infra