Repository navigation
Keep absolute addon paths, don't resolve symlinks when relativising (#641) - #668
Merged
Merged
Conversation
…ing paths relative, fix absolute ADDON_FRAMEWORKS crash (openframeworks#641); bump version
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.
Fixes #641
PG turned every path into a relative one with
fs::relative/weakly_canonical, which also resolves symlinks. That breaks:addon_config.mk—/opt/homebrew/includebecame../../../../../../../../../../opt/homebrew/include, and/opt/homebrew/lib/libaec.abecame the versioned../../…/opt/homebrew/Cellar/libaec/1.1.7/lib/libaec.a(breaks onbrew upgradeor moving the project)addons/(git worktrees etc.) —addons/ofxGui -> ~/of/addons/ofxGuiwas written as../../../../../../../../../../Users/…/addons/ofxGui/srcADDON_FRAMEWORKScrashed osx withmap::at: key not found(exit 134)Changes
lexicalRelative(Utils): relative path without resolving symlinks; falls back tofs::relativeonly if the lexical result doesn't point at the same file (eg/tmpvs/private/tmp)isAbsoluteOutsideOF: absolute paths outside the OF root are kept absolute bymakeRelativenormalizePath(Utils) isabsolute().lexically_normal()instead ofweakly_canonical;ofAddon::normalizePath,fixPath,addToFolderuselexicalRelativeaddLibraryusesmakeRelativeinstead offs::relativefilesToFoldersgo to theFrameworksgroup instead of.at()throwingTested (macOS, osx + vs)
ADDON_INCLUDES += /opt/homebrew/include../../../../../../../../../../opt/homebrew/include/opt/homebrew/includeADDON_LIBS += /opt/homebrew/lib/libaec.a../…/opt/homebrew/Cellar/libaec/1.1.7/lib/libaec.a/opt/homebrew/lib/libaec.aADDON_FRAMEWORKS += /abs/path/Fake.framework/abs/pathaddons/ofxGui../../../../../../../../../../Users/…/addons/ofxGui/src../../../addons/ofxGui/srcRegression: 10 core addons (ofxGui, ofxOpenCv, ofxAssimpModelLoader, ofxKinect, ofxPoco, ofxSvg, ofxNetwork, ofxOsc, ofxXmlSettings, ofxThreadedImageLoader) + a project with relative local addons (
../../addons/ofxLocalA,localAddons/ofxLocalB, #562) on osx / vs / linux64 / msys2 — output identical to master apart from the version string and random UUIDs.