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

Allow removing of compile artifacts after every crate publish to free up disk space #137

Open
lnicola opened this issue Oct 13, 2023 · 7 comments

Comments

@lnicola
Copy link

lnicola commented Oct 13, 2023

We noticed in rust-lang/rust-analyzer#15732 that crates appear to be built multiple times, which fills up the disk. Is this intended?

EDIT: here is our workflow. Just noticed the logs have expired, will post an update when it happens again.

@lnicola lnicola changed the title Are crates built outside of the workspace Are crates built outside of the workspace? Oct 13, 2023
@pksunkara
Copy link
Owner

pksunkara commented Oct 13, 2023

No?

uses root as current_dir for the cargo command to run

let (_, stderr) = cargo(&metadata.workspace_root, &args, &[])?;

and root defaults to the workspace root derived from cargo_metadata

@lnicola
Copy link
Author

lnicola commented Oct 13, 2023

Let me trigger another publish, then...

@pksunkara
Copy link
Owner

Ok, will wait.

It looks like it worked last week? https://github.com/rust-lang/rust-analyzer/actions/runs/6394748635

@lnicola
Copy link
Author

lnicola commented Oct 13, 2023

It worked on the second try because:

info already published ra_ap_stdx v0.0.177
info already published ra_ap_tt v0.0.177
info already published ra_ap_cfg v0.0.177
info already published ra_ap_profile v0.0.177
info already published ra_ap_limit v0.0.177
info already published ra_ap_rustc-dependencies v0.0.177
info already published ra_ap_parser v0.0.177
info already published ra_ap_text_edit v0.0.177
info already published ra_ap_syntax v0.0.177
info already published ra_ap_test_utils v0.0.177
info already published ra_ap_paths v0.0.177
info already published ra_ap_vfs v0.0.177
info already published ra_ap_base_db v0.0.177
info already published ra_ap_toolchain v0.0.177
info already published ra_ap_flycheck v0.0.177
info already published ra_ap_intern v0.0.177
info already published ra_ap_mbe v0.0.177
info already published ra_ap_hir_expand v0.0.177
info already published ra_ap_hir_def v0.0.177
info already published ra_ap_hir_ty v0.0.177
info already published ra_ap_hir v0.0.177
info already published ra_ap_ide_db v0.0.177
info already published ra_ap_ide_assists v0.0.177
info already published ra_ap_ide_completion v0.0.177
info already published ra_ap_ide_diagnostics v0.0.177
info already published ra_ap_ide_ssr v0.0.177
info already published ra_ap_ide v0.0.177
info already published ra_ap_proc_macro_api v0.0.177
info already published ra_ap_project_model v0.0.177
info already published ra_ap_vfs-notify v0.0.177
info already published ra_ap_load-cargo v0.0.177
info already published ra_ap_proc_macro_srv v0.0.177
info already published ra_ap_proc-macro-srv-cli v0.0.177

@lnicola
Copy link
Author

lnicola commented Oct 13, 2023

Okay, it started. The log doesn't display in full for me, but keep an eye on https://github.com/rust-lang/rust-analyzer/actions/runs/6510665988/job/17684839822.

Here's a sample (arrayvec compiled twice):

image

@lnicola lnicola closed this as not planned Won't fix, can't repro, duplicate, stale Oct 13, 2023
@lnicola lnicola reopened this Oct 14, 2023
@lnicola
Copy link
Author

lnicola commented Oct 14, 2023

What do you think about adding an option to clean target/package after publishing each crate? Or an option to only publish some of the crates?

We currently use --force '*', but I don't know if we can split that across multiple invocations, like:

cargo workspaces publish --yes --force ra_ap_base_db --exact --no-git-commit --allow-dirty --skip-published custom 0.0.$(($RUN_NUMBER + 133))
rm -rf target/package
cargo workspaces publish --yes --force ra_ap_cfg --exact --no-git-commit --allow-dirty --skip-published custom 0.0.$(($RUN_NUMBER + 133))

@pksunkara pksunkara changed the title Are crates built outside of the workspace? Allow removing of compile artifacts after every crate publish to free up disk space Dec 5, 2023
@pksunkara
Copy link
Owner

There's a workaround for Github CI as used by rust-analyzer here, https://github.com/rust-lang/rust-analyzer/blob/master/.github/workflows/autopublish.yaml#L22-L24.

I will wait for more user reports before addressing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants