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

feat: add support for compiling open/r on 64-bit arm linux #95

Closed
wants to merge 2 commits into from

Conversation

cabelitos
Copy link
Contributor

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:

  • built the project by using ./build/build_openr.sh

@@ -11,30 +11,17 @@ cmake
[dependencies]
ninja

[download.os=windows]
Copy link
Contributor

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!

Copy link
Contributor Author

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).

Copy link
Contributor Author

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.

Copy link
Contributor

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)]

Copy link
Contributor Author

@cabelitos cabelitos May 3, 2021

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

Copy link
Contributor

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!

Copy link
Contributor Author

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.

@facebook-github-bot
Copy link
Contributor

@cooperlees has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@cooperlees cooperlees left a 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)
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@cabelitos
Copy link
Contributor Author

cabelitos commented May 5, 2021

@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. :/

@cooperlees
Copy link
Contributor

@cooperlees I'll fix the problems tonight. I did not know that you guys were using a linter. I'll make the create the setup.

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 black over the .py files it should auto fix all the linter errors. If not, I'll fix them post merge due to me sucking and not having CI running the linter here.

@facebook-github-bot
Copy link
Contributor

@cabelitos has updated the pull request. You must reimport the pull request before landing.

@cabelitos
Copy link
Contributor Author

@cooperlees btw, at all. I executed the black linter and also removed the env = self._compute_env(install_dirs)

Thank you very much for your support.

@facebook-github-bot
Copy link
Contributor

@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.
@facebook-github-bot
Copy link
Contributor

@cabelitos has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@cabelitos has updated the pull request. You must reimport the pull request before landing.

@cabelitos
Copy link
Contributor Author

I guess that the "update branch" button created a merge commit :/

@facebook-github-bot
Copy link
Contributor

@cooperlees has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@cabelitos
Copy link
Contributor Author

did i break something? :[

@cooperlees
Copy link
Contributor

Yes, trying to workout what / how

CMake Error at cmake_install.cmake:559 (file):
  file INSTALL cannot copy file
  "/data/sandcastle/temp/fbcode_builder_getdeps/build/openr/rib_policy_test"
  to
  "/data/sandcastle/temp/fbcode_builder_getdeps/installed/openr/sbin/tests/openr/decision/rib_policy_test".
FAILED: CMakeFiles/install.util 

My lack of cmake skills make this non obvious.

@cabelitos
Copy link
Contributor Author

cabelitos commented May 11, 2021

@cooperlees Maybe these tips can help you:

  • is this any space left on the disk?
  • did you check the permissions for the /data/sandcastle/temp/fbcode_builder_getdeps/installed/openr/sbin/tests/openr/decision/rib_policy_test folder?

The whole build flow worked on my VM.

@cooperlees
Copy link
Contributor

Yeah, sorry about this. I haven't had time to dig in. I will try rebase it internally, and just fix and land.

@cabelitos
Copy link
Contributor Author

@cooperlees np at all. please let me know if you need help.

@cooperlees
Copy link
Contributor

@cooperlees np at all. please let me know if you need help.

Looking into this today:

CMake Error at cmake_install.cmake:559 (file):
  file INSTALL cannot copy file
  "/data/sandcastle/temp/fbcode_builder_getdeps/build/openr/rib_policy_test"
  to
  "/data/sandcastle/temp/fbcode_builder_getdeps/installed/openr/sbin/tests/openr/decision/rib_policy_test".
FAILED: CMakeFiles/install.util

Let me know if you can spot it.

facebook-github-bot pushed a commit to facebookincubator/reindeer that referenced this pull request Jun 1, 2021
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
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 752a556.

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in b744723.

facebook-github-bot pushed a commit to rsocket/rsocket-cpp that referenced this pull request Jun 1, 2021
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
facebook-github-bot pushed a commit to facebook/fb303 that referenced this pull request Jun 1, 2021
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
facebook-github-bot pushed a commit to facebook/wangle that referenced this pull request Jun 1, 2021
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
facebook-github-bot pushed a commit to facebookincubator/katran that referenced this pull request Jun 1, 2021
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
facebook-github-bot pushed a commit to facebookarchive/bistro that referenced this pull request Jun 1, 2021
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
facebook-github-bot pushed a commit to facebook/sapling that referenced this pull request Jun 1, 2021
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
facebook-github-bot pushed a commit to facebook/fbthrift that referenced this pull request Jun 1, 2021
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
facebook-github-bot pushed a commit to facebook/mvfst that referenced this pull request Jun 1, 2021
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
facebook-github-bot pushed a commit to facebookincubator/below that referenced this pull request Jun 1, 2021
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
facebook-github-bot pushed a commit to facebook/fboss that referenced this pull request Jun 1, 2021
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
facebook-github-bot pushed a commit to facebookexperimental/rust-shed that referenced this pull request Jun 1, 2021
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
facebook-github-bot pushed a commit to facebook/watchman that referenced this pull request Jun 1, 2021
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
facebook-github-bot pushed a commit that referenced this pull request Jun 1, 2021
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
facebook-github-bot pushed a commit to facebook/proxygen that referenced this pull request Jun 1, 2021
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
@cabelitos
Copy link
Contributor Author

@cooperlees the only thing that I can think of is permissions or full disk.

@cabelitos
Copy link
Contributor Author

Btw, ty very much for merging!

@cooperlees
Copy link
Contributor

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.

facebook-github-bot pushed a commit to facebook/folly that referenced this pull request Jun 27, 2021
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants