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

Fix cross compilation in order to generate and distribute precompiled binaries. #34

Open
evilsocket opened this issue Jan 12, 2024 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@evilsocket
Copy link
Owner

Currently, when a new release is published, docker images for linux/amd64 and linux/arm64 are automatically built and pushed to https://hub.docker.com/r/evilsocket/legba. While this allows users to just pull the image and use it on any platform supported by Docker, it'd be ideal to also be able to generate and distribute precompiled binaries that might be better suited for certain scenarios (embedded devices for one).

While I had some success in cross compiling this project for x86_64-unknown-linux-gnu using cross with this Cross.toml project file, the build still fails for some OS/arch, mostly due to the libsmbclient and libssl native dependencies that somehow I still am trying to cross compile and/or install incorrectly.

It'd be awesome if someone with more experience than me on Rust cross compilation could help.

To start we'd need to generate binaries for:

  • aarch64-unknown-linux-gnu
  • arm-unknown-linux-gnueabi
  • armv7-unknown-linux-gnueabi
  • x86_64-pc-windows-gnu
  • aarch64-apple-darwin
  • x86_64-apple-darwin

Ideally support Android and iOS targets in the future too.

@evilsocket evilsocket added the help wanted Extra attention is needed label Jan 12, 2024
@enomothem
Copy link

的确,我在编译windows二进制过程中出现了很多困难

@Azathothas
Copy link

I have had some success with this, though some features needed to be disabled to get a static binary. (They might work if dynamically linked binaries are acceptable)
This should provide some hints to #1 & #31

  • Linux x86_64

ENABLED_FEATURES="amqp dns ftp http http_relative_paths imap kerberos ldap mongodb mqtt mssql pop3 rdp redis scylla smtp socks5 sql ssh stomp tcp_ports telnet vnc"
DISABLED_FEATURES="oracle samba (breaks, unable to find libs)"
  • Linux aarch64

ENABLED_FEATURES="amqp dns ftp http http_relative_paths imap kerberos ldap mongodb mqtt mssql pop3 rdp redis scylla smtp socks5 sql ssh stomp tcp_ports telnet vnc"
DISABLED_FEATURES="oracle samba (breaks, unable to find libs)"
  • Windows x64

ENABLED_FEATURES="amqp dns ftp http http_relative_paths imap kerberos ldap mongodb mssql pop3 rdp redis scylla smtp socks5 sql ssh stomp tcp_ports telnet vnc"
DISABLED_FEATURES="mqtt ( https://github.com/eclipse/paho.mqtt.rust/issues?q=is%3Aissue+is%3Aopen+windows ) ; oracle samba (breaks, unable to find libs) "

@evilsocket
Copy link
Owner Author

@Azathothas yes, as I said compiling legba without said libraries (especially smbclient) is trivial on any OS. The point of this issue is finding solutions to cross compile binaries including the samba feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants