mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-02-10 20:18:46 -05:00
bazel: provide runtime dependencies of libvirt where needed
This adds nix store paths to container images that have binaries linking against libvirt from nix.
This commit is contained in:
parent
05f94b4c46
commit
284c460ed0
@ -67,7 +67,9 @@ oci_image(
|
|||||||
entrypoint = ["/start.sh"],
|
entrypoint = ["/start.sh"],
|
||||||
os = "linux",
|
os = "linux",
|
||||||
tars = [
|
tars = [
|
||||||
"//rpm:containerized-libvirt",
|
# TODO(malt3): test if libvirt works before merging this change!!!
|
||||||
|
"@libvirt_x86_64-linux//:closure.tar",
|
||||||
|
"@libvirt_x86_64-linux//:bin-linktree.tar",
|
||||||
":start",
|
":start",
|
||||||
],
|
],
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
|
@ -2,6 +2,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
|||||||
load("@rules_oci//oci:defs.bzl", "oci_image")
|
load("@rules_oci//oci:defs.bzl", "oci_image")
|
||||||
load("@rules_pkg//:pkg.bzl", "pkg_tar")
|
load("@rules_pkg//:pkg.bzl", "pkg_tar")
|
||||||
load("//bazel/go:platform.bzl", "platform_binary")
|
load("//bazel/go:platform.bzl", "platform_binary")
|
||||||
|
load("//bazel/patchelf:patchelf.bzl", "patchelf")
|
||||||
|
|
||||||
go_library(
|
go_library(
|
||||||
name = "qemu-metadata-api_lib",
|
name = "qemu-metadata-api_lib",
|
||||||
@ -29,18 +30,26 @@ go_binary(
|
|||||||
|
|
||||||
platform_binary(
|
platform_binary(
|
||||||
name = "qemu_metadata_api_linux_amd64",
|
name = "qemu_metadata_api_linux_amd64",
|
||||||
platform = "@zig_sdk//libc_aware/platform:linux_amd64_gnu.2.23",
|
platform = "//bazel/platforms:constellation_os",
|
||||||
target_file = ":qemu-metadata-api",
|
target_file = ":qemu-metadata-api",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
patchelf(
|
||||||
|
name = "qemu_metadata_api_patched",
|
||||||
|
src = ":qemu_metadata_api_linux_amd64",
|
||||||
|
out = "qemu_metadata_api_with_nix_rpath",
|
||||||
|
interpreter = "@libvirt_x86_64-linux//:dynamic-linker",
|
||||||
|
rpath = "@libvirt_x86_64-linux//:rpath",
|
||||||
|
)
|
||||||
|
|
||||||
pkg_tar(
|
pkg_tar(
|
||||||
name = "layer",
|
name = "layer",
|
||||||
srcs = [
|
srcs = [
|
||||||
":qemu_metadata_api_linux_amd64",
|
":qemu_metadata_api_patched",
|
||||||
],
|
],
|
||||||
mode = "0755",
|
mode = "0755",
|
||||||
remap_paths = {"/platform:linux_amd64_gnu.2.23": "/server"},
|
remap_paths = {"/qemu_metadata_api_with_nix_rpath": "/server"},
|
||||||
)
|
)
|
||||||
|
|
||||||
oci_image(
|
oci_image(
|
||||||
@ -49,7 +58,7 @@ oci_image(
|
|||||||
entrypoint = ["/server"],
|
entrypoint = ["/server"],
|
||||||
os = "linux",
|
os = "linux",
|
||||||
tars = [
|
tars = [
|
||||||
"//rpm:libvirt-devel",
|
"@libvirt_x86_64-linux//:closure.tar",
|
||||||
":layer",
|
":layer",
|
||||||
],
|
],
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user