Skip to content

⬆️ Upgrade to lore 0.12.0 - #49

Open
LuukAsmus wants to merge 1 commit into
mainfrom
lore-0.12
Open

LuukAsmus wants to merge 1 commit into
mainfrom
lore-0.12

Conversation

@LuukAsmus

Copy link
Copy Markdown
Collaborator

Bumps the lore submodule to v0.12.0, sets LORE_VERSION = "0.12.0" so lore-bin downloads the 0.12.0 release assets (same liblore-v0.12.0-<triple>.<ext> naming as before), regenerates lore-sys and adapts the lore-rs wrappers. breda needs 0.11+ because from there the Lore background service relays storage and revision-tree calls, which is how several breda processes will share one store.

C API changes since 0.10.0

0.12.0 changes nothing in the C API; the changes come from 0.10.1 and 0.11.0.

0.10.1

  • Every storage *_ITEM_COMPLETE event replaces error_code with an error detail struct (code, message, trace). The five storage completion Event variants read error.error_code and gain a message.
  • Per-item codes changed: a missing payload reports PayloadNotFound (81) instead of AddressNotFound (80), a short buffer Oversized (118), and a mutable-key miss from the server NotFound (101). lore.h names only five codes, so ErrorCode gains PayloadNotFound and NotFound with the registry values spelled out; LoreError::is_not_found covers both not-found codes and Store::resolve folds the server's miss to None like the local one.
  • An empty lore_string_t now has a NULL pointer. try_to_str already handled that; Event::StorageGetData now guards a null byte pointer the same way instead of building a slice from it.
  • lore_revision_sync_args_t gains view, exposed on RevisionSyncArgs.
  • The C library is now built by the lore-capi package; the header still lives at lore-capi/lore.h, which is what the generator reads.

0.11.0

  • lore_global_args_t gains auth_mode and trust_remote, exposed as GlobalArgs::auth_mode: AuthMode and GlobalArgs::trust_remote. The raw struct is still filled field by field, so every field is set.
  • skip_verify on lore_storage_open_args_t is now an alias of trust_remote for the handle; the docs on StorageOpenArgs and StoreOptions say so.
  • lore_auth_login_with_token_args_t gains client_id / client_secret (secret redacted from Debug, like the token).
  • lore_storage_get_resolved_item_t gains fragments; lore_auth_url_event_data_t gains user_code; lore_event_t gains LORE_EVENT_FILE_AUDIT and other new events, which reach a callback as Event::Other.
  • lore_branch_merge_start_args_t gains link_paths / link_messages; nothing here wraps it.

Bindings

Generated on Windows (no Linux at hand) with the repo's generator, then the enum typedefs that libclang emits as signed on MSVC were put back to c_uint. That procedure reproduces the committed 0.10.0 bindings.rs byte for byte from the 0.10.0 header, so the 0.12.0 output should match what the generate-bindings CI job produces on Linux. 311 functions now (263 before).

Verified beyond CI

  • cargo fmt --check, cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace (478 + 30 + 1 tests) all pass locally on Windows; the repo has no cargo deny or shear step.
  • cargo test -p lore-bin -- --ignored downloads liblore-v0.12.0-x86_64-pc-windows-msvc.zip from the GitHub release.
  • The lore.h shipped in that release archive is identical to the submodule's at v0.12.0 apart from LORE_INTERFACE_VERSION (0.12.0 vs 0.11.1-nightly).
  • A scratch program loads the released lore.dll through lore_rs::load (which requires all 311 symbols to resolve), reports 0.12.0+1967, opens an in-memory Store, round-trips a put/get, and a read of an absent address comes back as LoreError::Failed with is_not_found() == true and the message now carried by the error detail.

Not covered: no run against a real server, so the NotFound (101) mapping for a remote mutable-key miss and trust_remote are taken from the release notes and header rather than observed.

🤖 Generated with Claude Code

Bumps the `lore` submodule to v0.12.0, sets `LORE_VERSION` to match so
`lore-bin` downloads the 0.12.0 release assets, regenerates the bindings
and adapts the safe wrappers to the C API changes of 0.10.1 and 0.11.0;
0.12.0 changes nothing in the C API.

0.10.1: every storage `*_ITEM_COMPLETE` event carries an `error` detail
where it carried an `error_code`, so the five storage completion events
read the code from `error.error_code` and gain a `message`. The code is
the failure's own FFI code, so `ErrorCode` names the two codes a store
read now runs into that `lore.h` does not: a missing payload (81), which
`LoreError::is_not_found` covers alongside a missing address, and the
server's plain miss (101), which `Store::resolve` folds to `None` as it
does the local store's. `lore_revision_sync_args_t` appends `view`,
which `RevisionSyncArgs` passes through. An empty string Lore emits is a
null pointer from 0.10.1 on, which `try_to_str` already read as empty;
`Event::StorageGetData` now guards its bytes the same way.

0.11.0: `lore_global_args_t` gains `auth_mode` and `trust_remote`, which
`GlobalArgs` exposes as `AuthMode` and a flag; `skip_verify` on a
storage open is now an alias of `trust_remote` for that handle, which
the docs say. `lore_auth_login_with_token_args_t` gains `client_id` and
`client_secret`, redacted from `Debug` like the token.
`lore_storage_get_resolved_item_t` gains `fragments`, and
`lore_auth_url_event_data_t` a `user_code`. `lore_branch_merge_start_args_t`
gains two arrays, but nothing here wraps it.

The bindings were generated with libclang on Windows and the enum
typedefs bindgen emits as signed there were put back to unsigned, which
reproduces the committed 0.10.0 file byte for byte from its header. The
0.12.0 release's `lore.h` differs from the tag's only in its version
stamp, and the released `lore.dll` loads through these bindings, reports
`0.12.0+1967` and round-trips a put/get on an in-memory store.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

1 participant