tursodatabase / tursodatabase/libsql
Build fails due to missing `size_of` function
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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