summaryrefslogtreecommitdiffstats
path: root/xtask
diff options
context:
space:
mode:
authorhar7an <99636919+har7an@users.noreply.github.com>2023-05-09 02:43:28 +0000
committerGitHub <noreply@github.com>2023-05-09 02:43:28 +0000
commit30d0cffa4294b27da88253b5fb24b40044310338 (patch)
tree66e9cbb833571aee022d5739451e0925c32aeefb /xtask
parent204c41e63f5a134e2f371ee56e0fb29acea64672 (diff)
Use rust 1.67 (#2375)
* rust: Update toolchain version to 1.67 * xtask/pipeline/publish: Drop manual "wait" for crates.io to catch up, which is obsolete with rust 1.66 and up. Cargo does that on its own now. See https://github.com/rust-lang/cargo/pull/11062 * xtask: Add function to obtain asset_dir instead of assembling it on demand throughout the codebase. * xtask/run: Add '--quick-run' flag as a convenient shorthand for `cargo xtask run --data-dir $PROJECT_ROOT/zellij-utils/assets`. * cargo: Add 'q' command alias as a shorthand for 'cargo xtask run --quick-run' * cargo: Update thiserror to 1.0.40 * cargo: Update anyhow to 1.0.70 and specify dependency only once inside `zellij-utils`, not inside the zellij root crate. * cargo: Update names to 0.14.0 * cargo: Update miette to 5.7.0 and re-export the dependency from zellij-utils, to avoid duplicate (incompatible) includes from inside zellij-utils and the root crate. * cargo: Update dialoguer to 0.10.4 * fix formatting * changelog: Add PR #2375
Diffstat (limited to 'xtask')
-rw-r--r--xtask/src/build.rs4
-rw-r--r--xtask/src/ci.rs5
-rw-r--r--xtask/src/flags.rs3
-rw-r--r--xtask/src/main.rs4
-rw-r--r--xtask/src/pipelines.rs20
5 files changed, 21 insertions, 15 deletions
diff --git a/xtask/src/build.rs b/xtask/src/build.rs
index 5bdf6ec88..b77eda40d 100644
--- a/xtask/src/build.rs
+++ b/xtask/src/build.rs
@@ -69,9 +69,7 @@ fn move_plugin_to_assets(sh: &Shell, plugin_name: &str) -> anyhow::Result<()> {
let err_context = || format!("failed to move plugin '{plugin_name}' to assets folder");
// Get asset path
- let asset_name = crate::project_root()
- .join("zellij-utils")
- .join("assets")
+ let asset_name = crate::asset_dir()
.join("plugins")
.join(plugin_name)
.with_extension("wasm");
diff --git a/xtask/src/ci.rs b/xtask/src/ci.rs
index b756052a9..e34f517ea 100644
--- a/xtask/src/ci.rs
+++ b/xtask/src/ci.rs
@@ -54,11 +54,8 @@ fn e2e_build(sh: &Shell) -> anyhow::Result<()> {
.context(err_context)?;
// Copy plugins to e2e data-dir
+ let plugin_dir = crate::asset_dir().join("plugins");
let project_root = crate::project_root();
- let plugin_dir = project_root
- .join("zellij-utils")
- .join("assets")
- .join("plugins");
let data_dir = project_root.join("target").join("e2e-data");
let plugins: Vec<_> = std::fs::read_dir(plugin_dir)
.context(err_context)?
diff --git a/xtask/src/flags.rs b/xtask/src/flags.rs
index 75ef19e4d..dd076f539 100644
--- a/xtask/src/flags.rs
+++ b/xtask/src/flags.rs
@@ -65,6 +65,8 @@ xflags::xflags! {
/// Run debug version of zellij
cmd run {
+ /// Take plugins from asset folder, skip building plugins.
+ optional --quick-run
/// Take plugins from here, skip building plugins. Passed to zellij verbatim
optional --data-dir path: PathBuf
/// Enable the singlepass compiler for WASM plugins
@@ -182,6 +184,7 @@ pub struct Install {
pub struct Run {
pub args: Vec<OsString>,
+ pub quick_run: bool,
pub data_dir: Option<PathBuf>,
pub singlepass: bool,
pub disable_deps_optimize: bool,
diff --git a/xtask/src/main.rs b/xtask/src/main.rs
index 9759d3a64..e394f8431 100644
--- a/xtask/src/main.rs
+++ b/xtask/src/main.rs
@@ -82,6 +82,10 @@ fn project_root() -> PathBuf {
.to_path_buf()
}
+fn asset_dir() -> PathBuf {
+ crate::project_root().join("zellij-utils").join("assets")
+}
+
pub fn cargo() -> anyhow::Result<PathBuf> {
std::env::var_os("CARGO")
.map_or_else(|| which::which("cargo"), |exe| Ok(PathBuf::from(exe)))
diff --git a/xtask/src/pipelines.rs b/xtask/src/pipelines.rs
index b89d7c0b6..9c82c6c0a 100644
--- a/xtask/src/pipelines.rs
+++ b/xtask/src/pipelines.rs
@@ -90,10 +90,18 @@ pub fn install(sh: &Shell, flags: flags::Install) -> anyhow::Result<()> {
}
/// Run zellij debug build.
-pub fn run(sh: &Shell, flags: flags::Run) -> anyhow::Result<()> {
- let err_context = || format!("failed to run pipeline 'run' with args {flags:?}");
+pub fn run(sh: &Shell, mut flags: flags::Run) -> anyhow::Result<()> {
+ let err_context =
+ |flags: &flags::Run| format!("failed to run pipeline 'run' with args {:?}", flags);
let singlepass = flags.singlepass.then_some(["--features", "singlepass"]);
+ if flags.quick_run {
+ if flags.data_dir.is_some() {
+ eprintln!("cannot use '--data-dir' and '--quick-run' at the same time!");
+ std::process::exit(1);
+ }
+ flags.data_dir.replace(crate::asset_dir());
+ }
let profile = if flags.disable_deps_optimize {
"dev"
@@ -117,7 +125,7 @@ pub fn run(sh: &Shell, flags: flags::Run) -> anyhow::Result<()> {
.run()
.map_err(anyhow::Error::new)
})
- .with_context(err_context)
+ .with_context(|| err_context(&flags))
} else {
build::build(
sh,
@@ -137,7 +145,7 @@ pub fn run(sh: &Shell, flags: flags::Run) -> anyhow::Result<()> {
.run()
.map_err(anyhow::Error::new)
})
- .with_context(err_context)
+ .with_context(|| err_context(&flags))
}
}
@@ -357,10 +365,6 @@ pub fn publish(sh: &Shell, flags: flags::Publish) -> anyhow::Result<()> {
println!("Aborting publish for crate '{crate_name}'");
return Err::<(), _>(err);
}
- } else {
- println!("Waiting for crates.io to catch up...");
- std::thread::sleep(std::time::Duration::from_secs(15));
- break;
}
}
}