cross-rs / cross

โ€œZero setupโ€ cross compilation and โ€œcross testingโ€ of Rust crates
Apache License 2.0
6.73k stars 375 forks source link

feat: add aarch64-unknown-freebsd image #1271

Closed YOU54F closed 1 year ago

YOU54F commented 1 year ago

๐Ÿ‘‹๐Ÿพ

Thanks for Cross, we've been using it at the pact-foundation to build cross platform targets, and I've gone through the target list and attempted to build for everything I can. See PR here

I've managed to build for freebsd in a parallels vm on a mac m1 pro, but makes sense to try and apply that to a Docker image.

Relates to https://github.com/cross-rs/cross/issues/975

Still requires testing but thought I would drop it here for others to have a look at / test / try out

Emilgardis commented 1 year ago

looks good!

bors try --target aarch64-unknown-freebsd

YOU54F commented 1 year ago

Oh man that bot is SUPER COOL!

Emilgardis commented 1 year ago

oh yeah, you need to fix the formatting error before it'll run the actual target tests.

edit: nevermind, seems I was wrong :), forgot how it works

Yes, it's been quite useful for the "not rocket science" rule, unfortunately we have to move away from it soon but we can still implement similar "try this specific thing" with whatever we do, since it's really just implemented with our xtask binary here

YOU54F commented 1 year ago

ta, have updated the clippy check now :)

ty for the links to the bot code, useful to know.

bors[bot] commented 1 year ago

try

Build failed:

Emilgardis commented 1 year ago

bors try --target aarch64-unknown-freebsd

bors[bot] commented 1 year ago

try

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here. For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

YOU54F commented 1 year ago

oooh thanks @Emilgardis looking goood. Right just need to sort the changelog error out now ๐Ÿ™Œ๐Ÿพ

YOU54F commented 1 year ago

I'm not entirely sure what I need to do to pass this check https://github.com/cross-rs/cross/actions/runs/6172725113/job/16753549505?pr=1271

+ echo 'Must add or remove changes or add the '\''no changelog'\'' label'
+ exit 1
Must add or remove changes or add the 'no changelog' label

I assume the previous step should have picked up a diff from the main branch that I am targeting?

Emilgardis commented 1 year ago

see https://github.com/cross-rs/cross/blob/main/.changes/README.md for how to add a changelog entry!

YOU54F commented 1 year ago

awesome, thanks for the pointer. that is neat as-well!

bors[bot] commented 1 year ago

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here. For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

Emilgardis commented 1 year ago

Image is out! https://github.com/cross-rs/cross/pkgs/container/aarch64-unknown-freebsd/versions

YOU54F commented 1 year ago

Ok, so maybe this is just me being, stupid, but I've tried using this and it's failing - on a m1 macbook pro

installed latest cross cargo install cross --git https://github.com/cross-rs/cross trying to build one of our rust projects

https://github.com/pact-foundation/pact-reference/tree/master/rust/pact_ffi

this is suspect - amd64

๐Ÿ•™14:11:27 โฏ cross build --target aarch64-unknown-freebsd
warning: patch for `onig` uses the features mechanism. default-features and features will not take effect because the patch dependency does not support this mechanism
<jemalloc>: MADV_DONTNEED does not work (memset will be used instead)
<jemalloc>: (This is the expected behaviour if you are running under QEMU)
<jemalloc>: MADV_DONTNEED does not work (memset will be used instead)
<jemalloc>: (This is the expected behaviour if you are running under QEMU)
<jemalloc>: MADV_DONTNEED does not work (memset will be used instead)
<jemalloc>: (This is the expected behaviour if you are running under QEMU)
<jemalloc>: MADV_DONTNEED does not work (memset will be used instead)
<jemalloc>: (This is the expected behaviour if you are running under QEMU)
<jemalloc>: MADV_DONTNEED does not work (memset will be used instead)
<jemalloc>: (This is the expected behaviour if you are running under QEMU)
   Compiling libc v0.2.147
