Skip to content

Fix Unpacking with merge flag failed without --dir flag#826

Merged
marcospb19 merged 17 commits into
ouch-org:mainfrom
tommady:close-issue-825
Jul 27, 2025
Merged

Fix Unpacking with merge flag failed without --dir flag#826
marcospb19 merged 17 commits into
ouch-org:mainfrom
tommady:close-issue-825

Conversation

@tommady

@tommady tommady commented May 18, 2025

Copy link
Copy Markdown
Collaborator

close #825

tommady added 4 commits May 18, 2025 06:00
Signed-off-by: tommady <tommady@users.noreply.github.com>
Signed-off-by: tommady <tommady@users.noreply.github.com>
Signed-off-by: tommady <tommady@users.noreply.github.com>
Signed-off-by: tommady <tommady@users.noreply.github.com>
@marcospb19

marcospb19 commented Jun 28, 2025

Copy link
Copy Markdown
Member

Hey, apologies for the huge delay, I'm back from a break. This is marked as a draft, is it ready for review now? :)

Comment thread src/utils/question.rs Outdated
@tommady

tommady commented Jun 28, 2025

Copy link
Copy Markdown
Collaborator Author

Hey, apologies for the huge delay, I'm back from a break. This is marked as a draft, is it ready for review now? :)

Hey, I am sorry, I forgot this draft PR...
After reading my last work, I recall the problem I was trying to solve.

As you can see, the integration test changes,
I followed the issue, but the integration test cannot be reproduced when you undo the other changes I made.

I'll commit to identifying the problem if the words cannot be clearly understood.

tommady added 3 commits June 28, 2025 11:11
Signed-off-by: tommady <tommady@users.noreply.github.com>
@tommady

tommady commented Jun 28, 2025

Copy link
Copy Markdown
Collaborator Author

ok, right now ignore the Clippy error, the updated test case passed...

test unpack_multiple_sources_into_the_same_destination_with_merge ... ok

And I am confused.

@marcospb19

Copy link
Copy Markdown
Member

Hah, did you expect it to fail but it's passing?

I triggered a re-run just in case 👀

@marcospb19

Copy link
Copy Markdown
Member

Do you get the same error when running locally? #798 (comment)

@tommady

tommady commented Jul 3, 2025

Copy link
Copy Markdown
Collaborator Author

Do you get the same error when running locally? #798 (comment)

Yes, I can reproduce it locally, even:

  1. sudo
  2. under tmp folder

But the integration test cannot simulate this issue

@marcospb19

Copy link
Copy Markdown
Member

But the integration test cannot simulate this issue

@tommady I figured the tests don't cover this bug because the bug itself only happens when the --dir or -d flag is not present, and all the tests rely on this -d flag so that it doesn't pollute the current dir with test artifacts, but instead, write them to /tmp.

Unfortunately, due to the way cargo test runner works, we also can't use std::env::set_current_dir to avoid this.

So there are 2 ways forward I can think of:

  1. Not having tests that cover this specific bug when -d is not present.
  2. Accepting test artifacts to current folder.

I'm fine with 1 I guess, what do you think?

@tommady

tommady commented Jul 16, 2025

Copy link
Copy Markdown
Collaborator Author

But the integration test cannot simulate this issue

@tommady I figured the tests don't cover this bug because the bug itself only happens when the --dir or -d flag is not present, and all the tests rely on this -d flag so that it doesn't pollute the current dir with test artifacts, but instead, write them to /tmp.

Unfortunately, due to the way cargo test runner works, we also can't use std::env::set_current_dir to avoid this.

So there are 2 ways forward I can think of:

  1. Not having tests that cover this specific bug when -d is not present.
  2. Accepting test artifacts to current folder.

I'm fine with 1 I guess, what do you think?

interesting.
anyway thanks for your explanation
now I see this issue more clearly, thanks!

I'll try to do the option 1
thanks.

tommady added 5 commits July 16, 2025 16:23
…merge and add a new test for issue 825 to reproduce the issue

Signed-off-by: tommady <tommady@users.noreply.github.com>
Signed-off-by: tommady <tommady@users.noreply.github.com>
Signed-off-by: tommady <tommady@users.noreply.github.com>
Signed-off-by: tommady <tommady@users.noreply.github.com>
@tommady tommady changed the title Fix Unpacking with merge flag failed Fix Unpacking with merge flag failed without --dir flag Jul 16, 2025
Signed-off-by: tommady <tommady@users.noreply.github.com>
@tommady
tommady marked this pull request as ready for review July 16, 2025 11:59
tommady added 2 commits July 16, 2025 12:26
Signed-off-by: tommady <tommady@users.noreply.github.com>
Signed-off-by: tommady <tommady@users.noreply.github.com>
@tommady

tommady commented Jul 24, 2025

Copy link
Copy Markdown
Collaborator Author

hi @marcospb19
could you kindly do a review while you have time?
thanks.

Comment thread src/utils/fs.rs Outdated
Signed-off-by: tommady <tommady@users.noreply.github.com>

@marcospb19 marcospb19 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great! Thanks for sticking to this, really appreciate it.

Comment thread CHANGELOG.md Outdated
@marcospb19
marcospb19 merged commit aeb27cc into ouch-org:main Jul 27, 2025
16 checks passed
@tommady
tommady deleted the close-issue-825 branch July 28, 2025 01:51
@marcospb19

Copy link
Copy Markdown
Member

Hey @tommady if you have an email I can msg you, could you ping me at marcospb19 @ hotmail.com

Thanks :)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unpacking with merge flag failed without --dir flag

2 participants