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

cross-platform installation #143

Open
gsalzer opened this issue Mar 1, 2022 · 1 comment
Open

cross-platform installation #143

gsalzer opened this issue Mar 1, 2022 · 1 comment

Comments

@gsalzer
Copy link

gsalzer commented Mar 1, 2022

Overview

It seems that solcx is tied to the platform it is running on, meaning that it will load and install binaries for the current platform.
For cross-platform use, it would be useful to request binaries for another platform, e.g. when preparing mounts for a virtual machine, or a docker image.

The following code achieves what I want (assuming that the target platform is Linux):

import solcx.install
solcx.install._get_os_name.__code__ = (lambda:"linux").__code__

The assignment patches the internal function _get_os_name to return always "linux". Obviously, this not a clean solution, as it breaks when the private function is changed. Is there a better solution?

@gsalzer
Copy link
Author

gsalzer commented Apr 16, 2022

Commit 486481d adds a function set_target_os. If the target os is different from the current host os, the images for the target os will be pulled, stored in .solx-targetos, and used.

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

No branches or pull requests

1 participant