Skip to content
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

fix: Use js_binary in macro in external repository #1342

Conversation

mvgijssel
Copy link
Contributor


Type of change

  • Bug fix (change which fixes an issue)

Test plan

  • Manual testing; please provide instructions so we can reproduce:

In vgijssel/setup#601 I tried using js_binary from within a macro called release_manager which was located in the rules_release workspace. The rules_release macro was called from the main workspace which resulted in the following error:

ERROR: Analysis of target '//:release_manager' failed; build aborted: no such package '@[unknown repo 'aspect_rules_js' requested from @]//js': The repository '@[unknown repo 'aspect_rules_js' requested from @]' could not be resolved: No repository visible as '@aspect_rules_js' from main repository
INFO: Elapsed time: 0.188s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)
ERROR: Build failed. Not running target

After asking in the Bazel community https://bazelbuild.slack.com/archives/C014RARENH0/p1698918118051159 @fmeum found the issue: the js_binary is a macro which uses labels which are not wrapped in the Label class, causing them to be scoped to the main repository. Wrapping these labels with Label class fixes the issue.

@CLAassistant
Copy link

CLAassistant commented Nov 3, 2023

CLA assistant check
All committers have signed the CLA.

@jbedard jbedard merged commit dfd8268 into aspect-build:main Nov 9, 2023
90 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants