Skip to content

Declare the melange build dependency - #2

Merged
tiensonqin merged 2 commits into
mainfrom
devin/declare-melange-dependency
Sep 24, 2026
Merged

tiensonqin merged 2 commits into
mainfrom
devin/declare-melange-dependency

Conversation

@tiensonqin

Copy link
Copy Markdown
Contributor

Summary

src/dune builds the library in melange mode — (modes native byte melange) under (using melange 0.1) — so dune build -p ocaml-signal @install needs melc on PATH. Without a declared dependency opam can schedule this package's build before melange finishes installing, and the build fails with Program melc not found in the tree or in PATH (observed in logseq/chat CI on a clean switch).

Adds (melange (>= 6.0)) to depends, matching how lui declares its melange + melange-webapi deps for the same mode list. dune-project and the generated ocaml-signal.opam are updated together.

Link to Devin session: https://app.devin.ai/sessions/a3287ca9a4364c47ab22a258364ddc1f
Open in Devin Desktop: https://app.devin.ai/desktop/session/a3287ca9a4364c47ab22a258364ddc1f?variant=devin
Requested by: @tiensonqin

src/dune builds the library in melange mode ((modes native byte
melange) under (using melange 0.1)), so
requires melc on PATH. Without the dependency, opam can schedule the
package build before melange installs and the build fails with
'Program melc not found in the tree or in PATH' — matching how lui
already declares its melange + melange-webapi deps.
Copilot AI lite review requested due to automatic review settings September 23, 2026 02:02
@devin-ai-integration

Copy link
Copy Markdown

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

devin-ai-integration Bot pushed a commit to logseq/chat that referenced this pull request Sep 23, 2026
ocaml-signal builds its library in melange mode, so dune build -p
needs melc; without the declared dep, opam on a clean switch (CI)
can build it before melange installs and fail with 'Program melc
not found in the tree or in PATH'. Pinned to the logseq/ocaml-signal#2
commit that declares melange.
devin-ai-integration Bot pushed a commit to logseq/lui that referenced this pull request Sep 23, 2026
The ocaml-signal build needs melc (its library builds in melange
mode) but the package did not declare melange, so on a cold switch
opam could build it first and fail with 'Program melc not found'.
Pin CI to logseq/ocaml-signal#2's commit until it lands on main.
tiensonqin added a commit to logseq/chat that referenced this pull request Sep 23, 2026
* Port core leaf modules to pure OCaml (drop lg pipeline)

Hand-written .ml/.mli for the dependency-free and low-dependency core
modules: string_kit, journal, sync_state, sync_checkpoint, sync_protocol,
edn, asset_files, datascript_value, sqlite, storage_codec, ref_text,
snapshot_codec, e2ee, host_update, outliner, graph_bootstrap_data.

shared/native/dune now compiles src/*.ml via copy_files; opam pins updated
(lui -> c4468ff, +ocaml-signal, +ctypes, -lg/lg-test/signal-lg/
datascript-ocaml-lg). Entry exe stubs keep artifact names.

* Port rpc/rpc_session/pending_pump/session_outliner ops layer to OCaml

* Port graph runtime, sync session, and mobile hosts to OCaml

* Port live_sync and e2e seed modules, completing the core/ port

* Port model and view_base to pure OCaml

Pure OCaml rewrite of the model reducer and view_base helpers
against the new lui/ocaml-signal API; LG dialect files removed as
sources are ported.

* Port view_rows and view_sidebar to pure OCaml

* Port view_composer, view_flashcards, view_outliner to pure OCaml

* Port view_graphs, fix sidebar/outliner reactive signal plumbing

* Port app, views, native bridge; OCaml test harness with 7 suites green

- logseq_chat_app library: Model/App/View*/Native_bridge/Response_snapshot
  ported to pure OCaml on new lui + ocaml-signal (ctypes crypto FFI)
- extension schemas (outliner-editor/block-content, nav-stack,
  search-presentation, overflow-menu, liquid-glass tweak) declared via
  Lui_extension; element callsites follow new node-kind/property
  validation (~text on leaf kinds, InlineIconName, tweak wraps child)
- shared/test rewritten as alcotest test_main exe with ported
  edn/sync_state/sync_checkpoint/live_sync/asset_files/snapshot/
  lui_projection suites exercising the real native bridge
- requires lui runtime fix: deactivate dynamic segments on dropped
  subtree nodes (nested conditional unmount ordering) - upstream PR to
  logseq/lui pending

* Port 6 more test suites (markup, mobile_session, fractional_order, flashcards, outliner, lui_host_update, lui_snapshot)

- expose Markup.append_node/youtube_timestamp/tweet_id/fenced_code and
  Fractional_order.suffix needed by the ported tests
- 67 cases green

* Port remaining test suites to OCaml; fix projection/graph_read bugs found by tests

