Rename Cargo.toml to Cargo.text in the init template files #1206
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Updates the init template Cargo file from
Cargo.toml
toCargo.text
.Why
We were seeing a failure with the dry-run:
https://github.com/stellar/soroban-cli/actions/runs/7983365311/job/21798405675
Slack thread with discussion about the problem: https://aha-labs.slack.com/archives/C04B02ABF37/p1708486449196609
This is due to a known cargo issue: rust-lang/cargo#9017
If a subdirectory includes a
Cargo.toml
file, it will be viewed as a sub-package, and therefore the contents of the directory will not be included in the package. Since we are including thisCargo.toml
to be used as a template for writing a file to the user's fs, and it is not to be used as a sub-package, I've changed the name of the file toCargo.text
in this source code. Then when the file is being copied into the project that is being created on the user's machine, the file name is written asCargo.toml
, as expected.From the cargo book docs:
I tested this locally by recreating the steps in the dry-run, that @2opremio outlined in the slack convo, and was able to get through
cargo-hack hack --feature-powerset --ignore-private --config "source.crates-io.replace-with = 'vendored-sources'" --config "source.vendored-sources.directory = 'vendor'" package
without error.