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
feat: add support for compiling open/r on 64-bit arm linux #95
Conversation
build/fbcode_builder/manifests/cmake
Outdated
@@ -11,30 +11,17 @@ cmake | |||
[dependencies] | |||
ninja | |||
|
|||
[download.os=windows] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not properly awake yet, but I worry that these windows and darwin changes will break things for those platforms; in particular, Windows doesn't have a predictable make
utility, so it is desirable to sidestep that headache if we can!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @wez, thank you for the review.
At least on darwin (big sur) I had no problems with my current setup, however I do not have a windows machine. Do you prefer that we leave the dowload options for windows and darwin as they were?
IMO we should leave darwin just as linux, since apple now supports ARM archs, which will eventually cause problems for some users (like me).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But really sure if we can do conditionals at the manifest declaration, because if we can I can change in a way that it always downloads the binaries (for ARM/x86) for all platforms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm 50:50 on making darwin build it: darwin's arm platforms can run intel binaries, so the build is probably faster if we have it download the binary pre-built.
Windows I think is important to download binaries because there's no guarantee that there is a working make at all, let alone one that targets native windows binaries.
The .os=windows
stuff at the end of the key is the getdeps conditional syntax.
You could add arch
as a context variable over here:
"os": host_type.ostype, |
if you wanted to allow something like [download.all(os=darwin, arch=arm)]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, ty for the input.
Do you prefer that we allow linux to download the ARM binaries instead of compiling it?
I'll revert the changes for windows/darwin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if building it isn't dramatically slower than downloading it, then building seems fine on linux; generally nicer to have fewer conditions in the manifest!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wez ty for your help, I've sent a new version which only compiles cmake on linux. I took the approach for letting the manifest with fewer conditions.
It did not take much time to compile cmake for me. (And I was running on a VM with 1 processor)
However if you prefer that we expose the arch type for the manifest. I can quickly implement this feature.
@cooperlees has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if you could run your python change through black that would be awesome.
- Sorry for not having CI to do this.
@@ -184,6 +184,11 @@ def run_tests( | |||
cmd = ["make"] + self.test_args + self._get_prefix() | |||
self._run_cmd(cmd, env=env) | |||
|
|||
class CMakeBootStrapBuilder(MakeBuilder): | |||
def _build(self, install_dirs, reconfigure): | |||
env = self._compute_env(install_dirs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this meant to be passed somewhere / used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my bad, this can be deleted.
@cooperlees I'll fix the problems tonight. I did not know that you guys were using a linter. I'll fix the linter problems. Btw, I can't see the linter warning via the github CI. since it requires a facebook employee login. Which I'm not. :/ |
Yeah, my bad. I didn't set it up here. One day I will. If you just run |
@cabelitos has updated the pull request. You must reimport the pull request before landing. |
@cooperlees btw, at all. I executed the black linter and also removed the Thank you very much for your support. |
@cabelitos has updated the pull request. You must reimport the pull request before landing. |
Prior to this patch it was not possible to run open/r on linux running on ARM due to cmake and openssl being harded to download/compile for the x86_64 arch. In order to prevent such problem this patch actively compiles cmake instead of using pre-compiled binaries and also allows the OpenSSLBuilder to provide the correct build args to openssl, thus not trying to compile or run x86_64 software.
@cabelitos has updated the pull request. You must reimport the pull request before landing. |
@cabelitos has updated the pull request. You must reimport the pull request before landing. |
I guess that the "update branch" button created a merge commit :/ |
@cooperlees has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
did i break something? :[ |
Yes, trying to workout what / how
My lack of cmake skills make this non obvious. |
@cooperlees Maybe these tips can help you:
The whole build flow worked on my VM. |
Yeah, sorry about this. I haven't had time to dig in. I will try rebase it internally, and just fix and land. |
@cooperlees np at all. please let me know if you need help. |
Looking into this today:
Let me know if you can spot it. |
Summary: Description: Prior to this patch it was not possible to run open/r on linux running on ARM due to cmake and openssl being harded to download/compile for the x86_64 arch. In order to prevent such problem this patch actively compiles cmake instead of using pre-compiled binaries and also allows the OpenSSLBuilder to provide the correct build args to openssl, thus not trying to compile or run x86_64 software. Pull Request resolved: facebook/openr#95 Test Plan: * built the project by using ./build/build_openr.sh Reviewed By: wez Differential Revision: D28224684 Pulled By: cooperlees fbshipit-source-id: 9de61dc6d7dcf7116ec5c67f3f165cd4a4bb5e5c
This pull request has been merged in 752a556. |
This pull request has been merged in b744723. |
Summary: Description: Prior to this patch it was not possible to run open/r on linux running on ARM due to cmake and openssl being harded to download/compile for the x86_64 arch. In order to prevent such problem this patch actively compiles cmake instead of using pre-compiled binaries and also allows the OpenSSLBuilder to provide the correct build args to openssl, thus not trying to compile or run x86_64 software. Pull Request resolved: facebook/openr#95 Test Plan: * built the project by using ./build/build_openr.sh Reviewed By: wez Differential Revision: D28224684 Pulled By: cooperlees fbshipit-source-id: 9de61dc6d7dcf7116ec5c67f3f165cd4a4bb5e5c
Summary: Description: Prior to this patch it was not possible to run open/r on linux running on ARM due to cmake and openssl being harded to download/compile for the x86_64 arch. In order to prevent such problem this patch actively compiles cmake instead of using pre-compiled binaries and also allows the OpenSSLBuilder to provide the correct build args to openssl, thus not trying to compile or run x86_64 software. Pull Request resolved: facebook/openr#95 Test Plan: * built the project by using ./build/build_openr.sh Reviewed By: wez Differential Revision: D28224684 Pulled By: cooperlees fbshipit-source-id: 9de61dc6d7dcf7116ec5c67f3f165cd4a4bb5e5c
Summary: Description: Prior to this patch it was not possible to run open/r on linux running on ARM due to cmake and openssl being harded to download/compile for the x86_64 arch. In order to prevent such problem this patch actively compiles cmake instead of using pre-compiled binaries and also allows the OpenSSLBuilder to provide the correct build args to openssl, thus not trying to compile or run x86_64 software. Pull Request resolved: facebook/openr#95 Test Plan: * built the project by using ./build/build_openr.sh Reviewed By: wez Differential Revision: D28224684 Pulled By: cooperlees fbshipit-source-id: 9de61dc6d7dcf7116ec5c67f3f165cd4a4bb5e5c
Summary: Description: Prior to this patch it was not possible to run open/r on linux running on ARM due to cmake and openssl being harded to download/compile for the x86_64 arch. In order to prevent such problem this patch actively compiles cmake instead of using pre-compiled binaries and also allows the OpenSSLBuilder to provide the correct build args to openssl, thus not trying to compile or run x86_64 software. Pull Request resolved: facebook/openr#95 Test Plan: * built the project by using ./build/build_openr.sh Reviewed By: wez Differential Revision: D28224684 Pulled By: cooperlees fbshipit-source-id: 9de61dc6d7dcf7116ec5c67f3f165cd4a4bb5e5c
Summary: Description: Prior to this patch it was not possible to run open/r on linux running on ARM due to cmake and openssl being harded to download/compile for the x86_64 arch. In order to prevent such problem this patch actively compiles cmake instead of using pre-compiled binaries and also allows the OpenSSLBuilder to provide the correct build args to openssl, thus not trying to compile or run x86_64 software. Pull Request resolved: facebook/openr#95 Test Plan: * built the project by using ./build/build_openr.sh Reviewed By: wez Differential Revision: D28224684 Pulled By: cooperlees fbshipit-source-id: 9de61dc6d7dcf7116ec5c67f3f165cd4a4bb5e5c
Summary: Description: Prior to this patch it was not possible to run open/r on linux running on ARM due to cmake and openssl being harded to download/compile for the x86_64 arch. In order to prevent such problem this patch actively compiles cmake instead of using pre-compiled binaries and also allows the OpenSSLBuilder to provide the correct build args to openssl, thus not trying to compile or run x86_64 software. Pull Request resolved: facebook/openr#95 Test Plan: * built the project by using ./build/build_openr.sh Reviewed By: wez Differential Revision: D28224684 Pulled By: cooperlees fbshipit-source-id: 9de61dc6d7dcf7116ec5c67f3f165cd4a4bb5e5c
Summary: Description: Prior to this patch it was not possible to run open/r on linux running on ARM due to cmake and openssl being harded to download/compile for the x86_64 arch. In order to prevent such problem this patch actively compiles cmake instead of using pre-compiled binaries and also allows the OpenSSLBuilder to provide the correct build args to openssl, thus not trying to compile or run x86_64 software. Pull Request resolved: facebook/openr#95 Test Plan: * built the project by using ./build/build_openr.sh Reviewed By: wez Differential Revision: D28224684 Pulled By: cooperlees fbshipit-source-id: 9de61dc6d7dcf7116ec5c67f3f165cd4a4bb5e5c
Summary: Description: Prior to this patch it was not possible to run open/r on linux running on ARM due to cmake and openssl being harded to download/compile for the x86_64 arch. In order to prevent such problem this patch actively compiles cmake instead of using pre-compiled binaries and also allows the OpenSSLBuilder to provide the correct build args to openssl, thus not trying to compile or run x86_64 software. Pull Request resolved: facebook/openr#95 Test Plan: * built the project by using ./build/build_openr.sh Reviewed By: wez Differential Revision: D28224684 Pulled By: cooperlees fbshipit-source-id: 9de61dc6d7dcf7116ec5c67f3f165cd4a4bb5e5c
Summary: Description: Prior to this patch it was not possible to run open/r on linux running on ARM due to cmake and openssl being harded to download/compile for the x86_64 arch. In order to prevent such problem this patch actively compiles cmake instead of using pre-compiled binaries and also allows the OpenSSLBuilder to provide the correct build args to openssl, thus not trying to compile or run x86_64 software. Pull Request resolved: facebook/openr#95 Test Plan: * built the project by using ./build/build_openr.sh Reviewed By: wez Differential Revision: D28224684 Pulled By: cooperlees fbshipit-source-id: 9de61dc6d7dcf7116ec5c67f3f165cd4a4bb5e5c
Summary: Description: Prior to this patch it was not possible to run open/r on linux running on ARM due to cmake and openssl being harded to download/compile for the x86_64 arch. In order to prevent such problem this patch actively compiles cmake instead of using pre-compiled binaries and also allows the OpenSSLBuilder to provide the correct build args to openssl, thus not trying to compile or run x86_64 software. Pull Request resolved: facebook/openr#95 Test Plan: * built the project by using ./build/build_openr.sh Reviewed By: wez Differential Revision: D28224684 Pulled By: cooperlees fbshipit-source-id: 9de61dc6d7dcf7116ec5c67f3f165cd4a4bb5e5c
Summary: Description: Prior to this patch it was not possible to run open/r on linux running on ARM due to cmake and openssl being harded to download/compile for the x86_64 arch. In order to prevent such problem this patch actively compiles cmake instead of using pre-compiled binaries and also allows the OpenSSLBuilder to provide the correct build args to openssl, thus not trying to compile or run x86_64 software. Pull Request resolved: facebook/openr#95 Test Plan: * built the project by using ./build/build_openr.sh Reviewed By: wez Differential Revision: D28224684 Pulled By: cooperlees fbshipit-source-id: 9de61dc6d7dcf7116ec5c67f3f165cd4a4bb5e5c
Summary: Description: Prior to this patch it was not possible to run open/r on linux running on ARM due to cmake and openssl being harded to download/compile for the x86_64 arch. In order to prevent such problem this patch actively compiles cmake instead of using pre-compiled binaries and also allows the OpenSSLBuilder to provide the correct build args to openssl, thus not trying to compile or run x86_64 software. Pull Request resolved: facebook/openr#95 Test Plan: * built the project by using ./build/build_openr.sh Reviewed By: wez Differential Revision: D28224684 Pulled By: cooperlees fbshipit-source-id: 9de61dc6d7dcf7116ec5c67f3f165cd4a4bb5e5c
Summary: Description: Prior to this patch it was not possible to run open/r on linux running on ARM due to cmake and openssl being harded to download/compile for the x86_64 arch. In order to prevent such problem this patch actively compiles cmake instead of using pre-compiled binaries and also allows the OpenSSLBuilder to provide the correct build args to openssl, thus not trying to compile or run x86_64 software. Pull Request resolved: #95 Test Plan: * built the project by using ./build/build_openr.sh Reviewed By: wez Differential Revision: D28224684 Pulled By: cooperlees fbshipit-source-id: 9de61dc6d7dcf7116ec5c67f3f165cd4a4bb5e5c
Summary: Description: Prior to this patch it was not possible to run open/r on linux running on ARM due to cmake and openssl being harded to download/compile for the x86_64 arch. In order to prevent such problem this patch actively compiles cmake instead of using pre-compiled binaries and also allows the OpenSSLBuilder to provide the correct build args to openssl, thus not trying to compile or run x86_64 software. Pull Request resolved: facebook/openr#95 Test Plan: * built the project by using ./build/build_openr.sh Reviewed By: wez Differential Revision: D28224684 Pulled By: cooperlees fbshipit-source-id: 9de61dc6d7dcf7116ec5c67f3f165cd4a4bb5e5c
@cooperlees the only thing that I can think of is permissions or full disk. |
Btw, ty very much for merging! |
Thanks for contributing, sorry it took me so long to dig into what we needed internally. Was caching the new tar to stop transient download failures and lints … error was very misleading. |
Summary: Description: Prior to this patch it was not possible to run open/r on linux running on ARM due to cmake and openssl being harded to download/compile for the x86_64 arch. In order to prevent such problem this patch actively compiles cmake instead of using pre-compiled binaries and also allows the OpenSSLBuilder to provide the correct build args to openssl, thus not trying to compile or run x86_64 software. Pull Request resolved: facebook/openr#95 Test Plan: * built the project by using ./build/build_openr.sh Reviewed By: wez Differential Revision: D28224684 Pulled By: cooperlees fbshipit-source-id: 9de61dc6d7dcf7116ec5c67f3f165cd4a4bb5e5c
Description:
Prior to this patch it was not possible to run open/r on linux running on ARM due to cmake and openssl being harded to download/compile for the x86_64 arch.
In order to prevent such problem this patch actively compiles cmake instead of using pre-compiled binaries and also allows the OpenSSLBuilder to provide the correct build args to openssl, thus not trying to compile or run x86_64 software.
Test Plan: