tursodatabase / tursodatabase/libsql

Build fails due to missing `size_of` function

Open Beginner friendly
#1,925 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
17.2k
Forks
531
Avg merge
1h 12m
Merged PRs (30d)
1

Description

Running a simple cargo build from the latest main (and libsql-server-v0.24.31) results in the following error:

error[E0425]: cannot find function `size_of` in this scope
   --> libsql-wal/src/shared_wal.rs:419:80
    |
419 |                 let buf = unsafe { ZeroCopyBoxIoBuf::new_uninit_partial(frame, size_of::<FrameHeader>()) };
    |                                                                                ^^^^^^^ not found in this scope
    |
help: consider importing one of these items
    |
1   + use core::mem::size_of;
    |
1   + use std::mem::size_of;

Importing use std::mem::size_of; in shared_wal.rs seems to allow the build to complete. I'm not a rust dev and I don't really understand the difference between the two imports, so I figured I'd open an issue rather than a pull request.

EDIT: Running latest docker almalinux:9-minimal (eec681af155e) on linux/arm64

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect libsql-wal/src/shared_wal.rs around line 419, where cargo build reports the missing size_of function. Start by checking the imports and the compiler's suggested items, then run cargo build in the repository. Done means the build completes without the unresolved-function error on the reported environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
databases
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.