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

Added script to build portable binaries #74

Closed
wants to merge 5 commits into from
Closed

Added script to build portable binaries #74

wants to merge 5 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Jan 5, 2018

#65

pkg/bin/build.sh Outdated
mkdir lib &&
cp libcrypto.a libssl.a lib/ &&
cd ../../.. &&
OPENSSL_DIR=$PWD/pkg/bin/openssl-$openssl_release/ cargo +nightly build --release
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need --target=x86_64-unknown-linux-musl here, otherwise it won't be a statically linked binary.

@osa1
Copy link
Owner

osa1 commented Jan 6, 2018

This works but depends on where I'm running it from (e.g. running it from top-level doesn't work, I have to cd into pkg/bin).

Also, we should pass a --target=... parameter to cargo build.

I wonder if there's an easy-to-use build system for this kind of stuff. It'd be great if we could cache OpenSSL builds, check for clang etc. availability easily etc.

@ghost
Copy link
Author

ghost commented Jan 8, 2018

I accidentally stashed a commit, before fetching and rebasing, so I had to do a merge to get my stashed commit to push. Github is now not showing one of your comments, but I fixed the cd command (this is such a learning process...).

Earlier, I couldn't get it working with --target=x86_64-unknown-linux-musl and then it started working inexplicably. I should have double checked, it seems that I somehow removed that part of the line with a git operation or something. If I try to run it with --target=x86_64-unknown-linux-musl, I get the following errors:

   Compiling lazycell v0.5.1
   Compiling foreign-types-shared v0.1.1
error[E0463]: can't find crate for `core`
  |
  = note: the `x86_64-unknown-linux-musl` target may not be installed

error: aborting due to previous error

error: Could not compile `foreign-types-shared`.
warning: build failed, waiting for other jobs to finish...
error[E0463]: can't find crate for `std`
  |
  = note: the `x86_64-unknown-linux-musl` target may not be installed

error: aborting due to previous error

error: Could not compile `lazycell`.

To learn more, run the command again with --verbose.

I don't know how to cross-compile with Rust from Arch Linux. I will look into it, but the command does work for you and @seathlin , right?

This works but depends on where I'm running it from (e.g. running it from top-level doesn't work, I have to cd into pkg/bin).

Also, we should pass a --target=... parameter to cargo build.

I wonder if there's an easy-to-use build system for this kind of stuff. It'd be great if we could cache OpenSSL builds, check for clang etc. availability easily etc.

Does this need to work for more than one developer(you, when you make the binary releases)?

I'm not familiar with build systems. The features you mentioned shouldn't be hard to write in bash but there may be a better way to do this.

@ghost ghost closed this Oct 8, 2019
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant