Skip to content

labels: correct usage #16

@danwos

Description

@danwos

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions