-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Those crates are moving in a fairly slow pace, while uring moves fast. As much as I fully understand that the maintainers have other commitments, this is harming us a bit. Importing this inside glommio is, actually a way to avoid a fork in my view: I consider this temporary and would encourage anyone that is sending code that touches iou and uring-sys to make a bona fide effort to upstream them. But by having them as a buffer here, we can detach our lifetimes.
- Loading branch information
Glauber Costa
committed
Mar 2, 2021
1 parent
7a1607f
commit c5dede7
Showing
21 changed files
with
3,426 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "glommio/liburing"] | ||
path = glommio/liburing | ||
url = git://git.kernel.dk/liburing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
This crate includes imported code for | ||
[uring-sys](https://github.com/ringbahn/uring-sys) and | ||
[iou](https://github.com/ringbahn/iou) | ||
from the ringbahn project. | ||
|
||
It is my intention that those imports are temporary and I don't | ||
mean this as a hard fork. On the other hand those crates haven't been | ||
as actively maintained as we would like. They are very central for | ||
what we do, as uring evolves very rapidly, so I have decided to | ||
soft fork them. | ||
|
||
Every patch that touches code in those directories should make at | ||
least a good faith effort to merge the code back into iou and uring-sys. | ||
Hopefully with time they will, at their own pace, have all the code | ||
that we need in which case we can revert back to using them externally. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
use std::env; | ||
use std::fs; | ||
use std::path::*; | ||
use std::process::Command; | ||
|
||
use cc::Build; | ||
|
||
fn main() { | ||
let project = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()) | ||
.canonicalize() | ||
.unwrap(); | ||
let liburing = project.join("liburing"); | ||
|
||
// Run the configure script in OUT_DIR to get `compat.h` | ||
let configured_include = configure(&liburing); | ||
|
||
let src = liburing.join("src"); | ||
|
||
// liburing | ||
Build::new() | ||
.file(src.join("setup.c")) | ||
.file(src.join("queue.c")) | ||
.file(src.join("syscall.c")) | ||
.file(src.join("register.c")) | ||
.include(src.join("include")) | ||
.include(&configured_include) | ||
.extra_warnings(false) | ||
.compile("uring"); | ||
|
||
// (our additional, linkable C bindings) | ||
Build::new() | ||
.file(project.join("rusturing.c")) | ||
.include(src.join("include")) | ||
.include(&configured_include) | ||
.compile("rusturing"); | ||
} | ||
|
||
fn configure(liburing: &Path) -> PathBuf { | ||
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap()) | ||
.canonicalize() | ||
.unwrap(); | ||
fs::copy(liburing.join("configure"), out_dir.join("configure")).unwrap(); | ||
fs::create_dir_all(out_dir.join("src/include/liburing")).unwrap(); | ||
Command::new("./configure") | ||
.current_dir(&out_dir) | ||
.output() | ||
.expect("configure script failed"); | ||
out_dir.join("src/include") | ||
} |
Submodule liburing
added at
b013df
Oops, something went wrong.