From 1ffaa8009a7cf5516011f6c8e07277a885dea43d Mon Sep 17 00:00:00 2001 From: michaelschiff Date: Sat, 9 Dec 2023 14:43:55 -0800 Subject: [PATCH 1/6] include runfiles on pkg_tar --- lang/go.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/lang/go.bzl b/lang/go.bzl index 7592aa40..73288b30 100644 --- a/lang/go.bzl +++ b/lang/go.bzl @@ -25,6 +25,7 @@ def go_image( pkg_tar( name = name + "_tar", srcs = [":" + name + "_binary"], + include_runfiles = True, visibility = visibility, ) oci_image( From d1a2b30e835c9f124f90dd6430c4c341e7755520 Mon Sep 17 00:00:00 2001 From: michaelschiff Date: Sat, 9 Dec 2023 14:53:53 -0800 Subject: [PATCH 2/6] strip_prefix --- lang/go.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/lang/go.bzl b/lang/go.bzl index 73288b30..7a805fcb 100644 --- a/lang/go.bzl +++ b/lang/go.bzl @@ -27,6 +27,7 @@ def go_image( srcs = [":" + name + "_binary"], include_runfiles = True, visibility = visibility, + strip_prefix = ".", ) oci_image( name = name, From d353972ad635762b84aed812d56a08356fb84403 Mon Sep 17 00:00:00 2001 From: michaelschiff Date: Sat, 9 Dec 2023 15:01:55 -0800 Subject: [PATCH 3/6] symlinks --- lang/go.bzl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lang/go.bzl b/lang/go.bzl index 7a805fcb..0d295a36 100644 --- a/lang/go.bzl +++ b/lang/go.bzl @@ -10,6 +10,7 @@ def go_image( goos = "linux", gotags = ["containers_image_openpgp"], pure = "on", + symlinks = {}, base = "@go_image_static", visibility = ["//visibility:public"]): """Emulate syntax of rules_gitops go_image.""" @@ -27,7 +28,7 @@ def go_image( srcs = [":" + name + "_binary"], include_runfiles = True, visibility = visibility, - strip_prefix = ".", + symlinks = symlinks, ) oci_image( name = name, From aa598aa6374e4e088077a92f7467da3b1da221fe Mon Sep 17 00:00:00 2001 From: michaelschiff Date: Sat, 9 Dec 2023 15:07:36 -0800 Subject: [PATCH 4/6] package dir --- lang/go.bzl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/go.bzl b/lang/go.bzl index 0d295a36..bc3f8aa1 100644 --- a/lang/go.bzl +++ b/lang/go.bzl @@ -10,7 +10,7 @@ def go_image( goos = "linux", gotags = ["containers_image_openpgp"], pure = "on", - symlinks = {}, + package_dir = "", base = "@go_image_static", visibility = ["//visibility:public"]): """Emulate syntax of rules_gitops go_image.""" @@ -28,12 +28,12 @@ def go_image( srcs = [":" + name + "_binary"], include_runfiles = True, visibility = visibility, - symlinks = symlinks, + package_dir = package_dir, ) oci_image( name = name, base = base, - entrypoint = ["/" + name + "_binary"], + entrypoint = ["/" + package_dir + name + "_binary"], tars = [":" + name + "_tar"] + tars, visibility = visibility, ) From ecd24cf535caf5cd6fc455e80b686ebce96b778e Mon Sep 17 00:00:00 2001 From: michaelschiff Date: Sat, 9 Dec 2023 15:09:46 -0800 Subject: [PATCH 5/6] strip_prefix --- lang/go.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/lang/go.bzl b/lang/go.bzl index bc3f8aa1..9d74316c 100644 --- a/lang/go.bzl +++ b/lang/go.bzl @@ -29,6 +29,7 @@ def go_image( include_runfiles = True, visibility = visibility, package_dir = package_dir, + strip_prefix = ".", ) oci_image( name = name, From 189d46c48479acf2804509c7258cb93336ab7c86 Mon Sep 17 00:00:00 2001 From: michaelschiff Date: Sat, 9 Dec 2023 15:14:32 -0800 Subject: [PATCH 6/6] name --- lang/go.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/go.bzl b/lang/go.bzl index 9d74316c..73790c82 100644 --- a/lang/go.bzl +++ b/lang/go.bzl @@ -34,7 +34,7 @@ def go_image( oci_image( name = name, base = base, - entrypoint = ["/" + package_dir + name + "_binary"], + entrypoint = ["/" + package_dir + name + "_binary_/" + name + "_binary"], tars = [":" + name + "_tar"] + tars, visibility = visibility, )