mirror of
https://github.com/urbit/vere.git
synced 2024-09-11 03:45:31 +03:00
158 lines
2.9 KiB
Python
158 lines
2.9 KiB
Python
load("//bazel:common_settings.bzl", "string_flag")
|
|
load("@io_bazel_rules_docker//cc:image.bzl", "cc_image")
|
|
load("@io_bazel_rules_docker//container:container.bzl", "container_push")
|
|
|
|
#
|
|
# OS-CPU CONFIG SETTINGS
|
|
#
|
|
|
|
config_setting(
|
|
name = "linux_arm64",
|
|
constraint_values = [
|
|
"@platforms//os:linux",
|
|
"@platforms//cpu:arm64",
|
|
],
|
|
)
|
|
|
|
config_setting(
|
|
name = "linux_x86_64",
|
|
constraint_values = [
|
|
"@platforms//os:linux",
|
|
"@platforms//cpu:x86_64",
|
|
],
|
|
)
|
|
|
|
config_setting(
|
|
name = "macos_arm64",
|
|
constraint_values = [
|
|
"@platforms//os:macos",
|
|
"@platforms//cpu:arm64",
|
|
],
|
|
)
|
|
|
|
config_setting(
|
|
name = "macos_x86_64",
|
|
constraint_values = [
|
|
"@platforms//os:macos",
|
|
"@platforms//cpu:x86_64",
|
|
],
|
|
)
|
|
|
|
#
|
|
# COMPILERS
|
|
#
|
|
|
|
# Version flag for clang.
|
|
string_flag(
|
|
name = "clang_version",
|
|
# macOS uses `clang-14.0.0` by default.
|
|
build_setting_default = "14.0.0",
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
# Version flag for gcc.
|
|
string_flag(
|
|
name = "gcc_version",
|
|
# musl-cross-make uses `gcc-9.4.0` by default.
|
|
build_setting_default = "9.4.0",
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
# Docker image tag.
|
|
string_flag(
|
|
name = "image_tag",
|
|
build_setting_default = "",
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
#
|
|
# PLATFORMS
|
|
#
|
|
# A platform takes one of two formats: `<compiler>-<os>-<cpu>` or `<os>-<cpu>`
|
|
# if the compiler is unspecified.
|
|
|
|
# Linux arm64 platform with unspecified compiler.
|
|
platform(
|
|
name = "linux-arm64",
|
|
constraint_values = [
|
|
"@platforms//os:linux",
|
|
"@platforms//cpu:arm64",
|
|
],
|
|
)
|
|
|
|
# Linux x86_64 platform with unspecified compiler.
|
|
platform(
|
|
name = "linux-x86_64",
|
|
constraint_values = [
|
|
"@platforms//os:linux",
|
|
"@platforms//cpu:x86_64",
|
|
],
|
|
)
|
|
|
|
# Linux x86_64 platform with gcc.
|
|
platform(
|
|
name = "gcc-linux-x86_64",
|
|
constraint_values = [
|
|
":gcc",
|
|
"@platforms//os:linux",
|
|
"@platforms//cpu:x86_64",
|
|
],
|
|
)
|
|
|
|
platform(
|
|
name = "macos-arm64",
|
|
constraint_values = [
|
|
"@platforms//os:macos",
|
|
"@platforms//cpu:arm64",
|
|
],
|
|
)
|
|
|
|
platform(
|
|
name = "clang-macos-arm64",
|
|
constraint_values = [
|
|
":clang",
|
|
"@platforms//os:macos",
|
|
"@platforms//cpu:arm64",
|
|
],
|
|
)
|
|
|
|
platform(
|
|
name = "macos-x86_64",
|
|
constraint_values = [
|
|
"@platforms//os:macos",
|
|
"@platforms//cpu:x86_64",
|
|
],
|
|
)
|
|
|
|
platform(
|
|
name = "clang-macos-x86_64",
|
|
constraint_values = [
|
|
":clang",
|
|
"@platforms//os:macos",
|
|
"@platforms//cpu:x86_64",
|
|
],
|
|
)
|
|
|
|
alias(
|
|
name = "urbit",
|
|
actual = "//pkg/vere:urbit",
|
|
)
|
|
|
|
#
|
|
# DOCKER IMAGE
|
|
#
|
|
|
|
cc_image(
|
|
name = "docker",
|
|
binary = "//pkg/vere:urbit",
|
|
)
|
|
|
|
container_push(
|
|
name = "upload_docker",
|
|
format = "Docker",
|
|
image = ":docker",
|
|
registry = "docker.io",
|
|
repository = "tloncorp/vere-test",
|
|
tag = "//:image_tag",
|
|
)
|