I think the string to use to adress a package is wrong, e.g //main
Based on the Bazle concept page [1], this would address a target called main in the package main.
So //main is the same as //main:main
Using simply main would be the solution here, but Bazel seems to know only relative path.
So the exact location of main can be calculated only, if the current location (working dir / packages) is known. As far as I have understood, bazel as no character to indicate that a package-path starts on root.
It looks like bazel tests first, if it is a relative path, if not it must start on root level / workspace.
So here is a proposal to label the bazel objects correctly:
- workspace: folder_path (keep as it is)
- package: name (no //, always complete path, no relative paths allowed)
- targets: //package:target (keep as it is, but should support also the shortcuts //name (->//name:name but then we may have problems with rules))
- rules, macro, impl: //package:target:rule (keep as it is, shortcuts are a problem. Maybe do not allow)
- attributes: //package:target:rule:attribute (keep as it is, not shortcuts)
[1] https://docs.bazel.build/versions/master/build-ref.html
I think the string to use to adress a package is wrong, e.g //main
Based on the Bazle concept page [1], this would address a target called main in the package main.
So
//mainis the same as//main:mainUsing simply
mainwould be the solution here, but Bazel seems to know only relative path.So the exact location of
maincan be calculated only, if the current location (working dir / packages) is known. As far as I have understood, bazel as no character to indicate that a package-path starts on root.It looks like bazel tests first, if it is a relative path, if not it must start on root level / workspace.
So here is a proposal to label the bazel objects correctly:
[1] https://docs.bazel.build/versions/master/build-ref.html