pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Cross-buliding rust



Hmm...

it seems my scheme for cross-building rust isn't "robust".

I made a stab at upgrading to version 1.29.2, and there is
"fireworks".

It seems that rust internally carries the complete sources for
some of the packages it depends on, and that even though these
packages have been installed via pkgsrc, at least when cross-
building, the rust build tries to build the "internal" versions.

That would be just fine if rust stuck to released versions of
these packages, but apparently that is not the case.

Example from libgit2:

running: "gcc" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-O2" "-D_FORTIFY_SOURCE=2" "-I/usr/pkg/include" "-I/usr/include" "-I/usr/include/krb5" "-m64" "-m64" "-I" "/usr/pkgsrc/lang/rust/work/rustc-1.29.2-src/build/x86_64-unknown-netbsd/stage2-tools/x86_64-unknown-netbsd/release/build/libgit2-sys-a40f1fcfb2c04b96/out/include" "-I" "libgit2/src" "-I" "libgit2/deps/http-parser" "-I" "libgit2/deps/regex" "-I" "/usr/pkgsrc/lang/rust/work/rustc-1.29.2-src/build/x86_64-unknown-netbsd/stage2-tools/x86_64-unknown-netbsd/release/build/libssh2-sys-61076abaaa1a74c6/out/include" "-I" "/usr/include" "-I" "/usr/pkg/include" "-fvisibility=hidden" "-o" "/usr/pkgsrc/lang/rust/work/rustc-1.29.2-src/build/x86_64-unknown-netbsd/stage2-tools/x86_64-unknown-netbsd/release/build/libgit2-sys-a40f1fcfb2c04b96/out/build/libgit2/src/worktree.o" "-c" "libgit2/src/worktree.c"
cargo:warning=libgit2/src/worktree.c: In function 'git_worktree_add':
cargo:warning=libgit2/src/worktree.c:354:12: error: 'git_worktree_add_options {aka struct git_worktree_add_options}' has no member named 'ref'
cargo:warning=  if (wtopts.ref) {
cargo:warning=            ^

This is, I'm pretty sure, a case of trying to mix the pkgsrc
headers for libgit2 with the rust-internal copy of libgit2.

I've tried navigating github's libgit2, and even though the
worktree.h commit which introduced the "ref" member was done 9
months ago, it doesn't look to me like that commit is part of any
released version of libgit2, which I find slightly confusing and
strange.

And here I went thinking that the upgrade to 1.29.2 was a minor
fix/workaround for a mis-compilation bug, ref.

  https://blog.rust-lang.org/2018/10/12/Rust-1.29.2.html

but apparently there's quite a lot more to it.

I did try to do a build without having libgit2 installed from
pkgsrc (commented out the buildlink3.mk file inclusion), but a
similar issue then appears when building the internal copy rust
carries of libssh2, where I get

cargo:warning=libssh2/src/channel.c:2272:44: error: 'LIBSSH2_ERROR_CHANNEL_WINDOW_FULL' undeclared (first use in this function)
cargo:warning=             return _libssh2_error(session, LIBSSH2_ERROR_CHANNEL_WINDOW_FULL,
cargo:warning=                                            ^
cargo:warning=libssh2/src/channel.c:2272:44: note: each undeclared identifier is reported only once for each function it appears in

Suggestions?

Best regards,

- Håvard


Home | Main Index | Thread Index | Old Index