Skip to content

Commit

Permalink
archive: use library's name for archive name (bazelbuild#2652)
Browse files Browse the repository at this point in the history
If a custom Go rule generates more than one library, or otherwise
changes the name of the GoLibrary, the emitted archive will still have
the _ctx.label.name. To deconflict, use the library's name as the
emitted archive's name.

Signed-off-by: Chris Koch <chrisko@google.com>
  • Loading branch information
hugelgupf committed Sep 14, 2020
1 parent 1424377 commit 970c719
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions go/private/actions/archive.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ def emit_archive(go, source = None, _recompile_suffix = ""):
pre_ext = ".external"
if _recompile_suffix:
pre_ext += _recompile_suffix
out_lib = go.declare_file(go, ext = pre_ext + ".a")
out_lib = go.declare_file(go, name = source.library.name, ext = pre_ext + ".a")

# store __.PKGDEF and nogo facts in .x
out_export = go.declare_file(go, ext = pre_ext + ".x")
out_export = go.declare_file(go, name = source.library.name, ext = pre_ext + ".x")
out_cgo_export_h = None # set if cgo used in c-shared or c-archive mode

direct = [get_archive(dep) for dep in source.deps]
Expand Down

0 comments on commit 970c719

Please sign in to comment.