Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelnaranjo committed Jul 15, 2024
1 parent 94e552e commit 3f51d00
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
7 changes: 5 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@ docs/*.md linguist-generated=true
# see https://git-scm.com/docs/git-archive/2.40.0#ATTRIBUTES
# Exclude a bunch of paths to save some disk space
e2e export-ignore
.aspect
.github
.aspect export-ignore
.github export-ignore
pkg/*/testdata export-ignore
tools/release export-ignore

14 changes: 6 additions & 8 deletions .github/workflows/integrity.jq
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@
# NB: the sha256 files are expected to be newline-terminated.
#
# Input looks like
# 48552e399a1f2ab97e62ca7fce5783b6214e284330c7555383f43acf82446636 bazeldnf_linux-amd64\nfd265552bfd236efef519f81ce783322a50d8d7ab5af5d08a713e519cedff87f bazeldnf_linux-arm64\n
# 48552e399a1f2ab97e62ca7fce5783b6214e284330c7555383f43acf82446636 bazeldnf-v0.6.0-rc7-linux-amd64\n...
#
# Output should look like
# {
# "bazeldnf_linux-amd64": "48552e399a1f2ab97e62ca7fce5783b6214e284330c7555383f43acf82446636",
# "bazeldnf_linux-x86_64": "fd265552bfd236efef519f81ce783322a50d8d7ab5af5d08a713e519cedff87f"
# "linux-amd64": "48552e399a1f2ab97e62ca7fce5783b6214e284330c7555383f43acf82446636",
# ...
# }

.
# Don't end with an empty object
| sub($ARGS.named.PREFIX; ""; "g")
| rtrimstr("\n")
| split("\n")
| map(
split(" ")
| {"key": .[1], "value": .[0]}
)
| map(split(" "))
| map({"key": .[1], "value": .[0]})
| from_entries
3 changes: 2 additions & 1 deletion .github/workflows/release_prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ PREFIX=$PREFIX ${SCRIPT_DIR}/generate_tools_versions.sh

PREBUILTS=$(jq \
--from-file .github/workflows/integrity.jq \
--arg PREFIX "bazeldnf-${GITHUB_REF_NAME}-" \
--slurp \
--raw-input artifacts/*.sha256 \
)

cat >${PREFIX}/tools/integrity.bzl <<EOF
"Generated during release by release_prep.sh, using integrity.jq"
PREBUILTS = "${PREBUILTS}"
PREBUILTS = ${PREBUILTS}
EOF

Expand Down
5 changes: 2 additions & 3 deletions bazeldnf/extensions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ based on: https://github.com/bazel-contrib/rules-template/blob/0dadcb716f06f6728
"""

load("@bazel_features//:features.bzl", "bazel_features")
load("//bazeldnf/private:toolchains_repo.bzl", "toolchains_repo")
load("//internal:rpm.bzl", rpm_repository = "rpm")
load(":repositories.bzl", "bazeldnf_register_toolchains")

Expand Down Expand Up @@ -38,7 +37,7 @@ _proxy_repo = repository_rule(

_DEFAULT_NAME = "bazeldnf"

def _handle_rpms(alias, mod, module_ctx):
def _handle_rpms(alias, mod):
if not mod.tags.rpm:
return {}

Expand Down Expand Up @@ -98,7 +97,7 @@ def _toolchain_extension(module_ctx):
alias = _alias.name
dev_dependency = _alias.dev_dependency

rpms = _handle_rpms(alias, mod, module_ctx)
rpms = _handle_rpms(alias, mod)
if rpms:
if not dev_dependency:
repos[alias] = 1
Expand Down
2 changes: 1 addition & 1 deletion bazeldnf/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file", _http_archive
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load("//bazeldnf/private:toolchains_repo.bzl", "toolchains_repo")
load("//tools:integrity.bzl", "PREBUILTS")
load("//tools:version.bzl", "VERSION", "REPO_URL")
load("//tools:version.bzl", "REPO_URL", "VERSION")
load(":platforms.bzl", "PLATFORMS")

def http_archive(name, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion tools/version.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"Generated during release generate_tools_prebuilts.sh"

VERSION = "v0.6.0-rc6"
VERSION = "v0.5.9"

REPO_URL = "rmohr/bazeldnf"

0 comments on commit 3f51d00

Please sign in to comment.