- Port graph_read, mobile_graph, outliner_state, pending_projection,
  pending_ops, model, sqlite, sync_session, outliner_effects, e2e_seed_data,
  logseq_storage_codec, platform_crypto tests to alcotest
- Fix breadcrumbs order (root-first) and make sidebar recent pages lazy
  so decrypt only runs for the visible window
- Expose pending_ops store_raw/list_raw/raw_title/json helpers in mli

* Port graph_runtime tests to OCaml; expose normalize_expected_title

* Finish test port: app_test.ml (174 tests green), drop cljc sources

- port app_test.cljc to app_test.ml; all 174 deftests now run under
  the alcotest harness (707 tests total)
- fix view ports found by the tests: liquid-glass tweak only on
  iOS/SwiftUI, mount-time context for native search/navigation props,
  on_change for the language radio, autofocus signal on the composer
  textarea, selected state on the outliner row box, 42pt hide-keyboard
  button width
- delete the 111 .cljc sources now fully ported to OCaml
- rename lg-coverage helpers to coverage_check and retarget the
  feature-coverage script at graph_runtime.ml
- drop .lg-cache from gitignore/CI and update README/AGENTS lg mentions

* Pin lui to the dynamic-segment drop fix

logseq/lui#21d5c9e deactivates a node's dynamic segments on drop so
stale prop publishes fail fast instead of mutating a dead subtree;
the app test suite exercises it through native-navigation-stack.

* Fix iOS build: link libffi, resolve Swift redeclarations

- ctypes.foreign in shared/native requires the ffi library at app link
  time (LogseqChatShell failed with undefined _ffi_* symbols); the iOS
  SDK ships libffi.tbd for both device and simulator.
- pre-existing on main (3e0c785): drop the duplicated
  LGChatPlatformCommandHandling protocol and LGChatSettingsPayload
  struct declarations, and restore @mainactor on LGChatRuntime and the
  protocol so actor isolation type-checks again.

Verified end-to-end in the iPhone 17 simulator (iOS 27.0): the ported
OCaml core renders the sign-in screen, drives the Cognito hosted UI,
and reaches the post-auth graph picker.

* Pin ocaml-signal to the melange dependency fix

ocaml-signal builds its library in melange mode, so dune build -p
needs melc; without the declared dep, opam on a clean switch (CI)
can build it before melange installs and fail with 'Program melc
not found in the tree or in PATH'. Pinned to the logseq/ocaml-signal#2
commit that declares melange.

* Regenerate monorepo lockfile after dropping the lg toolchain

The previous lockfile still vendored lg, lg-test, signal-lg and
datascript-ocaml-lg. Regenerated with:

  opam monorepo lock --ocaml-version=5.5.0 --opam-provided=ocaml-compiler logseq_chat

Private pins without dev-repo metadata (lui, datascript_ocaml, mldoc,
persistent_sorted_set_ocaml) are not vendored by the lockfile; CI clones
them from pin-depends as before.
tiensonqin added a commit to logseq/lui that referenced this pull request Sep 23, 2026
* Deactivate dynamic segments when their parent node is dropped

drop_node removes a node from every runtime table, but dynamic
segments registered on it kept dynamic_segment_active = true, so
queued signal effects could still address the dropped subtree through
dynamic_segment_index/resize_dynamic_segment. Deactivate the node's
segments on drop, matching retire_checkpoint_dynamic_segments for
hot-reload checkpoints: stale effects now fail fast on an inactive
segment instead of mutating a dead subtree.

* CI: pin ocaml-signal to the melange dependency fix

The ocaml-signal build needs melc (its library builds in melange
mode) but the package did not declare melange, so on a cold switch
opam could build it first and fail with 'Program melc not found'.
Pin CI to logseq/ocaml-signal#2's commit until it lands on main.
RCmerci added a commit to logseq/lui that referenced this pull request Sep 24, 2026
…-signal

pin-depends in lui.opam.locked carries the ocaml-signal git pin
(b975304 = logseq/ocaml-signal#2 head, melange build dep), so
`opam install . --locked` resolves it with no manual `opam pin`.
CI drops the pin step and the toolchain-rev cache-key step; README
build instructions updated.
Signal.get previously accepted only 'v state, so Signal.get on a bare
'v signal was a type error and callers had to discover Signal.sample.
Now:

- Signal.get : 'v signal -> 'v   (alias of sample; the common case)
- Signal.get_state : 'v state -> 'v  (former get)

sample is unchanged. Callers of get on a state switch to get_state.
@tiensonqin
tiensonqin merged commit 976b40f into main Sep 24, 2026
2 checks passed
@tiensonqin
tiensonqin deleted the devin/declare-melange-dependency branch September 24, 2026 05:59
tiensonqin added a commit to logseq/lui that referenced this pull request Sep 24, 2026
logseq/ocaml-signal#2 and #3 both merged: main now has the declared
melange build dep and the unified get/get_state accessors, so the pin
no longer needs a PR-branch sha.
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