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
App: Fix UserAppData dir on macOS #4620
Conversation
Thanks for the PR, I agree that we should move it to We have the same issue with migration for the Btw, could you add a link the forum thread to the PR description? |
In the forum thread, we discussed migration. I fear that migration code adds bloat that needs to basically live forever, as there is no guarantee that a user comes from old-version to new-version via does-the-migration-version. |
@pilhuhn the migration code (if we where to move the directory) would just need to be a few lines: # The following code is just psudo code
# The c++ counterpart using boost::filesystem would be similar in length
if not check_exists(user_app_data_path) and check_exists(old_user_app_data_path):
copy_directory(old_user_app_data_path, user_app_data_path) I don't understand the argument that it would have to live forever. In my opinion, we just need this migration code for a few versions give users the ability upgrade between versions without too much headache. But I would be fine if we just kept it for one version too if it's perceived as too bloated to keep longer. You are correct that there will be edge cases where someone tries to upgrade from |
I'll have a look once I find some time. |
I marked this PR as "on hold" to prevent it to be merged as is for now... |
When merging this PR then we should also implement https://tracker.freecadweb.org/view.php?id=2956 where for Linux system the config directory should support XDG |
@yorikvanhavre I would say no. I think it still needs migration (copy config to new location if there aren’t one there already). |
Following a link to the branch on the CI-repository: https://gitlab.com/freecad/FreeCAD-CI/-/commits/PR_4620 The CI-status is available on the latest commit of the branch. https://gitlab.com/freecad/FreeCAD-CI/-/pipelines?scope=branches |
I think this PR is obsolete now. With commit d86a73f
With an older 0.20.26155 I get The old location still seem to get read, though. At least my custom WBs from |
No idea how it's possible that sub-directories of /Users/jonas/Library/Preferences/FreeCAD/Mod are in the sys.path.
The sub-directory for FreeCAD of GenericConfigLocation can be obtained with App.getUserConfigDir() and that of GenericDataLocation with App.getUserAppDataDir(). In the init script sub-directories of App.getUserAppDataDir() are added to the sys.path but I can't see where sub-directories of App.getUserConfigDir() are added. Could it be that in your user.cfg you have set "AdditionalModulePaths"? |
No, "AdditionalModulePaths" doesn't appear anywhere in An older weekly-build app bundle shows this:
A recent self-compiled version, started from the build dir, gives this
|
I also think we can close this. It was a good suggestion at the time, but the context has changed and the proposed fix, a one liner, is not valid anymore. The original author also seem to have abandoned the pull request. |
@hyarion TBH I did somewhat abandon - partially because I fail to just easily build FC to test any changes. But if |
OK, closing it. |
UserAppData
dir on macOS is under~/Library/Preferences/FreeCAD
, but should be under~/Library/Application Support
is reserved for entries created by the macOS preferences system.To migrate from the old behaviour:
Fixes #4596
Forum thread: https://forum.freecadweb.org/viewtopic.php?f=22&t=7104&start=10