Skip to content

Conversation

@jwnrt
Copy link
Contributor

@jwnrt jwnrt commented Jan 27, 2026

Replaces uses of @// and @lowrisc_opentitan// with //. The first form references the root module when OpenTitan is used as a dependency, which is not what we want. The second form is fine but longer than necessary.

These refer to the root module which may not be OpenTitan when used as
a dependency. All of these labels should refer to the *current* module
so I have updated them to `//`.

Signed-off-by: James Wainwright <james.wainwright@lowrisc.org>
Naming the current module is not necessary, `//` will select the current
module.

Signed-off-by: James Wainwright <james.wainwright@lowrisc.org>

return select({
"@lowrisc_opentitan//hw/top:is_{}".format(top): obj
"//hw/top:is_{}".format(top): obj
Copy link
Contributor

@pamaury pamaury Jan 28, 2026

Choose a reason for hiding this comment

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

This @lowrisc_opentitan here is useful because this file may end up getting imported in other repositories (if we ever managed to make the repo fully use-able as a dependency). In a .bzl file, the local labels refer to the repository of the BUILD file importing it, not the repository to which the .bzl file belongs.

tops = [tops]
for top in tops:
branches["@lowrisc_opentitan//hw/top:is_{}".format(top)] = value
branches["//hw/top:is_{}".format(top)] = value
Copy link
Contributor

@pamaury pamaury Jan 28, 2026

Choose a reason for hiding this comment

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

Same, applies to the whole file.

@@ -9,17 +9,17 @@ DARJEELING_OTP_SIGVERIFY_FAKE_KEYS = [
# Additional overlays can be applied on top to further customize the OTP.
# This set of overlays does not include any of the SECRET[0-2] partitions.
DARJEELING_STD_OTP_OVERLAYS_WITHOUT_SECRET_PARTITIONS = DARJEELING_OTP_SIGVERIFY_FAKE_KEYS + [
Copy link
Contributor

@pamaury pamaury Jan 28, 2026

Choose a reason for hiding this comment

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

I am not entirely sure but I think due to the way those defs.bzl files end-up being imported by the multi-top build system, switching that to @lowrisc_opentitan would be more correct. This applies to any construct which ends up in the opentitan_top declaration.

runtime_deps = [
"@//sw/device/silicon_creator/lib/cert:asn1",
"@//sw/device/silicon_creator/lib/cert:template",
"//sw/device/silicon_creator/lib/cert:asn1",
Copy link
Contributor

@pamaury pamaury Jan 28, 2026

Choose a reason for hiding this comment

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

If this is used out of tree (which would make sense), this needs to be @lowrisc_opentitan. Same for the rest of the file.

@pamaury
Copy link
Contributor

pamaury commented Jan 28, 2026

I have left some comments but they are probably incomplete. Essentially any .bzl file which may potentially be imported by another repository (if we support fully the repo being a dependency) should probably use @lowrisc_opentitan instead of local labels.

@jwnrt
Copy link
Contributor Author

jwnrt commented Jan 28, 2026

Oh, I see, when .bzl files are loaded their // refers to the module which loaded them? I will have to look at that commit again.

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.

2 participants