-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from gonzojive/repo-mapping
Include repo_mapping in output of pkg_with_runfiles tarball.
- Loading branch information
Showing
19 changed files
with
401 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
exports_files(["message.txt"], visibility = ["//visibility:public"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module( | ||
name = "data1fork", | ||
version = "0.1", | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hello, fork |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
# For why, see | ||
# https://gist.github.com/mohanpedala/1e2ff5661761d3abd0385e8223e16425 | ||
set -euxo pipefail | ||
|
||
cd rooty | ||
bazel build //:rooty_packaged | ||
|
||
# Create a temporary directory | ||
temp_dir=$(mktemp -d) | ||
|
||
# Ensure cleanup of the temporary directory on exit | ||
trap 'rm -rf "$temp_dir"' EXIT | ||
|
||
# Copy the tar file to the temporary directory | ||
cp "bazel-bin/rooty_packaged.tar" "$temp_dir/" | ||
|
||
# Extract the tar file | ||
tar -xf "$temp_dir/rooty_packaged.tar" -C "$temp_dir" | ||
|
||
# Run the program | ||
"$temp_dir/foo/program" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
load("@gazelle//:def.bzl", "gazelle") | ||
load("@rules_go//go:def.bzl", "go_binary", "go_library") | ||
|
||
# gazelle:prefix example.com/rooty | ||
gazelle(name = "gazelle") | ||
|
||
go_library( | ||
name = "rooty_lib", | ||
srcs = ["main.go"], | ||
data = ["@data1_from_rooty//:message.txt"], | ||
importpath = "example.com/rooty", | ||
visibility = ["//visibility:private"], | ||
deps = ["@rules_go//go/runfiles:go_default_library"], | ||
) | ||
|
||
go_binary( | ||
name = "rooty", | ||
embed = [":rooty_lib"], | ||
visibility = ["//visibility:public"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
module( | ||
name = "userofdata1", | ||
version = "0.1", | ||
) | ||
|
||
bazel_dep(name = "pkg_with_runfiles", version = "0.1") | ||
bazel_dep(name = "data1", version = "0.1", repo_name = "data1_from_userofdata1") | ||
local_path_override( | ||
module_name = "data1", | ||
path = "../data1", | ||
) | ||
|
||
local_path_override( | ||
module_name = "pkg_with_runfiles", | ||
path = "../../..", | ||
) | ||
|
||
# The following is necessary to set up Go for the test binary. | ||
|
||
bazel_dep(name = "rules_go", version = "0.50.1") | ||
bazel_dep(name = "gazelle", version = "0.39.1") | ||
|
||
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk") | ||
|
||
# Download an SDK for the host OS & architecture as well as common remote execution platforms. | ||
go_sdk.download(version = "1.23.1") | ||
|
||
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps") | ||
go_deps.from_file(go_mod = "//:go.mod") |
Oops, something went wrong.