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

Copy remote directories correctly #1207

Merged
merged 1 commit into from
Feb 12, 2023
Merged

Copy remote directories correctly #1207

merged 1 commit into from
Feb 12, 2023

Conversation

Emilgardis
Copy link
Member

resolves #1206

@Emilgardis Emilgardis requested a review from a team as a code owner February 10, 2023 18:07
Comment on lines 70 to 89
if let Some((_, rel)) = reldst.rsplit_once('/') {
if src.is_dir() && src.file_name().unwrap().to_utf8()? == rel {
eyre::bail!(
"reldst is pointing to the wrong path: {} -> {}\n{}",
src.as_posix_relative()?,
reldst,
std::panic::Location::caller()
);
}
}
Copy link
Member Author

@Emilgardis Emilgardis Feb 10, 2023

Choose a reason for hiding this comment

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

this should be behind CROSS_DEBUG

dirs.cargo(),
reldst
.rsplit_once('/')
.ok_or_else(|| eyre::eyre!("cargo can't be a root directory"))?
Copy link
Member Author

@Emilgardis Emilgardis Feb 10, 2023

Choose a reason for hiding this comment

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

Suggested change
.ok_or_else(|| eyre::eyre!("cargo can't be a root directory"))?
.ok_or_else(|| eyre::eyre!("can not be a root directory"))?

dirs.xargo(),
reldst
.rsplit_once('/')
.ok_or_else(|| eyre::eyre!("cargo can't be a root directory"))?
Copy link
Member Author

@Emilgardis Emilgardis Feb 10, 2023

Choose a reason for hiding this comment

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

Suggested change
.ok_or_else(|| eyre::eyre!("cargo can't be a root directory"))?
.ok_or_else(|| eyre::eyre!("can not be a root directory"))?

@Emilgardis
Copy link
Member Author

bors try --none

bors bot added a commit that referenced this pull request Feb 10, 2023
@Emilgardis
Copy link
Member Author

I want to add a test for this, but it's hard to imagine what a good test would look like.

@bors
Copy link
Contributor

bors bot commented Feb 10, 2023

try

Build succeeded:

@Emilgardis Emilgardis changed the title Copy .cargo and .xargo correctly Copy remote directories correctly Feb 12, 2023
@Emilgardis
Copy link
Member Author

Emilgardis commented Feb 12, 2023

I think the test can be part of the larger testing infra work

#1037

merging this as it has been confirmed to work now

bors r+

bors bot added a commit that referenced this pull request Feb 12, 2023
1207: Copy remote directories correctly r=Emilgardis a=Emilgardis

resolves #1206


Co-authored-by: Emil Gardström <[email protected]>
@bors
Copy link
Contributor

bors bot commented Feb 12, 2023

Build failed:

@Emilgardis Emilgardis added the no-ci-targets PRs that do not affect any cross-compilation targets. label Feb 12, 2023
@Emilgardis
Copy link
Member Author

bors retry

@bors
Copy link
Contributor

bors bot commented Feb 12, 2023

Build succeeded:

@bors bors bot merged commit 99b8069 into main Feb 12, 2023
@bors bors bot deleted the fix-1206 branch February 12, 2023 18:14
@Emilgardis Emilgardis added this to the v0.3.0 milestone Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-ci-targets PRs that do not affect any cross-compilation targets.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Private Crate Repository Issues
1 participant