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

Build Static Linux Executable from macOS #4852

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

GheisMohammadi
Copy link
Contributor

This PR introduces a solution for macOS users to build Linux static executables for the Harmony project. The primary goal of this change is to address the issue where macOS developers, who are unable to natively build Linux binaries on their machines, can now generate static Linux executables by leveraging Docker.

The main addition is a new shell script that facilitates building the Linux static binary inside a Docker container. This allows developers on macOS to run the build process in a Linux environment without the need for a native Linux setup. The script automates the Docker image build, mounts the necessary directories, and executes the make linux_static command within the container, ensuring the resulting binaries are placed in a designated output directory.

In addition to the shell script, a new linux_static_from_macos command has been added to the Makefile. This new command simplifies the process for macOS users by providing a convenient, one-line command to initiate the build process for Linux static executables.

Please note that the first time the linux_static_from_macos command is run, the Docker image will need to be built, which may take some time. However, after the Docker image is successfully built and stored locally, subsequent builds will be much faster as the image will be reused without needing to rebuild it.

This PR ensures that developers can focus more on the code and less on managing cross-platform build environments.

@sophoah
Copy link
Contributor

sophoah commented Feb 19, 2025

@Frozen

@sophoah
Copy link
Contributor

sophoah commented Feb 20, 2025

@Frozen

1 similar comment
@sophoah
Copy link
Contributor

sophoah commented Feb 25, 2025

@Frozen

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.

3 participants