Skip to content

CMakeLists.txt: fix LIB_SEARCH_PATH on apple silicon - #458

Open
willjones9 wants to merge 1 commit into
ucode-lang:masterfrom
willjones9:apple-silicon-build
Open

willjones9 wants to merge 1 commit into
ucode-lang:masterfrom
willjones9:apple-silicon-build

Conversation

@willjones9

Copy link
Copy Markdown

CMAKE_INSTALL_PREFIX on Apple Silicon should be set to /opt/homebrew, not /usr/local

Before:

$ ucode -e "import * as fs from 'fs';"
Syntax error: Unable to resolve path for module 'fs'
In line 1, byte 25:

 `import * as fs from 'fs';`
  Near here --------------^

After:

$ ucode -e "import * as fs from 'fs';"
$ echo $?
0

`CMAKE_INSTALL_PREFIX` on Apple Silicon should be set to `/opt/homebrew`, not `/usr/local`

Before:

```
$ ucode -e "import * as fs from 'fs';"
Syntax error: Unable to resolve path for module 'fs'
In line 1, byte 25:

 `import * as fs from 'fs';`
  Near here --------------^
```

After:
```
$ ucode -e "import * as fs from 'fs';"
$ echo $?
0
```

Signed-off-by: Will Jones <willjones_9@icloud.com>
@jow-

jow- commented Sep 26, 2026

Copy link
Copy Markdown
Collaborator

Is /opt/homebrew an official Apple thing now? I thought it is a 3rd party package manager for MacOS?

@willjones9

Copy link
Copy Markdown
Author

It's not an official Apple thing, no, however /usr/local is the homebrew prefix on Intel based macs, and /opt/homebrew is the homebrew prefix on Apple Silicon based macs.

Part of the build process already takes this into consideration, but that happens after LIB_SEARCH_PATH is set. This results in a mismatch between the compiled-in search path and the install location, and broken library loading

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants