Skip to content

Cannot install Bazel rules on Mac M2 w/ MacOs 14.1.6 #16

@joe-thurbon

Description

@joe-thurbon

I'm trying to install according to the overview on the main Github page.

WORKSPACE

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "com_plezentek_rules_sqlc",
    sha256 = "ac0c69ad3f3f49a2f5c068a7ac946a52ce0d8389927f279eff2dca00f2631df1",
    urls = [
        "https://github.com/plezentek/rules_sqlc/releases/download/v0.9.1/rules_sqlc-v0.9.1.tar.gz"
    ],
)

load("@com_plezentek_rules_sqlc//sqlc:deps.bzl", "sqlc_register_toolchains", "sqlc_rules_dependencies")

sqlc_rules_dependencies()

sqlc_register_toolchains()

BUILD


load("@com_plezentek_rules_sqlc//sqlc:def.bzl", "sqlc_package")

sqlc_package(
    name = "people_db",
    package = "people",
    queries = ["//sql/people/people_queries.sql"],
    schema = ["//sql/people/people_schema.sql"],
    engine = "postgresql" 
)

(although I don't think we get as far as the BUILD step....

Then when I try

bazel build //util/go/people/db:people_db

I get the following stacktrace...

INFO: Repository sqlc_release instantiated at:
  /Users/joethurbon/dev/default/WORKSPACE:31:25: in <toplevel>
  /private/var/tmp/_bazel_joethurbon/01bf3aee8914e4e784b105421c739805/external/com_plezentek_rules_sqlc/sqlc/private/release.bzl:159:26: in sqlc_register_toolchains
  /private/var/tmp/_bazel_joethurbon/01bf3aee8914e4e784b105421c739805/external/com_plezentek_rules_sqlc/sqlc/private/release.bzl:145:27: in sqlc_download_release
Repository rule _sqlc_download_release defined at:
  /private/var/tmp/_bazel_joethurbon/01bf3aee8914e4e784b105421c739805/external/com_plezentek_rules_sqlc/sqlc/private/release.bzl:134:41: in <toplevel>
ERROR: An error occurred during the fetch of repository 'sqlc_release':
   Traceback (most recent call last):
	File "/private/var/tmp/_bazel_joethurbon/01bf3aee8914e4e784b105421c739805/external/com_plezentek_rules_sqlc/sqlc/private/release.bzl", line 95, column 45, in _sqlc_download_release_impl
		goos, goarch = _detect_host_platform(ctx)
	File "/private/var/tmp/_bazel_joethurbon/01bf3aee8914e4e784b105421c739805/external/com_plezentek_rules_sqlc/sqlc/private/release.bzl", line 59, column 17, in _detect_host_platform
		fail("missing mapping between machine architecture {} and goarch".format(uname))
Error in fail: missing mapping between machine architecture arm64 and goarch
ERROR: Analysis of target '//util/go/people/db:people_db' failed; build aborted: missing mapping between machine architecture arm64 and goarch
INFO: Elapsed time: 0.484s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
FAILED: 
    Fetching repository @@local_jdk; starting
    Fetching repository @@remotejdk11_linux_s390x_toolchain_config_repo; starting
    Fetching repository @@remotejdk11_win_toolchain_config_repo; starting

Sorry if this is a Bazel issue specifically, but given where the stack-trace points, this is my first port of call. (I'm new to each of golang, sqlc and bazel, so happy to be redirected if I'm in the wrong place.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions