Skip to content

Keep absolute addon paths, don't resolve symlinks when relativising (#641) - #668

Merged
danoli3 merged 1 commit into
openframeworks:masterfrom
danoli3:fix-absolute-addon-paths
Oct 16, 2026
Merged

danoli3 merged 1 commit into
openframeworks:masterfrom
danoli3:fix-absolute-addon-paths

Conversation

@danoli3

@danoli3 danoli3 commented Oct 16, 2026

Copy link
Copy Markdown
Member

Fixes #641

PG turned every path into a relative one with fs::relative / weakly_canonical, which also resolves symlinks. That breaks:

  • system / Homebrew paths in addon_config.mk — /opt/homebrew/include became ../../../../../../../../../../opt/homebrew/include, and /opt/homebrew/lib/libaec.a became the versioned ../../…/opt/homebrew/Cellar/libaec/1.1.7/lib/libaec.a (breaks on brew upgrade or moving the project)
  • symlinked addons/ (git worktrees etc.) — addons/ofxGui -> ~/of/addons/ofxGui was written as ../../../../../../../../../../Users/…/addons/ofxGui/src
  • absolute ADDON_FRAMEWORKS crashed osx with map::at: key not found (exit 134)

Changes

  • lexicalRelative (Utils): relative path without resolving symlinks; falls back to fs::relative only if the lexical result doesn't point at the same file (eg /tmp vs /private/tmp)
  • isAbsoluteOutsideOF: absolute paths outside the OF root are kept absolute by makeRelative
  • normalizePath (Utils) is absolute().lexically_normal() instead of weakly_canonical; ofAddon::normalizePath, fixPath, addToFolder use lexicalRelative
  • xcode addLibrary uses makeRelative instead of fs::relative
  • xcode frameworks: absolute frameworks not in filesToFolders go to the Frameworks group instead of .at() throwing
  • bump PG 0.111.0 / GUI 0.103.0

Tested (macOS, osx + vs)

master this PR
ADDON_INCLUDES += /opt/homebrew/include ../../../../../../../../../../opt/homebrew/include /opt/homebrew/include
ADDON_LIBS += /opt/homebrew/lib/libaec.a ../…/opt/homebrew/Cellar/libaec/1.1.7/lib/libaec.a /opt/homebrew/lib/libaec.a
ADDON_FRAMEWORKS += /abs/path/Fake.framework crash (134) added, search path /abs/path
symlinked addons/ofxGui ../../../../../../../../../../Users/…/addons/ofxGui/src ../../../addons/ofxGui/src

Regression: 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.

…ing paths relative, fix absolute ADDON_FRAMEWORKS crash (openframeworks#641); bump version
@danoli3
danoli3 merged commit 588ad6e into openframeworks:master Oct 16, 2026
5 checks passed
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.

PG converts all paths into relative paths.

1 participant