1
Fork 0

remove @bazel_skylib dependency (again)

This was accidentally included in
d61aab183e434d48783dbaa2fdb9e39714217637
main
Motiejus Jakštys 2023-04-24 10:18:34 +03:00 committed by Motiejus Jakštys
parent 0e12e84103
commit 92067b5d85
2 changed files with 10 additions and 4 deletions

View File

@ -1,8 +1,6 @@
# Copyright 2023 Uber Technologies, Inc.
# Licensed under the MIT License
load("@bazel_skylib//lib:paths.bzl", "paths")
def _platform_transition_impl(settings, attr):
_ignore = settings
return {
@ -19,7 +17,11 @@ _platform_transition = transition(
def _platform_binary_impl(ctx):
platform_sanitized = ctx.attr.platform.replace("/", "_").replace(":", "_")
dst = ctx.actions.declare_file("{}-{}".format(paths.basename(ctx.file.src.path), platform_sanitized))
dstname = "{}-{}".format(
_paths_basename(ctx.file.src.path),
platform_sanitized,
)
dst = ctx.actions.declare_file(dstname)
src = ctx.file.src
ctx.actions.run(
outputs = [dst],
@ -61,3 +63,7 @@ platform_test = rule(
attrs = _attrs,
test = True,
)
## Copied from https://github.com/bazelbuild/bazel-skylib/blob/1.4.1/lib/paths.bzl#L22
def _paths_basename(p):
return p.rpartition("/")[-1]

View File

@ -218,7 +218,7 @@ def _zig_repository_impl(repository_ctx):
print("Launcher compilation failed. Clearing %s/{%s} and retrying" %
(cache_prefix, ",".join(zig_cache_dirs)))
for d in zig_cache_dirs:
repository_ctx.delete(paths.join(cache_prefix, d))
repository_ctx.delete(_paths_join(cache_prefix, d))
ret = repository_ctx.execute(
compile_cmd,