-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
414 additions
and
30 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 |
---|---|---|
@@ -1,13 +1,5 @@ | ||
[unstable] | ||
# Keep in sync with CI! | ||
build-std = ["core", "alloc"] | ||
build-std-features = ["compiler-builtins-mem"] | ||
|
||
[build] | ||
target = "targets/x86_64-unknown-none-hermitkernel.json" | ||
rustflags = [ | ||
"-Zmutable-noalias=no" | ||
] | ||
[alias] | ||
xtask = "run --package xtask --" | ||
|
||
[target.x86_64-unknown-none-hermitkernel] | ||
runner = "tests/hermit_test_runner.py" |
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
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
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
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
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 @@ | ||
/target |
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,11 @@ | ||
[package] | ||
name = "xtask" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
anyhow = "1.0" | ||
goblin = { version = "0.5", default-features = false, features = ["archive", "std"] } | ||
rustc_version = "0.4" | ||
xflags = "0.2" | ||
xshell = "0.2" |
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,84 @@ | ||
use std::path::PathBuf; | ||
|
||
xflags::xflags! { | ||
src "./src/flags.rs" | ||
|
||
/// Run custom build command. | ||
cmd xtask { | ||
default cmd help { | ||
/// Print help information. | ||
optional -h, --help | ||
} | ||
|
||
/// Build the kernel. | ||
cmd build | ||
{ | ||
/// Build for the architecture. | ||
required --arch arch: String | ||
/// Directory for all generated artifacts. | ||
optional --target-dir target_dir: PathBuf | ||
/// Do not activate the `default` feature. | ||
optional --no-default-features | ||
/// Space or comma separated list of features to activate. | ||
repeated --features features: String | ||
/// Build artifacts in release mode, with optimizations. | ||
optional -r, --release | ||
/// Build artifacts with the specified profile. | ||
optional --profile profile: String | ||
/// Enable the `-Z instrument-mcount` flag. | ||
optional --instrument-mcount | ||
} | ||
|
||
/// Run clippy for all targets. | ||
cmd clippy {} | ||
} | ||
} | ||
|
||
// generated start | ||
// The following code is generated by `xflags` macro. | ||
// Run `env UPDATE_XFLAGS=1 cargo build` to regenerate. | ||
#[derive(Debug)] | ||
pub struct Xtask { | ||
pub subcommand: XtaskCmd, | ||
} | ||
|
||
#[derive(Debug)] | ||
pub enum XtaskCmd { | ||
Help(Help), | ||
Build(Build), | ||
Clippy(Clippy), | ||
} | ||
|
||
#[derive(Debug)] | ||
pub struct Help { | ||
pub help: bool, | ||
} | ||
|
||
#[derive(Debug)] | ||
pub struct Build { | ||
pub arch: String, | ||
pub target_dir: Option<PathBuf>, | ||
pub no_default_features: bool, | ||
pub features: Vec<String>, | ||
pub release: bool, | ||
pub profile: Option<String>, | ||
pub instrument_mcount: bool, | ||
} | ||
|
||
#[derive(Debug)] | ||
pub struct Clippy; | ||
|
||
impl Xtask { | ||
pub const HELP: &'static str = Self::HELP_; | ||
|
||
#[allow(dead_code)] | ||
pub fn from_env() -> xflags::Result<Self> { | ||
Self::from_env_() | ||
} | ||
|
||
#[allow(dead_code)] | ||
pub fn from_vec(args: Vec<std::ffi::OsString>) -> xflags::Result<Self> { | ||
Self::from_vec_(args) | ||
} | ||
} | ||
// generated end |
Oops, something went wrong.