theoremlp / rules_multitool

Bazel rules for ergonomic tool definitions
Apache License 2.0
24 stars 6 forks source link

multitool cli within lockfile does not work #39

Closed farcop closed 5 months ago

farcop commented 5 months ago

multitool.lock.json

{
  "$schema": "https://raw.githubusercontent.com/theoremlp/rules_multitool/main/lockfile.schema.json",
  "multitool": {
    "binaries": [
      {
        "kind": "archive",
        "url": "https://github.com/theoremlp/multitool/releases/download/v0.4.0/multitool-aarch64-unknown-linux-gnu.tar.xz",
        "file": "multitool",
        "sha256": "e5be39ed4eb9f04c1e7715a6342210c4fc0a5ea6ee00988120bad8f675a15357",
        "os": "linux",
        "cpu": "arm64"
      },
      {
        "kind": "archive",
        "url": "https://github.com/theoremlp/multitool/releases/download/v0.4.0/multitool-x86_64-unknown-linux-gnu.tar.xz",
        "file": "multitool",
        "sha256": "e0c5ef585e0e9116f3e7fb1a9af67ab9c87c53522f216001f36ce4184273f138",
        "os": "linux",
        "cpu": "x86_64"
      },
      {
        "kind": "archive",
        "url": "https://github.com/theoremlp/multitool/releases/download/v0.4.0/multitool-aarch64-apple-darwin.tar.xz",
        "file": "multitool",
        "sha256": "3a7f8f6e054c81d407db356f9954873c43bb923b50ae84f01c414ba7fad69912",
        "os": "macos",
        "cpu": "arm64"
      },
      {
        "kind": "archive",
        "url": "https://github.com/theoremlp/multitool/releases/download/v0.4.0/multitool-x86_64-apple-darwin.tar.xz",
        "file": "multitool",
        "sha256": "6e4f5e1197c6d3e630531861cd77a60261ca6dc328d019bb9e64bf17062ed65a",
        "os": "macos",
        "cpu": "x86_64"
      }
    ]
  }
}
% bazel run @multitool//tools/multitool -- --lockfile multitool.lock.json update
ERROR: /private/var/tmp/_bazel_farcop/e66529431dbede3bc951f821053136ab/external/rules_multitool~~multitool~multitool.macos_arm64/tools/multitool/BUILD.bazel: no such target '@@rules_multitool~~multitool~multitool.macos_arm64//tools/multitool:macos_arm64_executable': target 'macos_arm64_executable' not declared in package 'tools/multitool' defined by /private/var/tmp/_bazel_farcop/e66529431dbede3bc951f821053136ab/external/rules_multitool~~multitool~multitool.macos_arm64/tools/multitool/BUILD.bazel
ERROR: /private/var/tmp/_bazel_farcop/e66529431dbede3bc951f821053136ab/external/rules_multitool~~multitool~multitool/toolchains/BUILD.bazel:6:29: no such target '@@rules_multitool~~multitool~multitool.macos_arm64//tools/multitool:macos_arm64_executable': target 'macos_arm64_executable' not declared in package 'tools/multitool' defined by /private/var/tmp/_bazel_farcop/e66529431dbede3bc951f821053136ab/external/rules_multitool~~multitool~multitool.macos_arm64/tools/multitool/BUILD.bazel and referenced by '@@rules_multitool~~multitool~multitool//toolchains:multitool_macos_arm64_toolchain_info'
ERROR: Analysis of target '@@rules_multitool~~multitool~multitool//tools/multitool:multitool' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.144s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target
mark-thm commented 5 months ago

Admittedly a poor error, but you seem to be attempting to use a non-existent file from the archive. The macos arm64 variant should have the file key set to “multitool-aarch64-apple-darwin/multitool”, for instance.

farcop commented 5 months ago

@mark-thm Yeah, sorry for that. Closing this. Thank you!