janestreet / janestreet/basement

basement not compiling on macOS

Open Beginner friendly
#5 1 comment 0 reactions 0 assignees View on GitHub
forwarded-to-js-devs
Dominant language
OCaml
Stars
1
Forks
6
PR merge metrics
No merged PRs in 30d

Description

Hi,

I have encountered an issue while installing basement on my machine (macOS)

The error is :

```
stubs.c:95:19: error: use of undeclared identifier 'caml_state'
95 | return Val_long(caml_state->id);
```

this must be a typo : `caml_state` instead of the macro `Caml_state`.

It can be fixed with

```
mkdir -p \~/.opam-sources/basement

curl -sL https://github.com/janestreet/basement/archive/5c640c230a3989f8e505cda7aa6aca9925a23a5b.tar.gz \
| tar xz -C ~/.opam-sources/basement --strip-components=1

sed -i '' 's/Val_long(caml_state->id)/Val_long(Caml_state->id)/' \
\~/.opam-sources/basement/src/stubs.c

opam pin add -y -n -k path --switch bonsai18 \
'basement.v0.18\~preview.130.106+341' ~/.opam-sources/basement
# compiles !
```

original discussion :
https://discuss.ocaml.org/t/bonsai-not-compiling-on-macos/18517

Contributor guide

Open the contributing guide

Research direction

Start with src/stubs.c around line 95 and reproduce the macOS build using the basement source and opam pinning steps in the issue. Check the reported identifier against the platform macro, then rebuild basement; done means the package compiles successfully on macOS.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, ocaml
Domain
build-system
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.