bazel-contrib / bazel-contrib/rules_go

Unable to build using rules_go in my own repo

Open
#3,477 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.5k
Forks
760
Avg merge
1d 11h
Merged PRs (30d)
12

Description

### What version of rules_go are you using?
Same as master branch. I forked to my own repo.

### What version of gazelle are you using?

### What version of Bazel are you using?
6.0.0

### Does this issue reproduce with the latest releases of all the above?

### What operating system and processor architecture are you using?
Mac OS

### Any other potentially useful information about your toolchain?

### What did you do?
I'm trying to contribute to [rules_go](https://github.com/bazelbuild/rules_go), On my local pc, I'm using http_archive to fetch rules from my own repo. Here is a demo [repo](https://github.com/YuanHao97/bazel-17571), Try 'bazel run //:runfiles' then you can see the error message

### What did you expect to see?

Something like this: /private/var/tmp/_bazel_yh/54a82a2cd277eb13b8a17e535157729f/external/go_sdk/bin/gofmt.

### What did you see instead?
ERROR: Error computing the main repository mapping: Every .bzl file must have a corresponding package, but '@io_bazel_rules_go//go:deps.bzl' does not have one. Please create a BUILD file in the same or any parent directory. Note that this BUILD file does not need to do anything except exist.

Contributor guide

Open the contributing guide

Research direction

Start with the linked demo repository and run `bazel run //:runfiles` on Bazel 6.0.0 to reproduce the repository-mapping error. Inspect the WORKSPACE `http_archive` setup for the forked rules and compare it with the expected rules_go layout. Done means the command builds and reports the gofmt path instead of the missing BUILD-file error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.