<jemalloc>: MADV_DONTNEED does not work (memset will be used instead)
<jemalloc>: (This is the expected behaviour if you are running under QEMU)
   Compiling cfg-if v1.0.0
<jemalloc>: MADV_DONTNEED does not work (memset will be used instead)
<jemalloc>: MADV_DONTNEED does not work (memset will be used instead)
<jemalloc>: (This is the expected behaviour if you are running under QEMU)
<jemalloc>: (This is the expected behaviour if you are running under QEMU)
error[E0463]: can't find crate for `core`
  |
  = note: the `aarch64-unknown-freebsd` target may not be installed
  = help: consider downloading the target with `rustup target add aarch64-unknown-freebsd`

error[E0463]: can't find crate for `compiler_builtins`

For more information about this error, try `rustc --explain E0463`.
error: could not compile `cfg-if` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error[E0432]: unresolved import `ffi::c_void`
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/mod.rs:1604:17
     |
1604 |         pub use ::ffi::c_void;
     |                 ^^^^^^^^^^^^^

error: cannot find attribute `derive` in this scope
  --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/mod.rs:44:38
   |
44 | #[cfg_attr(feature = "extra_traits", derive(Debug))]
   |                                      ^^^^^^

error: cannot find attribute `derive` in this scope
   --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/macros.rs:74:50
    |
74  |               #[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
    |                                                    ^^^^^^
    |
   ::: /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/mod.rs:54:1
    |
54  | / s! {
55  | |     pub struct group {
56  | |         pub gr_name: *mut ::c_char,
57  | |         pub gr_passwd: *mut ::c_char,
...   |
206 | |     }
207 | | }
    | |_- in this macro invocation
    |
    = note: this error originates in the macro `s` (in Nightly builds, run with -Z macro-backtrace for more info)

error: cannot find attribute `derive` in this scope
   --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/mod.rs:422:38
    |
422 | #[cfg_attr(feature = "extra_traits", derive(Debug))]
    |                                      ^^^^^^

error: cannot find attribute `derive` in this scope
   --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/mod.rs:430:38
    |
430 | #[cfg_attr(feature = "extra_traits", derive(Debug))]
    |                                      ^^^^^^

error: cannot find attribute `derive` in this scope
   --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/macros.rs:74:50
    |
74  |               #[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
    |                                                    ^^^^^^
    |
   ::: /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/mod.rs:10:1
    |
10  | / s! {
11  | |     pub struct sockaddr {
12  | |         pub sa_len: u8,
13  | |         pub sa_family: sa_family_t,
...   |
124 | |     }
125 | | }
    | |_- in this macro invocation
    |
    = note: this error originates in the macro `s` (in Nightly builds, run with -Z macro-backtrace for more info)

error: cannot find attribute `derive` in this scope
  --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/mod.rs:56:38
   |
56 | #[cfg_attr(feature = "extra_traits", derive(Debug))]
   |                                      ^^^^^^

error: cannot find attribute `derive` in this scope
   --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/macros.rs:74:50
    |
74  |               #[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
    |                                                    ^^^^^^
    |
   ::: /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/mod.rs:87:1
    |
87  | / s! {
88  | |     pub struct in_addr {
89  | |         pub s_addr: ::in_addr_t,
90  | |     }
...   |
382 | |     }
383 | | }
    | |_- in this macro invocation
    |
    = note: this error originates in the macro `s` (in Nightly builds, run with -Z macro-backtrace for more info)

error: cannot find attribute `derive` in this scope
  --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:51:38
   |
51 | #[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
   |                                      ^^^^^^

error: cannot find attribute `derive` in this scope
  --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:66:38
   |
66 | #[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
   |                                      ^^^^^^

error: cannot find attribute `derive` in this scope
  --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:82:38
   |
82 | #[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
   |                                      ^^^^^^

error: cannot find attribute `derive` in this scope
  --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:97:38
   |
97 | #[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
   |                                      ^^^^^^

error: cannot find attribute `derive` in this scope
   --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:112:38
    |
112 | #[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
    |                                      ^^^^^^

