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

Bugfix issue#222 #296

Merged
merged 1 commit into from Oct 28, 2021
Merged

Bugfix issue#222 #296

merged 1 commit into from Oct 28, 2021

Conversation

iotanbo
Copy link
Contributor

@iotanbo iotanbo commented Oct 19, 2021

Bug description:
When writing symlinks to .zip or .tar archive, Write method uses the archive path instead of real path to access a symlink on the file system. This causes errors like readlink: readlink path/to/some/file: no such file or directory.

Bug fix:

  1. Added SrcPath field to archiver.FileInfo so that Write method can use it to read the symlink.
  2. Added github actions for Ubuntu, MacOS and Windows for in-place test automation (this may be undone if required).

Copy link
Owner

@mholt mholt left a comment

Choose a reason for hiding this comment

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

Thanks for this. It's a likely approve, I'm mostly wondering if the GitHub actions should replace our broken Azure CI. And maybe the CI changes should be on a different PR?

kolbycrouch added a commit to kolbycrouch/archiver that referenced this pull request Oct 23, 2021
@iotanbo
Copy link
Contributor Author

iotanbo commented Oct 28, 2021

Thanks for the reply. I reverted all changes related to CI.

@iotanbo
Copy link
Contributor Author

iotanbo commented Oct 28, 2021

Noticed that this pull request solves same issue as https://github.com/mholt/archiver/pull/201/files and https://github.com/mholt/archiver/pull/230/files, the difference is that this one does it for both .zip and .tar archives while the other only for .tar.
It looks like there are at least 3 PRs fixing the same issue, and the issue has been reported few times as well.

Copy link
Owner

@mholt mholt left a comment

Choose a reason for hiding this comment

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

Thanks, will try to get this merged. Just one nit before doing so.

archiver.go Outdated
@@ -125,6 +125,9 @@ type File struct {
type FileInfo struct {
os.FileInfo
CustomName string
// Stores path to the source.
// Used when reading a symlink.
SrcPath string
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
SrcPath string
SourcePath string

Generally I prefer to spell out words if it's not cumbersome, and I think we can in this case, since "source" is a pretty short word.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Owner

@mholt mholt left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Did you still want to use your CI files? We could look at those in another PR.

@mholt mholt merged commit e0c66cf into mholt:master Oct 28, 2021
@iotanbo iotanbo deleted the bugfix-issue#222 branch October 29, 2021 06:39
@iotanbo
Copy link
Contributor Author

iotanbo commented Oct 29, 2021

OK, by the way the duplicate issue #202 and PRs #201 and #230 might also be closed.

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.

None yet

2 participants