-
-
Notifications
You must be signed in to change notification settings - Fork 272
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 Interactions between On-Disk Files and In-Memory Archives #160
base: development
Are you sure you want to change the base?
Add Interactions between On-Disk Files and In-Memory Archives #160
Conversation
…zip(_:to:skipCRC32:progress:preferredEncoding:); they fail at archive(for:mode:)
…ll unzip(_:to:skipCRC32:progress:preferredEncoding:)
…gress:preferredEncoding:) and unzip(_:to:skipCRC32:progress:preferredEncoding:)
…ss:preferredEncoding:)
…'s not necessarily on disk; testZipItemToArchive() fails at resourceURL(for:pathExtension:)
…ipItem(at sourceURL: URL, to archive: Archive)
…ssionMethod:progress:)'s return value
…gress:), for Swift >= 5.0
Thank you for your contribution and sorry for the delayed reply. The changes look good, but there are some minor issues we need to fix before merging this. I saw, that you added a |
Use matrix strategy to test across Ubuntu 16.04, 18.04, and 20.04. Use latest macOS image for all Apple platforms, while preserving the existing macOS Mojave test.
…ompressionMethod:progress)
I found out the root problem: a newly initialised archive wasn't unwrapped in This problem wasn't Linux specific, but it hasn't been caught on Apple platforms in testing. I'm not completely sure why this is the case, yet. It seems like all test cases that are conditionally compiled at Swift ≥ 5.0 are skipped by Xcode in testing. I fixed as much as I could, and don't know how to deal with the remaining errors. Somehow
I think I fixed most of the warnings. The rest are complaints about either functions or files having too many lines. There aren't many empty lines in the entire codebase. I think one way to fix it is through some heavy refactoring that gathers together some common parts, and make better use of I find these linter rules quite arbitrary, and even a bit silly, though. They could inadvertently force developers to make code less readable, just to conform to the forms.
This occurs in |
While trying to figure out why some of the tests failed, I modified the CI script. Mostly expanded and updated the test platform versions. |
Thanks for looking into that so quickly!
This is a shortcoming of the current test setup.
I plan to move to GitHub Actions for CI in the near future. While I think the changes you introduced (using the latest version & setting up a test matrix, ...) are a good idea, I'd rather do that in a dedicated PR, that also migrates to GH Actions.
I totally understand that - I often run into swiftlint-imposed constraints myself. Of course that shouldn't lead to less readable code. Ideally it should point out locations where improvements can be made. No worries, if you don't have time for those cleanups - I can also look into that when I work on the project the next time. Would it be okay for you if I push directly onto your PR branch?
Providing this method seems a bit too convenient IMO. As far as I can see it only wraps |
Would using a
Just did. Sorry, I should have consulted you first before making those changes.
Yep.
This is a problem I overlooked. I suppose the OS would just keep on paging until it crashes. What if we add some checks and have it throw an error if there isn't enough memory? Would it make the convenient method valuable to have? Maybe I can refactor the methods further to make zipping and unzipping truly location-agnostic? |
I'd like to get rid of anything Xcode related altogether at some point and solely rely on the information provided by the SPM metadata.
Thank you. I will re-add some of your changes (esp. the CI test matrix 👍) in another PR when switching to GitHub Actions.
An API user should consider the memory requirements of the code while writing the code. Hence I think that an error thrown at runtime is too late here. I am currently juggling a lot of different tasks, so I might be slow to respond - But I will try to help out with this PR when I can. |
Could this be merged for iOS/macOS/tvOS/watchOS first, and solve Linux_Swift as a separate PR? |
It's been a while since I last worked on this. If I remember correctly, it's some of my ill-written test cases that are causing the CI failures. I will reinvestigate them. I think I can also mark the new methods introduced in this pull request with
^ There is also this thing I need to address first. |
Fixes #173
Changes proposed in this PR
Tests performed
Further info for the reviewer
unzipItem(at:to:skipCRC32:progress:preferredEncoding:)
didn't check ifdestinationURL
was writable.Open Issues
For some reason,
sourceURL
has to be checked twice inzipItem(at:to:shouldKeepParent:compressionMethod:progress:)
. This is marked with aFIXME
inFileManager+ZIP.swift
.