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

Local cache: Add ability to _not_ Zip (APFS, copy-on-write) #198

Open
itsthejb opened this issue Aug 9, 2019 · 3 comments
Open

Local cache: Add ability to _not_ Zip (APFS, copy-on-write) #198

itsthejb opened this issue Aug 9, 2019 · 3 comments

Comments

@itsthejb
Copy link

itsthejb commented Aug 9, 2019

Enhancement Suggestion

It occurred to me that, since most users will be using APFS now, zipping frameworks inside the local cache seems to waste a great deal of disk space when frameworks in the cache are shared amongst multiple local projects

Steps which explain the enhancement or reproduce the bug

  1. Set up two projects locally that share the same dependency
  2. Run Rome with local cache for both
  3. TheFramework.zip is stored in the cache
  4. TheFramework.framework will be extracted from the Zip, and copied to both projects
  5. Since zip/extract is used, no way for a filesystem to understand the link between these files

Current behavior

  • For both project, TheFramework.framework will be extracted from the cache and stored in both projects
  • Since the underlying framework is unzipped from the shared archive, no possibility to share the underlying resource through APFS (copy-on-write)

Suggested behavior

  • If the cache did not, or were configurable to not Zip the resource, it seems likely that APFS would share the underlying framework resource automatically (straight copy, rather than create zip, extract zip), thus reducing disk usage
  • I also wonder if symlinking the frameworks might be an even more clear method

Why would the enhancement be useful to most users

  • This should probably be configurable in the Romefile. I would assume that most users would still benefit from Zipping, but hard to say

Rome version:

0.23.1.61 - Romam uno die non fuisse conditam.

OS and version:

10.14.6 (18G87)

@itsthejb itsthejb changed the title Local cache: Add ability to _not_ Zip Local cache: Add ability to _not_ Zip (APFS, copy-on-write) Aug 9, 2019
@tmspzz
Copy link
Owner

tmspzz commented Aug 9, 2019

@itsthejb thanks for the suggestion! There are some details that make this challenging, for example you made the assumption that zip is called TheFramework.zip but it's actually not. The naming pattern is described here and itself contains metadata on what the zip is.

Once unzipped, that metadata (fundamental for how rome works) is gone and that would make it impossible to differentiate between versions.

I can see how your suggestion (given the metadata is stored for example in the directory structure) would work if limited to the local-cache. But on a remote store like S3 I'm not sure how this would work.

@tmspzz
Copy link
Owner

tmspzz commented Aug 9, 2019

Sorry from what I read I don't see indications that APFS is sharing blocks between two different files that are copies of each others, I only read about modifying and versioning. Can you point me to where it says that copies are treated that way?

@itsthejb
Copy link
Author

https://developer.apple.com/documentation/foundation/file_system/about_apple_file_system. However, this appears to apply only to cloned volumes. I feel I heard somewhere that a simple cp would support copy on write...

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

No branches or pull requests

2 participants