error: cannot find attribute `derive` in this scope
   --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:133:38
    |
133 | #[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
    |                                      ^^^^^^

error: cannot find attribute `derive` in this scope
   --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:165:38
    |
165 | #[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
    |                                      ^^^^^^

error: cannot find attribute `derive` in this scope
   --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:222:38
    |
222 | #[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
    |                                      ^^^^^^

error: cannot find attribute `derive` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/macros.rs:74:50
     |
74   |               #[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
     |                                                    ^^^^^^
     |
    ::: /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:237:1
     |
237  | / s! {
238  | |     pub struct aiocb {
239  | |         pub aio_fildes: ::c_int,
240  | |         pub aio_offset: ::off_t,
...    |
1321 | |     }
1322 | | }
     | |_- in this macro invocation
     |
     = note: this error originates in the macro `s` (in Nightly builds, run with -Z macro-backtrace for more info)

error: cannot find attribute `derive` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2573:38
     |
2573 | #[cfg_attr(feature = "extra_traits", derive(Debug))]
     |                                      ^^^^^^

error: cannot find attribute `derive` in this scope
   --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/macros.rs:74:50
    |
74  |               #[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
    |                                                    ^^^^^^
    |
   ::: /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs:10:1
    |
10  | / s! {
11  | |     pub struct kevent {
12  | |         pub ident: ::uintptr_t,
13  | |         pub filter: ::c_short,
...   |
211 | |     }
212 | | }
    | |_- in this macro invocation
    |
    = note: this error originates in the macro `s` (in Nightly builds, run with -Z macro-backtrace for more info)

error: cannot find attribute `derive` in this scope
 --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs:2:38
  |
2 | #[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
  |                                      ^^^^^^

error: cannot find attribute `derive` in this scope
  --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/macros.rs:74:50
   |
74 |               #[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
   |                                                    ^^^^^^
   |
  ::: /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/align.rs:1:1
   |
1  | / s! {
2  | |     #[repr(align(4))]
3  | |     pub struct in6_addr {
4  | |         pub s6_addr: [u8; 16],
5  | |     }
6  | | }
   | |_- in this macro invocation
   |
   = note: this error originates in the macro `s` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0405]: cannot find trait `PartialEq` in this scope
   --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/mod.rs:161:14
    |
