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

Add CARGO_MAKE_CRATE_TARGET_DIR env variable #548

Merged
merged 6 commits into from
Apr 10, 2021

Conversation

ark0f
Copy link
Contributor

@ark0f ark0f commented Apr 10, 2021

No description provided.

@codecov-io
Copy link

codecov-io commented Apr 10, 2021

Codecov Report

Merging #548 (ed619e6) into 0.32.17 (c2d5a6a) will increase coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head ed619e6 differs from pull request most recent head ba5083d. Consider uploading reports for the commit ba5083d to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##           0.32.17     #548      +/-   ##
===========================================
+ Coverage    93.05%   93.07%   +0.01%     
===========================================
  Files           98       98              
  Lines        19119    19132      +13     
===========================================
+ Hits         17792    17807      +15     
+ Misses        1327     1325       -2     
Impacted Files Coverage Δ
src/lib/environment/crateinfo.rs 84.74% <100.00%> (+1.41%) ⬆️
src/lib/environment/crateinfo_test.rs 100.00% <100.00%> (ø)
src/lib/environment/mod.rs 93.03% <100.00%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c2d5a6a...ba5083d. Read the comment docs.

@sagiegurari sagiegurari changed the base branch from master to 0.32.17 April 10, 2021 15:54
Copy link
Owner

@sagiegurari sagiegurari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ark0f thanks a lot for the PR. this env var is actually super useful.
i see a test is failing so maybe worth to check what is the regression there.

@@ -1431,6 +1431,7 @@ In addition to manually setting environment variables, cargo-make will also auto
* **CARGO_MAKE_RUST_TARGET_POINTER_WIDTH** - 32, 64
* **CARGO_MAKE_RUST_TARGET_VENDOR** - apple, pc, unknown
* **CARGO_MAKE_RUST_TARGET_TRIPLE** - x86_64-unknown-linux-gnu, x86_64-apple-darwin, x86_64-pc-windows-msvc, etc ...
* **CARGO_MAKE_CRATE_TARGET_DIR** - Gets target directory where cargo stores the output of a build, respects ${CARGO_TARGET_DIR}, .cargo/config.toml's and ${CARGO_HOME}/config.toml, but not `--target-dir` command-line flag.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CARGO_MAKE_CRATE_TARGET_DIRECTORY please :)

);

envmnt::set(
"CARGO_MAKE_CRATE_TARGET_DIR",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CARGO_MAKE_CRATE_TARGET_DIRECTORY

Comment on lines +208 to +209
.map(|config_file| config_file.join("config"))
.filter_map(|config_file| {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm guessing the regression might be here, but didn't investigate.

@sagiegurari
Copy link
Owner

@ark0f also i merged your other PR, so you need to resolve merge conflicts

…get-dir

� Conflicts:
�	src/lib/environment/crateinfo.rs
�	src/lib/test/workspace2/Cargo.toml
@ark0f ark0f requested a review from sagiegurari April 10, 2021 16:35
@sagiegurari
Copy link
Owner

@ark0f looks awesome. lets wait for the CI to finish and than i'll merge it.
thanks a lot!

@ark0f
Copy link
Contributor Author

ark0f commented Apr 10, 2021

All tests pass after I added #[ignore] to get_crate_target_dir test (like previous contributor did with get_crate_target_triple), but I still don't know why changing CWD can affect tests

@sagiegurari
Copy link
Owner

I still don't know why changing CWD can affect tests

running cargo test will run tests in parallel so changing cwd will break other tests that look at the file system.
when you add ignore to a test, i postpone it to later and run it in a single thread run (cargo make splits and runs its tests in 2 batches, parallel and single threaded).

@ark0f
Copy link
Contributor Author

ark0f commented Apr 10, 2021

Oops, forgot about import

@sagiegurari
Copy link
Owner

looks great. thanks again. merging

@sagiegurari sagiegurari merged commit 7e56ab9 into sagiegurari:0.32.17 Apr 10, 2021
@ark0f ark0f deleted the target-dir branch April 10, 2021 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants