diff --git a/3rdparty/tools/act/.actrc b/3rdparty/tools/act/.actrc index 5c08277ae70..10685d4c411 100644 --- a/3rdparty/tools/act/.actrc +++ b/3rdparty/tools/act/.actrc @@ -1 +1 @@ --P ubuntu-latest=catthehacker/ubuntu:act-latest +-P ubuntu-latest=catthehacker/ubuntu:act-latest \ No newline at end of file diff --git a/3rdparty/tools/act/BUILD b/3rdparty/tools/act/BUILD index 60ec99cace6..00b48fa7677 100644 --- a/3rdparty/tools/act/BUILD +++ b/3rdparty/tools/act/BUILD @@ -61,4 +61,4 @@ run_shell_command( command="XDG_CONFIG_DIRS=${CHROOT}:$XDG_CONFIG_DIRS {chroot}/act $@", workdir="/", execution_dependencies=[":act-at-root"], -) +) \ No newline at end of file diff --git a/3rdparty/tools/gh/BUILD b/3rdparty/tools/gh/BUILD deleted file mode 100644 index 619c08fd354..00000000000 --- a/3rdparty/tools/gh/BUILD +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright 2023 Pants project contributors (see CONTRIBUTORS.md). -# Licensed under the Apache License, Version 2.0 (see LICENSE). - -# Targets for running the GitHub CLI (or `gh`): https://cli.github.com/ -# Use `pants run 3rdparty/tools/gh -- ` - -file( - name="downloaded-gh", - source=per_platform( - macos_x86_64=http_source( - url="https://github.com/cli/cli/releases/download/v2.32.0/gh_2.32.0_macOS_amd64.zip", - len=10957234, - sha256="e6dd7cb61338c6aab27dfc744bf74817f26a938e505a8e817316513ebf02eb57", - filename="gh.archive", - ), - macos_arm64=http_source( - url="https://github.com/cli/cli/releases/download/v2.32.0/gh_2.32.0_macOS_arm64.zip", - len=10318229, - sha256="6df08a326a4c00e6d33f49c458402c8a3921fd71a2f3187ce77ddb6c452d73f0", - filename="gh.archive", - ), - linux_x86_64=http_source( - url="https://github.com/cli/cli/releases/download/v2.32.0/gh_2.32.0_linux_amd64.tar.gz", - len=10315710, - sha256="2e306f118a46764bc1763bacc52e7b18eeca5aa6fd59d2b5fd260f0ef3cd87ae", - filename="gh.archive", - ), - linux_arm64=http_source( - url="https://github.com/cli/cli/releases/download/v2.32.0/gh_2.32.0_linux_arm64.tar.gz", - len=9410807, - sha256="9eff1eb5d13a3fa858859bd2995077f8987a89d352548a3c116af0536f49afc0", - filename="gh.archive", - ), - ), -) - -shell_source( - name="extract.sh", - source="extract.sh", -) - -shell_command( - name="extracted-gh", - command="./extract.sh", - tools=["tar", "gzip", "zip", "mv", "mkdir", "bash"], - execution_dependencies=[":downloaded-gh", ":extract.sh"], - output_directories=["gh"], -) - -relocated_files( - name="relocated-gh", - files_targets=[":extracted-gh"], - src="3rdparty/tools/gh/gh", - dest="3rdparty/tools/gh", -) - -run_shell_command( - name="gh", - command="{chroot}/3rdparty/tools/gh/bin/gh", - execution_dependencies=[":relocated-gh"], -) diff --git a/3rdparty/tools/gh/extract.sh b/3rdparty/tools/gh/extract.sh deleted file mode 100755 index 53a983f253b..00000000000 --- a/3rdparty/tools/gh/extract.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -set -eu - -mkdir tmp -unzip gh.archive -d tmp || tar -xzf gh.archive -C tmp -mv tmp/* gh/ diff --git a/3rdparty/tools/protoc/BUILD b/3rdparty/tools/protoc/BUILD deleted file mode 100644 index a9fea0eb186..00000000000 --- a/3rdparty/tools/protoc/BUILD +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2023 Pants project contributors (see CONTRIBUTORS.md). -# Licensed under the Apache License, Version 2.0 (see LICENSE). - -file( - name="compressed-protoc", - source=per_platform( - linux_arm64=http_source( - url="https://github.com/protocolbuffers/protobuf/releases/download/v24.3/protoc-24.3-linux-aarch_64.zip", - len=2971115, - sha256="77a5a41f3e9712af6a35de13143b9b2b77f075aa1ab18a63cca4483b30f6e3cd", - filename="protoc.zip", - ), - linux_x86_64=http_source( - url="https://github.com/protocolbuffers/protobuf/releases/download/v24.3/protoc-24.3-linux-x86_64.zip", - len=3005508, - sha256="fc793561283d9ea6813fb757ae54f1afea6770afcd930904bdf3e590910420aa", - filename="protoc.zip", - ), - macos_arm64=http_source( - url="https://github.com/protocolbuffers/protobuf/releases/download/v24.3/protoc-24.3-osx-aarch_64.zip", - len=2089053, - sha256="cca53adb73a6686dd60bb3b0da33961e6b9dab1f833c851b5e1bb7b5df02b36f", - filename="protoc.zip", - ), - macos_x86_64=http_source( - url="https://github.com/protocolbuffers/protobuf/releases/download/v24.3/protoc-24.3-osx-x86_64.zip", - len=2121387, - sha256="13b45cdcde9b2101e982de897d5490cfd81dfa181605749c23982379ba0e3288", - filename="protoc.zip", - ), - ), -) - -shell_command( - name="protoc", - command="unzip protoc.zip -d protoc", - tools=["unzip"], - execution_dependencies=[":compressed-protoc"], - output_directories=["protoc"], -) diff --git a/3rdparty/tools/python3/BUILD b/3rdparty/tools/python3/BUILD deleted file mode 100644 index 5a3a0a6150b..00000000000 --- a/3rdparty/tools/python3/BUILD +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2023 Pants project contributors (see CONTRIBUTORS.md). -# Licensed under the Apache License, Version 2.0 (see LICENSE). - -file( - name="compressed-python-build-standalone-3.9", - source=per_platform( - linux_arm64=http_source( - url="https://github.com/astral-sh/python-build-standalone/releases/download/20230507/cpython-3.9.16+20230507-aarch64-unknown-linux-gnu-install_only.tar.gz", - len=23583066, - sha256="f629b75ebfcafe9ceee2e796b7e4df5cf8dbd14f3c021afca078d159ab797acf", - filename="python-build-standalone.tar.gz", - ), - linux_x86_64=http_source( - url="https://github.com/astral-sh/python-build-standalone/releases/download/20230507/cpython-3.9.16+20230507-x86_64-unknown-linux-gnu-install_only.tar.gz", - len=25738357, - sha256="2b6e146234a4ef2a8946081fc3fbfffe0765b80b690425a49ebe40b47c33445b", - filename="python-build-standalone.tar.gz", - ), - macos_arm64=http_source( - url="https://github.com/astral-sh/python-build-standalone/releases/download/20230507/cpython-3.9.16+20230507-aarch64-apple-darwin-install_only.tar.gz", - len=16634170, - sha256="c1de1d854717a6245f45262ef1bb17b09e2c587590e7e3f406593c143ff875bd", - filename="python-build-standalone.tar.gz", - ), - macos_x86_64=http_source( - url="https://github.com/astral-sh/python-build-standalone/releases/download/20230507/cpython-3.9.16+20230507-x86_64-apple-darwin-install_only.tar.gz", - len=16908516, - sha256="3abc4d5fbbc80f5f848f280927ac5d13de8dc03aabb6ae65d8247cbb68e6f6bf", - filename="python-build-standalone.tar.gz", - ), - ), -) - -shell_command( - name="python3", - command="tar -xzf python-build-standalone.tar.gz", - tools=["tar", "gzip"], - execution_dependencies=[":compressed-python-build-standalone-3.9"], - output_directories=["python"], -) diff --git a/3rdparty/tools/rust/BUILD b/3rdparty/tools/rust/BUILD deleted file mode 100644 index 89e2ef526a7..00000000000 --- a/3rdparty/tools/rust/BUILD +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright 2023 Pants project contributors (see CONTRIBUTORS.md). -# Licensed under the Apache License, Version 2.0 (see LICENSE). - -file( - name="rustup-init", - source=per_platform( - linux_arm64=http_source( - url="https://static.rust-lang.org/rustup/archive/1.26.0/aarch64-unknown-linux-gnu/rustup-init", - len=14131368, - sha256="673e336c81c65e6b16dcdede33f4cc9ed0f08bde1dbe7a935f113605292dc800", - ), - linux_x86_64=http_source( - url="https://static.rust-lang.org/rustup/archive/1.26.0/x86_64-unknown-linux-gnu/rustup-init", - len=14293176, - sha256="0b2f6c8f85a3d02fde2efc0ced4657869d73fccfce59defb4e8d29233116e6db", - ), - macos_arm64=http_source( - url="https://static.rust-lang.org/rustup/archive/1.26.0/aarch64-apple-darwin/rustup-init", - len=8000713, - sha256="ed299a8fe762dc28161a99a03cf62836977524ad557ad70e13882d2f375d3983", - ), - macos_x86_64=http_source( - url="https://static.rust-lang.org/rustup/archive/1.26.0/x86_64-apple-darwin/rustup-init", - len=8670640, - sha256="f6d1a9fac1a0d0802d87c254f02369a79973bc8c55aa0016d34af4fcdbd67822", - ), - ), -) - -shell_command( - name="cargo-shim", - command=""" - chmod +x rustup-init - ./rustup-init --no-modify-path --no-update-default-toolchain --profile minimal --default-toolchain none -y - """, - extra_env_vars=["RUSTUP_HOME=dummy", "CARGO_HOME=shims"], - tools=["chmod"], - execution_dependencies=[":rustup-init"], - output_directories=["shims/bin"], -) - -shell_command( - name="cargo", - command=""" - mv ../../../src/rust/rust-toolchain rust-toolchain - ./shims/bin/rustup set profile minimal - ./shims/bin/cargo version - mv toolchains/* cargo - """, - extra_env_vars=["RUSTUP_HOME=."], - tools=["mv"], - execution_dependencies=[ - ":cargo-shim", - "src/rust:rust-toolchain", - ], - output_directories=["cargo"], - timeout=600, -) diff --git a/src/rust/BUILD b/src/rust/BUILD deleted file mode 100644 index 28601540c62..00000000000 --- a/src/rust/BUILD +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright 2023 Pants project contributors (see CONTRIBUTORS.md). -# Licensed under the Apache License, Version 2.0 (see LICENSE). - -files( - name="rust_sources", - sources=[ - "Cargo.lock", - "build.rs", - "VERSION", - "**/Cargo.toml", - "**/*.rs", - "!**/*tests.rs", - "**/*.proto", - ".cargo/config.toml", - ], -) - -file( - name="rust-toolchain", - source="rust-toolchain", -) - -_RELTYPE_FLAG = "" if env("MODE") == "debug" else "--release" - -shell_command( - name="engine-and-client", - command=f""" - PATH="${{PATH}}:{{chroot}}/3rdparty/tools/python3/python/bin"; - PATH="${{PATH}}:{{chroot}}/3rdparty/tools/protoc/protoc/bin"; - PATH="${{PATH}}:{{chroot}}/3rdparty/tools/rust/cargo/bin"; - - cargo build {_RELTYPE_FLAG} --features=extension-module -p engine -p client - """, - execution_dependencies=[ - ":rust_sources", - "3rdparty/tools/protoc:protoc", - "3rdparty/tools/python3:python3", - "3rdparty/tools/rust:cargo", - ], - tools=["bash", "cc", "ld", "as", "ar"], - output_files=[ - f"target/debug/libengine.so", - f"target/debug/libengine.dylib", - f"target/debug/pants", - f"target/release/libengine.so", - f"target/release/libengine.dylib", - f"target/release/pants", - ], - timeout=600, -) - -files( - name="all_rust_source_files", - sources=["**/*.rs"], -) - -# NB: This should be in `lint` when we implement `lint` in https://github.com/pantsbuild/pants/issues/17729 -test_shell_command( - name="checks-rust-banned-imports", - command=f""" - BAD_FILES=$(grep -r -l -E "^use std::sync::.*(Mutex|RwLock)" {build_file_dir()}); - if [ -n "$BAD_FILES" ]; then - echo "The following files contained banned \\`std::sync\\` imports (\\`Mutex\\` and \\`RWLock\\`)."; - echo "(Hint: Use the \\`parking_lot::\\` equivalent)"; - echo ""; - echo "$BAD_FILES"; - exit 1; - else - exit 0; - fi - """, - tools=["grep", "echo"], - execution_dependencies=[":all_rust_source_files"], - workdir="/", -)