161 |         impl PartialEq for sockaddr_un {
    |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
   --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/mod.rs:173:14
    |
173 |         impl Eq for sockaddr_un {}
    |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
   --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/mod.rs:193:14
    |
193 |         impl PartialEq for utsname {
    |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
   --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/mod.rs:222:14
    |
222 |         impl Eq for utsname {}
    |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
   --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/mod.rs:397:14
    |
397 |         impl PartialEq for sockaddr_storage {
    |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
   --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/mod.rs:410:14
    |
410 |         impl Eq for sockaddr_storage {}
    |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:1618:14
     |
1618 |         impl PartialEq for utmpx {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:1638:14
     |
1638 |         impl Eq for utmpx {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:1667:14
     |
1667 |         impl PartialEq for __c_anonymous_cr_pid {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:1673:14
     |
1673 |         impl Eq for __c_anonymous_cr_pid {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:1689:14
     |
1689 |         impl PartialEq for xucred {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:1704:14
     |
1704 |         impl Eq for xucred {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:1733:14
     |
1733 |         impl PartialEq for sockaddr_dl {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:1749:14
     |
1749 |         impl Eq for sockaddr_dl {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:1777:14
     |
1777 |         impl PartialEq for mq_attr {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:1785:14
     |
1785 |         impl Eq for mq_attr {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:1805:14
     |
1805 |         impl PartialEq for sigevent {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:1814:14
     |
1814 |         impl Eq for sigevent {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:1835:14
     |
1835 |         impl PartialEq for ptsstat {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:1843:14
     |
1843 |         impl Eq for ptsstat {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:1864:14
     |
1864 |         impl PartialEq for __c_anonymous_elf32_auxv_union {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:1870:14
     |
1870 |         impl Eq for __c_anonymous_elf32_auxv_union {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:1886:14
     |
1886 |         impl PartialEq for Elf32_Auxinfo {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:1892:14
     |
1892 |         impl Eq for Elf32_Auxinfo {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:1912:14
     |
1912 |         impl PartialEq for __c_anonymous_ifr_ifru {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:1934:14
     |
1934 |         impl Eq for __c_anonymous_ifr_ifru {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:1978:14
     |
1978 |         impl PartialEq for ifreq {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:1983:14
     |
1983 |         impl Eq for ifreq {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2000:14
     |
2000 |         impl Eq for __c_anonymous_ifc_ifcu {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2003:14
     |
2003 |         impl PartialEq for __c_anonymous_ifc_ifcu {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2030:14
     |
2030 |         impl PartialEq for ifstat {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2038:14
     |
2038 |         impl Eq for ifstat {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2056:14
     |
2056 |         impl PartialEq for ifrsskey {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2068:14
     |
2068 |         impl Eq for ifrsskey {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2092:14
     |
2092 |         impl PartialEq for ifdownreason {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2103:14
     |
2103 |         impl Eq for ifdownreason {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2126:14
     |
2126 |         impl PartialEq for __c_anonymous_ifi_epoch {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2135:14
     |
2135 |         impl Eq for __c_anonymous_ifi_epoch {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2156:14
     |
2156 |         impl PartialEq for __c_anonymous_ifi_lastchange {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2165:14
     |
2165 |         impl Eq for __c_anonymous_ifi_lastchange {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2185:14
     |
2185 |         impl PartialEq for if_data {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2214:14
     |
2214 |         impl Eq for if_data {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2276:14
     |
2276 |         impl PartialEq for sctphdr {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2284:14
     |
2284 |         impl Eq for sctphdr {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2304:14
     |
2304 |         impl PartialEq for sctp_chunkhdr {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2311:14
     |
2311 |         impl Eq for sctp_chunkhdr {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2329:14
     |
2329 |         impl PartialEq for sctp_paramhdr {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2335:14
     |
2335 |         impl Eq for sctp_paramhdr {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2351:14
     |
2351 |         impl PartialEq for sctp_gen_error_cause {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2358:14
     |
2358 |         impl Eq for sctp_gen_error_cause {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2376:14
     |
2376 |         impl PartialEq for sctp_error_cause {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2382:14
     |
2382 |         impl Eq for sctp_error_cause {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2398:14
     |
2398 |         impl PartialEq for sctp_error_invalid_stream {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2404:14
     |
2404 |         impl Eq for sctp_error_invalid_stream {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2420:14
     |
2420 |         impl PartialEq for sctp_error_missing_param {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2427:14
     |
2427 |         impl Eq for sctp_error_missing_param {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2445:14
     |
2445 |         impl PartialEq for sctp_error_stale_cookie {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2451:14
     |
2451 |         impl Eq for sctp_error_stale_cookie {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2467:14
     |
2467 |         impl PartialEq for sctp_error_out_of_resource {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2472:14
     |
2472 |         impl Eq for sctp_error_out_of_resource {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2486:14
     |
2486 |         impl PartialEq for sctp_error_unresolv_addr {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2491:14
     |
2491 |         impl Eq for sctp_error_unresolv_addr {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2505:14
     |
2505 |         impl PartialEq for sctp_error_unrecognized_chunk {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2511:14
     |
2511 |         impl Eq for sctp_error_unrecognized_chunk {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2527:14
     |
2527 |         impl PartialEq for sctp_error_no_user_data {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2533:14
     |
2533 |         impl Eq for sctp_error_no_user_data {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2549:14
     |
2549 |         impl PartialEq for sctp_error_auth_invalid_hmac {
     |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
    --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/mod.rs:2555:14
     |
2555 |         impl Eq for sctp_error_auth_invalid_hmac {}
     |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
   --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs:265:14
    |
265 |         impl PartialEq for statfs {
    |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
   --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs:297:14
    |
297 |         impl Eq for statfs {}
    |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
   --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs:346:14
    |
346 |         impl PartialEq for dirent {
    |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
   --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs:359:14
    |
359 |         impl Eq for dirent {}
    |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
   --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs:381:14
    |
381 |         impl PartialEq for vnstat {
    |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
   --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs:396:14
    |
396 |         impl Eq for vnstat {}
    |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
  --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/aarch64.rs:49:14
   |
49 |         impl PartialEq for gpregs {
   |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
  --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/aarch64.rs:59:14
   |
59 |         impl Eq for gpregs {}
   |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
  --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/aarch64.rs:82:14
   |
82 |         impl PartialEq for fpregs {
   |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
  --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/aarch64.rs:91:14
   |
91 |         impl Eq for fpregs {}
   |              ^^ not found in this scope

error[E0405]: cannot find trait `PartialEq` in this scope
   --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/aarch64.rs:112:14
    |
112 |         impl PartialEq for mcontext_t {
    |              ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `Eq` in this scope
   --> /Users/yousaf.nabi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.147/src/unix/bsd/freebsdlike/freebsd/aarch64.rs:121:14
    |
121 |         impl Eq for mcontext_t {}
    |              ^^ not found in this scope

Some errors have detailed explanations: E0405, E0432, E0463.
For more information about an error, try `rustc --explain E0405`.
error: could not compile `libc` (lib) due to 274 previous errors
[cross] warning: rust-std is not available for aarch64-unknown-freebsd
[cross] note: you may need to build components for the target via `-Z build-std=<components>` or in your cross configuration specify `target.aarch64-unknown-freebsd.build-std`
              the available components are core, std, alloc, and proc_macro

pact-reference/rust/pact_ffi on ๎‚  master@origin:master is ๐Ÿ“ฆ v0.4.9 via โ–ณ via ๐Ÿฆ€ v1.71.0 on โ˜๏ธ  (eu-west-2) took 14s
๐Ÿ•™14:11:46 [๐Ÿ”ด 101] โฏ
Emilgardis commented 1 year ago

You need to specify that you want std, cross wont automatically build it for you, follow the suggestion

you may need to build components for the target via -Z build-std=<components> or in your cross configuration specify target.aarch64-unknown-freebsd.build-std the available components are core, std, alloc, and proc_macro

YOU54F commented 1 year ago

Thanks I thought so, I tried that, however my initial issue was staring me in the face, I wasn't actually using the nightly channel

https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust

tl;dr: rustup default nightly

I assumed that the std component was already in the docker image, that we've created and pushed!

building now ๐Ÿคž๐Ÿพ with cross build -Z build-std=std,core --target aarch64-unknown-freebsd = success ๐Ÿš€

Screenshot 2023-09-15 at 17 30 34 Screenshot 2023-09-15 at 17 30 09
Emilgardis commented 1 year ago

Thanks I thought so, I tried that, however my initial issue was staring me in the face, I wasn't actually using the nightly channel

Ah! Great

https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust

tl;dr: rustup default nightly

cross +nightly command

Would have also worked

I assumed that the std component was already in the docker image, that we've created and pushed!

Common misconception, we dont ship anything related to rust in the images, only tools needed to cross compile, you bring the rust toolchain, crosss images provides the cross-tools, docker/podman/the container engine brings it together using your local rust toolchain and the images. Use -v to see the docker and rustup invocations we do

YOU54F commented 1 year ago

Consider me taught now! I will spread the word far and wide - I'm due to write a few blog posts of virtualisation, and some fun with cross, cross-compiling, so will make sure these tips are in there!

Nice tip with the +nightly command and also using -v to checkout the invocations.

Just to follow up for others who might want to use the image.

I dedicated all 10 cpus from an m1 pro 16" to docker and 4gb memory.

Debug build took 5 mins, Release build took 19 mins.

Build sizes below

347M    pact_verifier_cli_aarch64_freebsd_debug
 24M    pact_verifier_cli_aarch64_freebsd_release

These posts are useful for setting up a freebsd vm with UTM

Thanks again for the support on this