cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
30.15k stars 3.81k forks source link

GEOS functionality on Mac ARM (M1/M2) does not work #93161

Open jlinder opened 1 year ago

jlinder commented 1 year ago

This is a tracking issue with no planned fix

Please 👍 this comment if you have need of this issue being fixed.


Describe the problem

After downloading the Mac ARM v22.2.0 binary, attempting to use the geospatial capabilities (e.g. select st_isvalid(st_makepoint(0, 0))) results in this error:

ERROR: st_isvalid(): geos: error during GEOS init: geos: cannot load GEOS from dir "/usr/local/lib/cockroach": geos error: dlopen(/usr/local/lib/cockroach/libgeos.dylib, 0x0001): tried: '/usr/local/lib/cockroach/libgeos.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/cockroach/libgeos.dylib' (no such file), '/usr/local/lib/cockroach/libgeos.dylib' (no such file)

Once the geospatial libraries are placed in the expected location, using the geospatial capabilites results in this error:

ERROR: st_isvalid(): geos: error during GEOS init: geos: cannot load GEOS from dir "/usr/local/lib/cockroach": geos error: dlopen(/usr/local/lib/cockroach/libgeos.dylib, 0x0001): tried: '/usr/local/lib/cockroach/libgeos.dylib' (code signature in <86488A59-9B22-36D8-B460-1AB24AAEA2DF> '/usr/local/lib/cockroach/libgeos.dylib' not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?))

To Reproduce

To produce the first error:

  1. Download and install cockroach
    curl https://binaries.cockroachdb.com/cockroach-v22.2.0.darwin-11.0-aarch64.tgz > cockroach-v22.2.0.darwin-11.0-aarch64.tgz
    tar -zxvf cockroach-v22.2.0.darwin-11.0-aarch64.tgz
    cd cockroach-v22.2.0.darwin-11.0-aarch64
  2. Run ./cockroach demo
  3. At the SQL prompt, run: select st_isvalid(st_makepoint(0, 0));

Then, to produce the second error:

  1. Move the libraries to the expected location:
    sudo mkdir -p /usr/local/lib/cockroach
    sudo cp lib/libgeos* /usr/local/lib/cockroach
  2. Run ./cockroach demo
  3. At the SQL prompt, run: select st_isvalid(st_makepoint(0, 0));

Post Fix

After the fix is made, consider reverting the doc changes in cockroachdb/docs#15733 (files) and converting the warning on the Mac Install page to a note that this isn't available in v22.2.0 and the other affected point releases. Perhaps also assess if there are other docs changes we want to make.

Jira issue: CRDB-22194

mikeCRL commented 1 year ago

@jlinder Can you/I add to the description that when this is fixed, we should consider reverting the prior doc changes https://github.com/cockroachdb/docs/pull/15733/files and converting the warning on the Mac Install page to a note that this isn't available in v22.2.0 (and other specific point releases, if applicable)? Open to any other ideas for the docs, but of course we can reassess when this is fixed.
CC @mdlinville @kenliu-crl

dikshant commented 1 year ago

While we acknowledge that not having geospatial libraries in M1 binaries makes the DX more complicated for the subset of developers working on Geospatial features on M1 using CockroachDB, our Docker image provides a viable workaround for now.

Hence we will not be supporting geospatial libraries on M1 binaries due to challenges posed by having to dynamically link the libraries to CockroachDB.

We will reevaluate our stance should we hear more users inquire about this in the future.

sjunepark commented 1 year ago

Is this resolved in version 22.2.6 or 23.1?

jlinder commented 1 year ago

Hi @junepark202012. As per @dikshant's comment above, we are not planning to fix this issue.

jlinder commented 1 year ago

If you have need of this issue being fixed, please 👍 this comment.

HaraldTR commented 1 year ago

This would be big for my team.