mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04: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
361b409eb2
commit
fb735419ac
@ -67,7 +67,9 @@ oci_image(
|
||||
entrypoint = ["/start.sh"],
|
||||
os = "linux",
|
||||
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",
|
||||
],
|
||||
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_pkg//:pkg.bzl", "pkg_tar")
|
||||
load("//bazel/go:platform.bzl", "platform_binary")
|
||||
load("//bazel/patchelf:patchelf.bzl", "patchelf")
|
||||
|
||||
go_library(
|
||||
name = "qemu-metadata-api_lib",
|
||||
@ -29,18 +30,26 @@ go_binary(
|
||||
|
||||
platform_binary(
|
||||
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",
|
||||
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(
|
||||
name = "layer",
|
||||
srcs = [
|
||||
":qemu_metadata_api_linux_amd64",
|
||||
":qemu_metadata_api_patched",
|
||||
],
|
||||
mode = "0755",
|
||||
remap_paths = {"/platform:linux_amd64_gnu.2.23": "/server"},
|
||||
remap_paths = {"/qemu_metadata_api_with_nix_rpath": "/server"},
|
||||
)
|
||||
|
||||
oci_image(
|
||||
@ -49,7 +58,7 @@ oci_image(
|
||||
entrypoint = ["/server"],
|
||||
os = "linux",
|
||||
tars = [
|
||||
"//rpm:libvirt-devel",
|
||||
"@libvirt_x86_64-linux//:closure.tar",
|
||||
":layer",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
|
Loading…
Reference in New Issue
Block a user