Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • bazel/rules_git
1 result
Show changes
Commits on Source (9)
Showing with 2641 additions and 3415 deletions
......@@ -16,6 +16,9 @@ common --show_timestamps
# Do not wrap any output
common --terminal_columns=0
# Print relative paths where possible to reduce noise
common --attempt_to_print_relative_paths
# Output as much information in the CI log about failures as possible
build --verbose_failures
......@@ -26,5 +29,36 @@ test --test_output=errors
test --test_verbose_timeout_warnings
# These locations are cached on the CI
build --disk_cache=${CI_PROJECT_DIR}/.cache/bazel/disk
build --repository_cache=${CI_PROJECT_DIR}/.cache/bazel/repo
build:local --disk_cache=${CI_PROJECT_DIR}/.cache/bazel/disk
build:local --repository_cache=${CI_PROJECT_DIR}/.cache/bazel/repo
# Use remote cache/execution for our builds
build:remote --remote_executor=${CI_REMOTE_EXECUTOR}
build:remote --remote_cache=${CI_REMOTE_CACHE}
build:remote --remote_timeout=3600
build:remote --remote_header=${CI_REMOTE_HEADER}
build:remote --experimental_remote_cache_compression
build:remote --jobs=${CI_REMOTE_JOBS}
# Upload results to the Build Event Service
build:remote --bes_results_url=${CI_BES_RESULTS_URL}
build:remote --bes_backend=${CI_BES_BACKEND}
# Add build metadata
build:remote --build_metadata=REPO_URL=${CI_PROJECT_URL}
build:remote --build_metadata=BRANCH_NAME=${CI_COMMIT_REF_NAME}
build:remote --build_metadata=COMMIT_SHA=${CI_COMMIT_SHA}
build:remote --build_metadata=HOST=${CI_SERVER_HOST}
build:remote --build_metadata=ROLE=CI
build:remote --build_metadata=USER=gitlab-ci
# Provide detailed timing information to the remote executor
build:remote --noslim_profile
build:remote --experimental_profile_include_target_label
build:remote --experimental_profile_include_primary_output
# Eliminate duplicate references in the Build Event Stream
build:remote --nolegacy_important_outputs
# TODO: remove this when `bazel/ape` binaries work on remote execution `arm64` instances
build:remote --host_platform=@toolchain_utils//toolchain/platform:amd64-linux-gnu
include:
- component: "${CI_SERVER_HOST}/ci/component/bazelisk/bazelisk@v1.0.0-beta.2"
- component: "${CI_SERVER_HOST}/ci/component/bazelisk/bazelisk@v1.0.0-beta.3"
inputs:
variables: |
CI_PROJECT_DIR
CI_PROJECT_ID
CI_REMOTE_EXECUTOR
CI_REMOTE_CACHE
CI_REMOTE_HEADER
CI_REMOTE_JOBS
CI_BES_RESULTS_URL
CI_BES_BACKEND
CI_PROJECT_URL
CI_COMMIT_REF_NAME
CI_COMMIT_SHA
CI_SERVER_HOST
default:
tags:
......@@ -10,8 +24,13 @@ test:
parallel:
matrix:
- ROOT:
- .
- e2e
- .
- e2e
CONFIG:
- local
- remote
script:
- cd "${ROOT}"; bazelisk test --config="${CONFIG}" //...
# TODO: switch this out for `rules_semantic_release`
semantic-release:
......
# [1.0.0-alpha.2](https://git.gitlab.arm.com/bazel/rules_git/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2024-05-15)
### Bug Fixes
- bump to `rules_coreutils@1.0.0-alpha.8` ([9a11de5](https://git.gitlab.arm.com/bazel/rules_git/commit/9a11de50d461d08768f7200c862c180a183cb781))
- upgrade to use `toolchain_info` ([62519b5](https://git.gitlab.arm.com/bazel/rules_git/commit/62519b50040bce9b543508eac40d0a5eeaa9d2ce))
# 1.0.0-alpha.1 (2024-04-23)
### Bug Fixes
......
module(
name = "rules_git",
version = "1.0.0-alpha.1",
version = "1.0.0-alpha.2",
bazel_compatibility = [
">=7.1.0",
],
......@@ -8,9 +8,9 @@ module(
)
bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "toolchain_utils", version = "1.0.0-beta.4")
bazel_dep(name = "toolchain_utils", version = "1.0.0-beta.9")
bazel_dep(name = "download_utils", version = "1.0.0-beta.2")
bazel_dep(name = "rules_coreutils", version = "1.0.0-alpha.6")
bazel_dep(name = "rules_coreutils", version = "1.0.0-beta.1")
download_file = use_repo_rule("@download_utils//download/file:defs.bzl", "download_file")
......
This diff is collapsed.
......@@ -16,6 +16,9 @@ common --show_timestamps
# Do not wrap any output
common --terminal_columns=0
# Print relative paths where possible to reduce noise
common --attempt_to_print_relative_paths
# Output as much information in the CI log about failures as possible
build --verbose_failures
......@@ -26,5 +29,36 @@ test --test_output=errors
test --test_verbose_timeout_warnings
# These locations are cached on the CI
build --disk_cache=${CI_PROJECT_DIR}/.cache/bazel/disk
build --repository_cache=${CI_PROJECT_DIR}/.cache/bazel/repo
build:local --disk_cache=${CI_PROJECT_DIR}/.cache/bazel/disk
build:local --repository_cache=${CI_PROJECT_DIR}/.cache/bazel/repo
# Use remote cache/execution for our builds
build:remote --remote_executor=${CI_REMOTE_EXECUTOR}
build:remote --remote_cache=${CI_REMOTE_CACHE}
build:remote --remote_timeout=3600
build:remote --remote_header=${CI_REMOTE_HEADER}
build:remote --experimental_remote_cache_compression
build:remote --jobs=${CI_REMOTE_JOBS}
# Upload results to the Build Event Service
build:remote --bes_results_url=${CI_BES_RESULTS_URL}
build:remote --bes_backend=${CI_BES_BACKEND}
# Add build metadata
build:remote --build_metadata=REPO_URL=${CI_PROJECT_URL}
build:remote --build_metadata=BRANCH_NAME=${CI_COMMIT_REF_NAME}
build:remote --build_metadata=COMMIT_SHA=${CI_COMMIT_SHA}
build:remote --build_metadata=HOST=${CI_SERVER_HOST}
build:remote --build_metadata=ROLE=CI
build:remote --build_metadata=USER=gitlab-ci
# Provide detailed timing information to the remote executor
build:remote --noslim_profile
build:remote --experimental_profile_include_target_label
build:remote --experimental_profile_include_primary_output
# Eliminate duplicate references in the Build Event Stream
build:remote --nolegacy_important_outputs
# TODO: remove this when `bazel/ape` binaries work on remote execution `arm64` instances
build:remote --host_platform=@toolchain_utils//toolchain/platform:amd64-linux-gnu
load("@rules_git//placeholder/test:defs.bzl", "placeholder_test")
placeholder_test(
name = "test",
size = "small",
)
......@@ -6,7 +6,8 @@ module(
)
bazel_dep(name = "rules_git", version = "0.0.0")
bazel_dep(name = "rules_diff", version = "1.0.0-alpha.3")
bazel_dep(name = "rules_diff", version = "1.0.0-beta.3")
bazel_dep(name = "toolchain_utils", version = "1.0.0-beta.9", dev_dependency=True)
local_path_override(
module_name = "rules_git",
......
This diff is collapsed.
......@@ -70,12 +70,12 @@ def implementation(ctx):
inputs = ctx.files.dir,
executable = rendered,
tools = [
sort.executable,
chmod.executable,
cp.executable,
ln.executable,
mkdir.executable,
git.executable,
sort.run,
chmod.run,
cp.run,
ln.run,
mkdir.run,
git.run,
],
arguments = [args],
mnemonic = "GitCheckout",
......
......@@ -44,7 +44,7 @@ def implementation(ctx):
outputs = [dir],
inputs = ctx.files.srcs,
executable = rendered,
tools = [cp.executable],
tools = [cp.run],
arguments = [args],
mnemonic = "GitDir",
progress_message = "Creating `.git` directory: %{output}",
......
load("@toolchain_utils//toolchain/symlink/target:defs.bzl", "toolchain_symlink_target")
load("@toolchain_utils//toolchain/info:defs.bzl", "toolchain_info")
load("@toolchain_utils//toolchain/test:defs.bzl", "toolchain_test")
toolchain_type(
......@@ -20,9 +20,8 @@ toolchain(
[
(
toolchain_symlink_target(
toolchain_info(
name = "{}-{}-bazel-git".format(cpu, os),
basename = "git",
target = "@{}-{}-bazel-git//:entrypoint".format(cpu, os),
),
toolchain(
......
load("//placeholder/test:rule.bzl", "placeholder_test")
placeholder_test(
name = "placeholder",
size = "small",
)
load("//placeholder/test:rule.bzl", _test = "test")
visibility("public")
placeholder_test = _test
Hello, world!
exports_files(["posix.tmpl.sh"])
load(":rule.bzl", _test = "test")
visibility("public")
placeholder_test = _test
#! /bin/sh
# Strict shell
set -o errexit -o nounset
# Bazel substitutions
CODE="{{code}}"
readonly CODE
# Simple!
exit "${CODE}"
visibility("//...")
ATTRS = {
"code": attr.int(
doc = "The exit code for the test.",
default = 0,
),
"template": attr.label(
doc = "The template script to expand.",
allow_single_file = True,
default = ":posix.tmpl.sh",
),
}
DOC = "A simple placeholder test rule."
def implementation(ctx):
executable = ctx.actions.declare_file(ctx.label.name)
ctx.actions.expand_template(
output = executable,
template = ctx.file.template,
substitutions = {
"{{code}}": str(ctx.attr.code),
},
)
return DefaultInfo(
executable = executable,
files = depset([executable]),
runfiles = ctx.runfiles([executable]),
)
placeholder_test = rule(
attrs = ATTRS,
doc = DOC,
implementation = implementation,
test = True,
)
test = placeholder_test