rust icon indicating copy to clipboard operation
rust copied to clipboard

integrate `builder.ensure` into `prepare_tool_cargo`

Open lucarlig opened this issue 1 year ago • 3 comments

integrate builder.ensure into prepare_tool_cargo function from https://github.com/rust-lang/rust/issues/128012

lucarlig avatar Oct 17 '24 21:10 lucarlig

r? @onur-ozkan

rustbot has assigned @onur-ozkan. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

rustbot avatar Oct 17 '24 21:10 rustbot

@onur-ozkan i haven't double checked for mistakes yet, so that's draft. but can you confirm that this work is actually needed and useful? There is no need for a full review yet.

lucarlig avatar Oct 17 '24 21:10 lucarlig

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
#16 2.910 Building wheels for collected packages: reuse
#16 2.911   Building wheel for reuse (pyproject.toml): started
#16 3.161   Building wheel for reuse (pyproject.toml): finished with status 'done'
#16 3.162   Created wheel for reuse: filename=reuse-4.0.3-cp310-cp310-manylinux_2_35_x86_64.whl size=132720 sha256=026f3bb0f1aa8090b861fd0a0939cb1a782396d84c8aab7875096557d637a0f6
#16 3.162   Stored in directory: /tmp/pip-ephem-wheel-cache-gzid5o4w/wheels/3d/8d/0a/e0fc6aba4494b28a967ab5eaf951c121d9c677958714e34532
#16 3.165 Installing collected packages: boolean-py, binaryornot, tomlkit, reuse, python-debian, markupsafe, license-expression, jinja2, chardet, attrs
#16 3.557 Successfully installed attrs-23.2.0 binaryornot-0.4.4 boolean-py-4.0 chardet-5.2.0 jinja2-3.1.4 license-expression-30.3.0 markupsafe-2.1.5 python-debian-0.1.49 reuse-4.0.3 tomlkit-0.13.0
#16 3.558 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
#16 DONE 3.7s
---
    Checking xz2 v0.1.7
error: calls to `push` immediately after creation
    --> src/core/build_steps/test.rs:2767:9
     |
2767 | /         let mut steps = vec![];
2768 | |         steps.push(CompileStep::Std(target));
2769 | |         steps.push(CompileStep::Rustc(target, None));
     | |_____________________________________________________^ help: consider using the `vec![]` macro: `let steps = vec![..];`
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push
     = note: `-D clippy::vec-init-then-push` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(clippy::vec_init_then_push)]`
error: could not compile `bootstrap` (lib) due to 1 previous error
Build completed unsuccessfully in 0:01:35
  local time: Thu Oct 17 22:04:31 UTC 2024
  network time: Thu, 17 Oct 2024 22:04:31 GMT

rust-log-analyzer avatar Oct 17 '24 22:10 rust-log-analyzer

@onur-ozkan i haven't double checked for mistakes yet, so that's draft. but can you confirm that this work is actually needed and useful? There is no need for a full review yet.

I think this is not a good idea. It adds unnecessary complexity without a clear purpose. There's no need to propagate steps from callers to prepare_tool_cargo; it makes the behaviour of prepare_tool_cargo very unpredictable.

onur-ozkan avatar Oct 18 '24 08:10 onur-ozkan

I agree, will close this.

lucarlig avatar Oct 18 '24 08:10 lucarlig