Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Limbo core no_std #442

Open
penberg opened this issue Dec 11, 2024 Discussed in #441 · 1 comment
Open

Make Limbo core no_std #442

penberg opened this issue Dec 11, 2024 Discussed in #441 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@penberg
Copy link
Collaborator

penberg commented Dec 11, 2024

Discussed in #441

Originally posted by michalfita December 11, 2024
One of key features of original SQLite is that in can be built for bare metal system and used without OS in place on microcontrollers. To achieve the same, the core of Limbo would have to be no_std with ability to plug in a storage backend that's non-Linux thing. But I don't see #![no_std] clause in core's lib.rs.

Is this no-feature for Limbo being oriented for cloud solutions?

@penberg penberg added enhancement New feature or request help wanted Extra attention is needed labels Dec 11, 2024
@LorrensP-2158466
Copy link

Hi, I'm new to this project, learned about it this week and was very interested. I stumbled on this issue and tried to tackle it to see if it is doable.

I refactored core to use #![no_std] and managed to get 34 errors (I'll list the kinds of errors below). I just hacked trough the files using alloc and core instead of the std modules. this can be simplified by creating a new module that acts as a middle man (see below). The things i couldn't resolve were the things that actually depended on std:

  • use of std::collections::HashMap and std::collections::HashSet
  • use of std::sync::RwLock and std::sync::OnceLock,
  • use of std::fs::*
  • use of std::io::*
  • use of std::env::*
  • use of println! and eprintln

I think i got all the dependencies to compile with no_std but im not sure since building ends after the above errors are emitted.
Im not familiar with the architecture at the moment or the implementation choices, but for some of the issues listed i think we can use the no_std_compat crate and remove the println and eprintln uses, but im not sure i don't know the implications of that.

The link to my fork/branch: https://github.com/LorrensP-2158466/limbo/tree/core_no_std. It does not compile at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants