Description of the problem / feature request:
I am trying to get the name of the current repository from a macro.
.
├── a
│ ├── BUILD.bazel
│ ├── WORKSPACE
│ ├── empty.txt
│ └── txt_files.bzl
└── b
├── BUILD.bazel
├── WORKSPACE
└── empty2.txt
(see full example here )
I want that if repo b will call the macro in @a//:txt_files.bzl then somehow I'd be able to retrieve that it was called from repo b.
Right now (not sure if it's a bug or work as intended) - calling native.repository_name() will return @ and not the name of repo as declared in its WORKSPACE file.
Feature requests: what underlying problem are you trying to solve with this feature?
I want to change the behavior of a macro based on the callee repository.
Can we allow native.repository_name() to return the explicit name of the repository and not @? To maintain backward compatibility - I assume it would be better if we add a flag to this method that will be turned off by default.
Description of the problem / feature request:
I am trying to get the name of the current repository from a macro.
(see full example here )
I want that if repo
bwill call the macro in@a//:txt_files.bzlthen somehow I'd be able to retrieve that it was called from repob.Right now (not sure if it's a bug or work as intended) - calling
native.repository_name()will return@and not the name of repo as declared in itsWORKSPACEfile.Feature requests: what underlying problem are you trying to solve with this feature?
I want to change the behavior of a macro based on the callee repository.
Can we allow
native.repository_name()to return the explicit name of the repository and not@? To maintain backward compatibility - I assume it would be better if we add a flag to this method that will be turned off by default.