Fixing Cursor with ARM DevContainers
I use Cursor as my primary editor. Most of the time I’m using a Mac to develop software that runs on Linux.
This means that my IDE context typically involves a Linux aarch64 dev container so I can test my code on Apple Silicon without CPU emulation.
Unfortunately, while Cursor supports Mac, and Cursor supports Apple Silicon, and Cursor supports devcontainers, it does not support ARM dev containers.
By “not support,” I think they just mean they don’t bother to test it, because it’s always breaking for pretty trivial reasons.
The current breakage is that the Cursor code indexing scheme, which is a huge part of the reason to use it at all, depends on NPM modules that are not properly installed on ARM. This is kind of obnoxious because the editor still acts like everything is fine, but the “Chat with codebase” feature falls back on some kind of primitive search scheme in the absence of embeddings, and the result is pretty terrible.
If you are using Cursor, make sure you go check in
1
Settings -> Cursor Settings -> Features -> Codebase Indexing
once in awhile and make sure its actually working. Otherwise, it will suck and you’ll be left wondering what all the fuss is about.
This can be pretty easily fixed by running something like the following, as of Cursor 0.44.11:
1
2
3
4
5
apt update -y
apt update -y
apt install -y npm
cd ~/.cursor-server/bin/*/extensions/cursor-retrieval/node_modules/\@anysphere
npm install @anysphere/file-service@0.0.0-30549ed4-6f41e022f7af079ff34c9d09cb1d5d616735c7e31ec0d732af0daec4758069f7
Currently, the version has to be pinned because the latest version of that @anysphere/file-service module is not compatible and, if used, will give you this error:
1
[error] TypeError: this.merkleClient.initWithRipgrepIgnore is not a function
This fix probably has a short shelf life, but assuming I continue to use cursor you can check back here for my latest work-around.