Repository navigation
Avoid recursive lib symlinks in installed dependencies - #753
Open
stevenjoezhang wants to merge 1 commit into
Open
stevenjoezhang wants to merge 1 commit into
stevenjoezhang wants to merge 1 commit into
Conversation
Replace lib -> .. with a managed directory of links to the resolved transitive dependencies. Refresh links for reused packages during install and update while leaving pre-existing lib paths and path dependencies alone. Remove the vendored molinillo back-link and cover directory cycles, transitive requires, dependency changes, overrides, and user-owned entries.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Shards currently creates
lib/<dependency>/lib -> .., linking each dependency back to the project's entirelibdirectory. This creates filesystem cycles that can cause problems for tools that follow symlinks.This change replaces that back-link with a real directory containing relative symlinks to the package's direct and transitive dependencies. Transitive dependencies remain accessible when compiling from a dependency's directory, including during postinstall.
Related: #263 and #681.
Changes
installandupdate, including for packages whose sources are already installed.lib/molinillo/lib -> ..link.Compatibility and scope
Existing
libpaths andpath:dependencies are left untouched. Legacy back-links are not automatically migrated; existing installations need a fresh dependency installation to adopt the new layout.A package can access its declared direct and transitive dependencies through the generated directory. Unrelated installed packages are no longer implicitly available there.
This patch has been validated on Linux. Windows-specific behavior discussed in #681 has not been tested.
Validation
Added 11 regression cases covering directory cycles, transitive requires, dependency changes, overrides, relocation, and preservation of existing content. The two initial regression cases fail on the original implementation and pass with this patch.
With Crystal 1.22.2 on Linux:
libdirectory completes without a filesystem cycle.