[macOS] ":" (colon) is not expanded properly in directory settings
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 14.1k
- Forks
- 2.2k
- Avg merge
- 7h 35m
- Merged PRs (30d)
- 51
Description
First and foremost consider this:
- Only RetroArch bugs should be filed here. Not core bugs or game bugs
- This is not a forum or a help section, this is strictly developer oriented
Description
On macOS, the default settings for audio_filter_dir, bundle_assets_src_path, and video_filter_dir are as follows:
audio_filter_dir = ":/Contents/Resources/filters/audio"
bundle_assets_src_path = ":/Contents/Resources/assets.zip"
video_filter_dir = ":/Contents/Resources/filters/video"
The ":" (colon) character is supposed to resolve to the location of the RetroArch app bundle (typically /Applications/RetroArch.app, assuming the app is placed in the suggested directory and not renamed). However, any spaces in the path are interpreted as "%20", which causes the wrong directories to be loaded.
This behavior can be seen when using this Homebrew cask for the nightly build, which renames RetroArch.app to RetroArch Nightly.app to avoid conflicts with the stable build.
Expected behavior
The ":" (colon) expands to the location of the app bundle. (i.e. /Applications/RetroArch Nightly.app).
Actual behavior
The spaces (and possibly other characters) in the path to the app bundle are not escaped properly (i.e. /Applications/RetroArch%20Nightly.app).
Pure speculation, but this may be due to a conflict with other settings like core_updater_buildbot_assets_url, which expect an online URL rather than a local directory/file. Perhaps the presence of ":/" causes the string to be interpreted incorrectly?
Steps to reproduce the bug
- Place
RetroArch.appin/Applicationsand run it once to generate the defaultretroarch.cfg. - Rename
RetroArch.apptoRetroArch Nightly.app, which contains a space. - Observe the following behavior:
- In Settings > Video > Video Filter, no video filters are listed.
- In Settings > Audio > DSP Plugin, no audio filters are listed.
- A "fake app" named
RetroArch%20Nightly.appis created next toRetroArch Nightly.app. (macOS treats all files with the.appextension as launch-able apps, but attempting to do so only gives the OS-standard "damaged or incomplete" message.) It containsContents/Resources/filters/audioandContents/Resources/filters/video. This is where RetroArch is looking for audio and video filters. These directories will be created every time RetroArch is opened.
Interestingly, if RetroArch.app is renamed before it is ran for the first time, then the aforementioned values in the generated retroarch.cfg are edited to use the full app path rather than ":" expansion. (This means the assets are always able to be extracted on the first launch.) However, if the app is renamed after that, then a similar "fake app" issue will occur, since the old app path will no longer exist. Ideally, ":" expansion should still be used in these cases, but fixed so all characters are properly escaped.
Bisect Results
The same behavior appears to occur on every version since stable 1.9.0.
Version/Commit
You can find this information under Information/System Information
- RetroArch: 1.19.1 (nightly c208186df)
Environment information
- OS: macOS Sonoma 14.5
- Compiler: N/A
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue by renaming the macOS app bundle to include a space, then trace how the ':' directory settings expand the bundle path. Verify the behavior for audio_filter_dir, bundle_assets_src_path, and video_filter_dir; the fix is complete when paths preserve spaces and filters and bundled assets load from the renamed app.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, macos
- Domain
- desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100