Repository: zellij-org/zellij
File: xtask/src/ci.rs (Rust)

Code before:
    crate::cargo()
        .and_then(|cargo| {
            cmd!(
                sh,
                "{cargo} build --release --target x86_64-unknown-linux-musl"
            )
            .run()
            .map_err(anyhow::Error::new)
        })
        .context(err_context)
}

fn e2e_test(sh: &Shell, args: Vec<OsString>) -> anyhow::Result<()> {
    let err_context = "failed to run E2E tests";

    let _pd = sh.push_dir(crate::project_root());

    crate::cargo()
        .and_then(|cargo| {
            cmd!(
                sh,
                "{cargo} test --no-default-features -- --ignored --nocapture --test-threads 1"
            )
            .args(args)
            .run()
            .map_err(anyhow::Error::new)
        })
        .context(err_context)
}

fn cross_compile(sh: &Shell, target: &OsString) -> anyhow::Result<()> {
    let err_context = || format!("failed to cross-compile for {target:?}");

    crate::cargo()
        .and_then(|cargo| {
            cmd!(sh, "{cargo} install mandown").run()?;
            Ok(cargo)
        })
        .and_then(|cargo| {
            cmd!(sh, "{cargo} install cross")
                .run()
                .map_err(anyhow::Error::new)
        })
        .with_context(err_context)?;

    build::build(
        sh,
        flags::Build {
            release: true,
            no_plugins: false,
            plugins_only: true,

Review comment (suggestion):
This makes zellij take whatever plugins lie in the `zellij-utils/assets/plugin/` folder. Why did you change this? Of course it speeds up the e2e tests, but we do not guarantee that the content of `zellij-utils/assets/plugins` is up to date and matches the current zellij version. That's only the case when building the plugins in release mode first, because then they're copied into the `assets/plugins` folder. Or does the e2e binary take the plugins from somewhere else entirely? Afaik it did a while ago, but iirc I changed this to make it bundle the plugins into the e2e binary.

Code after:
    crate::cargo()
        .and_then(|cargo| {
            cmd!(
                sh,
                "{cargo} build --release --target x86_64-unknown-linux-musl"
            )
            .run()
            .map_err(anyhow::Error::new)
        })
        .context(err_context)
}

fn e2e_test(sh: &Shell, args: Vec<OsString>) -> anyhow::Result<()> {
    let err_context = "failed to run E2E tests";

    e2e_build(sh).context(err_context)?;

    let _pd = sh.push_dir(crate::project_root());

    // set --no-default-features so the test binary gets built with the plugins from assets/plugins that just got built
    crate::cargo()
        .and_then(|cargo| {
            cmd!(
                sh,
                "{cargo} test --no-default-features -- --ignored --nocapture --test-threads 1"
            )
            .args(args)
            .run()
            .map_err(anyhow::Error::new)
        })
        .context(err_context)
}

fn cross_compile(sh: &Shell, target: &OsString) -> anyhow::Result<()> {
    let err_context = || format!("failed to cross-compile for {target:?}");

    crate::cargo()
        .and_then(|cargo| {
            cmd!(sh, "{cargo} install mandown").run()?;
            Ok(cargo)
        })
        .and_then(|cargo| {
            cmd!(sh, "{cargo} install cross")
                .run()
                .map_err(anyhow::Error::new)
        })
        .with_context(err_context)?;

    build::build(
        sh,
        flags::Build {