-
Notifications
You must be signed in to change notification settings - Fork 28
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
Bazel build ERROR on ubuntu #21
Comments
Thanks for letting me know, Andrea!
I can confirm that this appears to be a bazel 7.x problem. I checked the
Google internal code base to see whether anything changed around
__workspace_dir__ but it didn't appear so. Nevertheless, something is off.
I'm also reading that WORKSPACE will be deprecated in version 8.x and
beyond. Fun ;-)
I will check whether your change works with the older versions of bazel and
if it does I'll change the default (and will give you credit on the github
:-)
Thanks again!
Robert
…On Sat, Jan 6, 2024 at 7:16 AM Andrea Novellini ***@***.***> wrote:
I am using Linux Ubuntu 22.04.3 LTS (WSL 2) on a windows 11 machine and I
have python 3.10, numpy 1.26.3 and bazel 7.0.0 installed.
I modified the WORKSPACE script according to my path to python and numpy,
which are respectively:
/usr/include/python3.10
/usr/local/lib/python3.10/dist-packages/numpy/core/
However, when I go in qcc/src/lib and try to build using bazel build all
I got this error:
ERROR: /home/username/qcc/WORKSPACE:1:21: //external:third_party_python:
invalid label '/home/username/qcc/python.BUILD' in attribute 'build_file'
in 'new_local_repository' rule: invalid target name
'/home/username/qcc/python.BUILD': target names may not start with '/'
ERROR: /home/username/qcc/WORKSPACE:8:21: //external:third_party_numpy:
invalid label '/home/username/qcc/numpy.BUILD' in attribute 'build_file' in
'new_local_repository' rule: invalid target name
'/home/username/qcc/numpy.BUILD': target names may not start with '/'
ERROR: Error computing the main repository mapping: Encountered error
while reading extension file 'toolchains/jdk_build_file.bzl': no such
package '@@rules_java_builtin//toolchains': error loading package
'external': Could not load //external package
SOLUTION
My solution was the following:
- in the main folder qcc, create a folder called external:
- move python.BUILD and numpy.BUILD from qcc to qcc/external
- then modify the WORKSPACE script as follows:
new_local_repository(
name = "third_party_python",
build_file = "//external:python.BUILD",
path = "/usr/include/python3.10",
)
new_local_repository(
name = "third_party_numpy",
build_file = "//external:numpy.BUILD",
path = "/usr/local/lib/python3.10/dist-packages/numpy/core/",
)
This solved the issue for me.
Hope this was helpful, have a greate day :)
—
Reply to this email directly, view it on GitHub
<#21>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABEWY3BWTGZDAZ2S7RIVJJTYNFTD3AVCNFSM6AAAAABBPTYYDOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGA3DQNRXGU4DGNA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
Robert Hundt
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am using Linux Ubuntu 22.04.3 LTS (WSL 2) on a windows 11 machine and I have python 3.10, numpy 1.26.3 and bazel 7.0.0 installed.
I modified the WORKSPACE script according to my path to python and numpy, which are respectively:
/usr/include/python3.10
/usr/local/lib/python3.10/dist-packages/numpy/core/
However, when I go in qcc/src/lib and try to build using
bazel build all
I got this error:ERROR: /home/username/qcc/WORKSPACE:1:21: //external:third_party_python: invalid label '/home/username/qcc/python.BUILD' in attribute 'build_file' in 'new_local_repository' rule: invalid target name '/home/username/qcc/python.BUILD': target names may not start with '/'
ERROR: /home/username/qcc/WORKSPACE:8:21: //external:third_party_numpy: invalid label '/home/username/qcc/numpy.BUILD' in attribute 'build_file' in 'new_local_repository' rule: invalid target name '/home/username/qcc/numpy.BUILD': target names may not start with '/'
ERROR: Error computing the main repository mapping: Encountered error while reading extension file 'toolchains/jdk_build_file.bzl': no such package '@@rules_java_builtin//toolchains': error loading package 'external': Could not load //external package
SOLUTION
My solution was the following:
qcc
, create a folder calledexternal
:python.BUILD
andnumpy.BUILD
fromqcc
toqcc/external
WORKSPACE
script as follows:This solved the issue for me.
Hope this was helpful, have a greate day :)
The text was updated successfully, but these errors were encountered: