GoogleCloudPlatform / GoogleCloudPlatform/cloud-spanner-emulator

Feature request: add or document macOS build

Open
#188 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
334
Forks
77
Avg merge
8m
Merged PRs (30d)
2

Description

I want to run the Spanner emulator directly on macOS to make testing easier. In particular, I want to avoid depending on Docker for local development.

I've tried the following and variations from https://github.com/GoogleCloudPlatform/cloud-spanner-emulator/issues/29.

```sh
bazel run binaries/gateway_main

# And a few variations
BAZEL_USE_CPP_ONLY_TOOLCHAIN=1 bazel run binaries/gateway_main
bazel run binaries/gateway_main --copt='-Wno-unknown-warning-option' --copt='-O3' --copt='-march=native' --cxxopt='-std=c++17' --host_cxxopt='-std=c++17' --action_env=BAZEL_CXXOPTS="-std=c++17"
```

This results in two errors:

```
third_party/spanner_pg/shims/json_shim.c:41:26: unknown type name 'uint'; did you mean 'int'?
int jspConvertRegexFlags(uint flags) {

external/com_googlesource_code_riegeli/riegeli/bytes/cfile_internal.cc:79:5: error: use of undeclared identifier 'close'
close(fd);
```

Interestingly, I can build [riegeli](https://github.com/google/riegeli) successfully with Bazel from the main branch directly with `bazel build riegeli/records:all`. I briefly explored upgrading the riegeli dependency. Riegeli now relies on bzlmod and the emulator patches riegeli so it's not a simple upgrade.

I [cross-posted](https://bazelbuild.slack.com/archives/CA31HN1T3/p1728349232128599) to the Bazel Slack channel.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.