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

Add amd64 arch #43

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add amd64 arch #43

wants to merge 2 commits into from

Conversation

mexicarne
Copy link

In FreeBSD x86_64 is known as amd64

~% uname -p
amd64

In FreeBSD x86_64 is known as amd64

~% uname -p
amd64
@google-cla
Copy link

google-cla bot commented Aug 4, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@aiuto aiuto self-requested a review October 4, 2022 17:37
@aiuto aiuto assigned aiuto and mexicarne and unassigned aiuto Oct 4, 2022
Copy link
Contributor

@aiuto aiuto left a comment

Choose a reason for hiding this comment

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

In FreeBSD x86_64 is known as amd64

Yeech. I think this needs some discussion. For most people x86_64 == amd64. I don't want to force toolchain authors to now have to account amd64 just to work on freebsd. Perhaps the right thing to do is have bazel do the mapping to x86_64 correctly.

Can you clarify what problem you are trying to solve by adding this?
Have you tried other workarounds to not having it?
Have you tried with amd64 as an alias to x86_64, rather than a distinct label.

@mexicarne
Copy link
Author

mexicarne commented Oct 10, 2022

In FreeBSD x86_64 is known as amd64

Yeech. I think this needs some discussion. For most people x86_64 == amd64. I don't want to force toolchain authors to now have to account amd64 just to work on freebsd. Perhaps the right thing to do is have bazel do the mapping to x86_64 correctly.

Can you clarify what problem you are trying to solve by adding this? Have you tried other workarounds to not having it? Have you tried with amd64 as an alias to x86_64, rather than a distinct label.

Sorry for delay. My point to introduce this change is to allow natively build projects with bazel on FreeBSD. For example, I'm trying to build python binding for selenium (https://github.com/SeleniumHQ/selenium) like this:

~/Downloads/selenium-trunk% bazel build //py:selenium
Starting local Bazel server and connecting to it...
INFO: Repository python_toolchain instantiated at:
  /usr/home/user/Downloads/selenium-trunk/WORKSPACE:71:27: in <toplevel>
  /usr/home/user/.cache/bazel/_bazel_user/fa3feb297ac7d465d01b5b481c081747/external/rules_python/python/repositories.bzl:320:34: in python_register_toolchains
Repository rule resolved_interpreter_os_alias defined at:
  /usr/home/user/.cache/bazel/_bazel_user/fa3feb297ac7d465d01b5b481c081747/external/rules_python/python/private/toolchains_repo.bzl:124:48: in <toplevel>
ERROR: An error occurred during the fetch of repository 'python_toolchain':
   Traceback (most recent call last):
	File "/usr/home/user/.cache/bazel/_bazel_user/fa3feb297ac7d465d01b5b481c081747/external/rules_python/python/private/toolchains_repo.bzl", line 81, column 13, in _resolved_interpreter_os_alias_impl
		fail("No platform declared for host OS {} on arch {}".format(os_name, arch))
Error in fail: No platform declared for host OS freebsd on arch amd64
ERROR: /usr/home/user/Downloads/selenium-trunk/WORKSPACE:71:27: fetching resolved_interpreter_os_alias rule //external:python_toolchain: Traceback (most recent call last):
	File "/usr/home/user/.cache/bazel/_bazel_user/fa3feb297ac7d465d01b5b481c081747/external/rules_python/python/private/toolchains_repo.bzl", line 81, column 13, in _resolved_interpreter_os_alias_impl
		fail("No platform declared for host OS {} on arch {}".format(os_name, arch))
Error in fail: No platform declared for host OS freebsd on arch amd64
ERROR: no such package '@python_toolchain//': No platform declared for host OS freebsd on arch amd64
INFO: Elapsed time: 2.924s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)

I traced it to bazel-paltforms, that has no mention of amd64. I believe you are right that it should be an alias instead.

@thesayyn
Copy link

This could be an alias instead like

platforms/cpu/BUILD

Lines 35 to 38 in 829cd4b

alias(
name = "aarch64",
actual = ":arm64",
)

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