Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support FreeBSD amd64 #1691

Closed
mdyring opened this issue Jul 9, 2023 · 8 comments · Fixed by #3308
Closed

Support FreeBSD amd64 #1691

mdyring opened this issue Jul 9, 2023 · 8 comments · Fixed by #3308
Labels
enhancement New feature or request

Comments

@mdyring
Copy link

mdyring commented Jul 9, 2023

Hi team,

Trying to build namada from source inside a FreeBSD jail. On FreeBSD 13.2 amd64.

Inside a clean jail, doing a pkg install gmake rust llvm protobuf before the build will get me pretty far. However I am stuck here:

Compiling sysinfo v0.21.1
error[E0433]: failed to resolve: use of undeclared crate or module `fmt`
  --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sysinfo-0.21.1/src/unknown/process.rs:11:6
   |
11 | impl fmt::Display for ProcessStatus {
   |      ^^^ use of undeclared crate or module `fmt`

error[E0433]: failed to resolve: use of undeclared crate or module `fmt`
  --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sysinfo-0.21.1/src/unknown/process.rs:12:27
   |
12 |     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
   |                           ^^^ use of undeclared crate or module `fmt`

error[E0433]: failed to resolve: use of undeclared crate or module `fmt`
  --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sysinfo-0.21.1/src/unknown/process.rs:12:46
   |
12 |     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
   |                                              ^^^ use of undeclared crate or module `fmt`

error[E0412]: cannot find type `ProcessStatus` in this scope
  --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sysinfo-0.21.1/src/unknown/process.rs:11:23
   |
11 | impl fmt::Display for ProcessStatus {
   |                       ^^^^^^^^^^^^^ not found in this scope
   |
help: consider importing this enum
   |
7  + use crate::ProcessStatus;
   |

error[E0412]: cannot find type `ProcessStatus` in this scope
  --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sysinfo-0.21.1/src/unknown/process.rs:73:25
   |
73 |     fn status(&self) -> ProcessStatus {
   |                         ^^^^^^^^^^^^^ not found in this scope
   |
help: consider importing this enum
   |
7  + use crate::ProcessStatus;
   |

error[E0433]: failed to resolve: use of undeclared type `ProcessStatus`
  --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sysinfo-0.21.1/src/unknown/process.rs:74:9
   |
74 |         ProcessStatus::Unknown(0)
   |         ^^^^^^^^^^^^^ use of undeclared type `ProcessStatus`
   |
help: consider importing this enum
   |
7  + use crate::ProcessStatus;
   |

Some errors have detailed explanations: E0412, E0433.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `sysinfo` (lib) due to 6 previous errors
warning: build failed, waiting for other jobs to finish...
The following warnings were emitted during compilation:

warning: src/file_lock.c:12:17: error: use of undeclared identifier 'SEEK_SET'
warning:   fl.l_whence = SEEK_SET;
warning:                 ^
warning: src/file_lock.c:31:17: error: use of undeclared identifier 'SEEK_SET'
warning:   fl.l_whence = SEEK_SET;
warning:                 ^
warning: 2 errors generated.

error: failed to run custom build command for `file-lock v2.1.9`

Caused by:
  process didn't exit successfully: `/root/namada/target/debug/build/file-lock-c29565a7cef5f6fc/build-script-build` (exit status: 1)
  --- stdout
  TARGET = Some("x86_64-unknown-freebsd")
  OPT_LEVEL = Some("0")
  HOST = Some("x86_64-unknown-freebsd")
  cargo:rerun-if-env-changed=CC_x86_64-unknown-freebsd
  CC_x86_64-unknown-freebsd = None
  cargo:rerun-if-env-changed=CC_x86_64_unknown_freebsd
  CC_x86_64_unknown_freebsd = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-freebsd
  CFLAGS_x86_64-unknown-freebsd = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_freebsd
  CFLAGS_x86_64_unknown_freebsd = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-2" "-fno-omit-frame-pointer" "-m64" "-Wall" "-Wextra" "-o" "/root/namada/target/debug/build/file-lock-9bfde4798d649731/out/src/file_lock.o" "-c" "src/file_lock.c"
  cargo:warning=src/file_lock.c:12:17: error: use of undeclared identifier 'SEEK_SET'
  cargo:warning=  fl.l_whence = SEEK_SET;
  cargo:warning=                ^
  cargo:warning=src/file_lock.c:31:17: error: use of undeclared identifier 'SEEK_SET'
  cargo:warning=  fl.l_whence = SEEK_SET;
  cargo:warning=                ^
  cargo:warning=2 errors generated.
  exit status: 1

  --- stderr


  error occurred: Command "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-2" "-fno-omit-frame-pointer" "-m64" "-Wall" "-Wextra" "-o" "/root/namada/target/debug/build/file-lock-9bfde4798d649731/out/src/file_lock.o" "-c" "src/file_lock.c" with args "cc" did not execute successfully (status code exit status: 1).

It would be great if you could provide release binaries alongside the Linux and Darwin builds. Hopefully not far from Darwin to FreeBSD and it would be great to get native FreeBSD performance instead of having to run it in a Linux VM.

@mdyring mdyring added the enhancement New feature or request label Jul 9, 2023
@sug0
Copy link
Collaborator

sug0 commented Jul 9, 2023

Hi @mdyring, thanks for opening up an issue! I think right now this isn't at the top of the list of our priorities, but it would be a nice thing to have in the foreseeable future.

Regardless, I can already identify the culprits that make your build fail:

@mdyring
Copy link
Author

mdyring commented Jul 10, 2023

Sounds like there is a good path forward, building locally is not a major issue for me. Happy to give it a spin once ready.

@tzemanovic
Copy link
Member

I've opened #1695 as it looks like a low hanging fruit - we'll try to include both of these in the next release

@mdyring
Copy link
Author

mdyring commented Jul 19, 2023

I'm keeping my fingers crossed that this will be ready for next testnet, that way I can claim "first Namada on FreeBSD" :-)

@tzemanovic
Copy link
Member

the PRs were released in 0.20 so hopefully that unblocked building on FreeBSD. If something doesn't work, please comment and/or reopen this issue

@mdyring
Copy link
Author

mdyring commented Jul 28, 2023

Almost there, stuck on wasmer-vm.

error: Unsupported platform
   --> /root/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/wasmer-vm-2.3.0/src/trap/traphandlers.rs:305:21
    |
305 |                     compile_error!("Unsupported platform");
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

It is supported from v3.3.0 onwards:
https://github.com/wasmerio/wasmer/blob/master/CHANGELOG.md#330---03052023

@tzemanovic tzemanovic reopened this Jul 28, 2023
@tzemanovic
Copy link
Member

depends on #821

@sug0
Copy link
Collaborator

sug0 commented May 31, 2024

@mdyring hey, in case you are still interested, could you please confirm that version v0.38.0 (the latest release) of Namada works with FreeBSD? cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants