Skip to content

Commit

Permalink
Drop workspace mode
Browse files Browse the repository at this point in the history
we will not support workspace mode for those consuming this rules
  • Loading branch information
manuelnaranjo committed Jun 21, 2024
1 parent 2cf92a6 commit 6ef4cda
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ jobs:
{"bazelversion": "6.4.0", folder: "."},
{ folder: ".", "os": "macos-latest"},
{ folder: ".", "os": "windows-latest"},
{ folder: ".", bzlmodEnabled: false}
{ bzlmodEnabled: false}
]
14 changes: 1 addition & 13 deletions .github/workflows/release_prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,5 @@ bazel_dep(name = "com_booking_rules_patchelf_prebuilt", version = "${TAG:1}")
## Using WORKSPACE
Paste this snippet into your \`WORKSPACE.bazel\` file:
\`\`\`starlark
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "com_booking_rules_patchelf_prebuilt",
sha256 = "${SHA}",
strip_prefix = "${PREFIX}",
url = "https://github.com/bookingcom/rules_patchelf_prebuilt/releases/download/${TAG}/${ARCHIVE}",
)
WORKSPACE mode is not supported
EOF

awk 'f;/--SNIP--/{f=1}' e2e/smoke/WORKSPACE.bazel
echo "\`\`\`"
1 change: 0 additions & 1 deletion WORKSPACE.bazel

This file was deleted.

19 changes: 0 additions & 19 deletions e2e/smoke/WORKSPACE.bazel

This file was deleted.

2 changes: 0 additions & 2 deletions e2e/smoke/WORKSPACE.bzlmod

This file was deleted.

24 changes: 1 addition & 23 deletions patchelf_prebuilt/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,11 @@ These are needed for local dev, and users must install them as well.
See https://docs.bazel.build/versions/main/skylark/deploying.html#dependencies
"""

load("@bazel_tools//tools/build_defs/repo:http.bzl", _http_archive = "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load("//patchelf_prebuilt:version.bzl", "VERSION")
load("//patchelf_prebuilt/platforms:platforms.bzl", "PLATFORMS")
load("//patchelf_prebuilt/private:integrity.bzl", "RELEASED_BINARY_INTEGRITY")
load("//patchelf_prebuilt/private:toolchains_repo.bzl", "toolchains_repo")

def http_archive(name, **kwargs):
maybe(_http_archive, name = name, **kwargs)

# WARNING: any changes in this function may be BREAKING CHANGES for users
# because we'll fetch a dependency which may be different from one that
# they were previously fetching later in their WORKSPACE setup, and now
# ours took precedence. Such breakages are challenging for users, so any
# changes in this function should be marked as BREAKING in the commit message
# and released only in semver majors.
# This is all fixed by bzlmod, so we just tolerate it for now.
def rules_patchelf_prebuilt_dependencies():
# The minimal version of bazel_skylib we require
http_archive(
name = "bazel_skylib",
sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f",
urls = [
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz",
],
)

########
# Remaining content of the file is only used to support toolchains.
########
Expand Down Expand Up @@ -99,6 +76,7 @@ def patchelf_prebuilt_register_toolchains(name, register = True, **kwargs):
patchelf_prebuilt_repositories(
name = name + "_" + platform,
platform = platform,
patchelf_prebuilt_version = patchelf_prebuilt_version,
**kwargs
)
if register:
Expand Down
6 changes: 5 additions & 1 deletion tools/patchelf_sources.bzl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"Creates repositories that can build patchelf for different versions from upstream"

load("@//patchelf_prebuilt:repositories.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:http.bzl", _http_archive = "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

VERSIONS = {
"0.14.5": {
Expand All @@ -9,6 +10,9 @@ VERSIONS = {
},
}

def http_archive(name, **kwargs):
maybe(_http_archive, name = name, **kwargs)

def _patchelf_sources_extension(module_ctx):
repos = []

Expand Down

0 comments on commit 6ef4cda

Please sign in to comment.