constellation/disk-mapper/cmd/BUILD.bazel

66 lines
1.9 KiB
Python
Raw Normal View History

load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
2023-09-11 09:46:02 -04:00
load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("//bazel/go:platform.bzl", "platform_binary")
load("//bazel/patchelf:patchelf.bzl", "patchelf")
go_library(
name = "cmd_lib",
srcs = ["main.go"],
importpath = "github.com/edgelesssys/constellation/v2/disk-mapper/cmd",
visibility = ["//visibility:private"],
deps = [
"//disk-mapper/internal/diskencryption",
"//disk-mapper/internal/recoveryserver",
"//disk-mapper/internal/rejoinclient",
"//disk-mapper/internal/setup",
"//internal/attestation/choose",
"//internal/attestation/tdx",
"//internal/attestation/variant",
"//internal/attestation/vtpm",
"//internal/cloud/aws",
"//internal/cloud/azure",
"//internal/cloud/cloudprovider",
"//internal/cloud/gcp",
"//internal/cloud/metadata",
"//internal/cloud/openstack",
"//internal/cloud/qemu",
"//internal/constants",
"//internal/grpc/dialer",
"//internal/kms/setup",
"//internal/logger",
"//internal/role",
"@com_github_spf13_afero//:afero",
],
)
go_binary(
name = "cmd",
embed = [":cmd_lib"],
visibility = ["//visibility:public"],
)
platform_binary(
name = "disk-mapper_linux_amd64",
platform = "//bazel/platforms:constellation_os",
target_file = ":cmd",
visibility = ["//visibility:public"],
)
2023-09-11 09:46:02 -04:00
patchelf(
name = "disk-mapper_patched",
src = ":disk-mapper_linux_amd64",
out = "disk-mapper_with_nix_rpath",
interpreter = "@cryptsetup_x86_64-linux//:dynamic-linker",
rpath = "@cryptsetup_x86_64-linux//:rpath",
)
2023-09-11 09:46:02 -04:00
pkg_tar(
name = "disk-mapper-package",
srcs = [
":disk-mapper_patched",
2023-09-11 09:46:02 -04:00
],
mode = "0755",
remap_paths = {"/disk-mapper_with_nix_rpath": "/usr/sbin/disk-mapper"},
2023-09-11 09:46:02 -04:00
visibility = ["//visibility:public"],
)