Skip to content

Conversation

@wrrrzr
Copy link
Contributor

@wrrrzr wrrrzr commented Apr 27, 2025

  • Goal of the PR
    Rename legacy dirs to luanti
  • How does the PR work?
    Renames legacy dirs to luanti
  • Does it resolve any reported issue?
    Minetest → Luanti rename checklist #15322
  • Does this relate to a goal in the roadmap?
    Idk
  • If not a bug fix, why is this PR needed? What usecases does it solve?
    It makes easer dump luanti data on xdg systems

To do

This PR is a Work in Progress.

  • Move linux and bsd systems to xdg spec dirs
  • Move windows and mac to luanti dir
  • Migrate legacy dirs to new in code
  • Move luanti.conf to .config on xdg systems
  • Add info about new dirs in README
  • Test on Linux
  • Test on Windows
  • Test on Mac

How to test

Build luanti without RUN_IN_PLACE and check .local/share/luanti on linux or bsd, or "C\Users<user>\AppData\Roaming\Luanti" on windows or /Users//Library/Application Support/luanti on mac and is exists check legacy dir

@appgurueu appgurueu marked this pull request as draft April 27, 2025 14:22
@Zughy Zughy added Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements @ Engine Core What happens inside the very engine labels Apr 28, 2025
} else {
// TODO: luanti with migration
path_user = std::string(getHomeOrFail())
+ "/Library/Application Support/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, in the case of moving this directory on macOS, the best approach is probably to start using the sandbox app data directory.
It should be more secure and potentially allow us to distribute Luanti via App Store in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, what i need to do?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to use NSHomeDirectory() to get the sandbox path.

com.apple.security.app-sandbox has to be added to plist for macos app (misc/macos/Info.plist.in). Otherwise, NSHomeDirectory() would not work as expected.

@wrrrzr wrrrzr marked this pull request as ready for review August 12, 2025 06:06
@siliconsniffer
Copy link
Contributor

This PR addresses #15382.

Copy link
Contributor

@siliconsniffer siliconsniffer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a core dev, this just resolves the compilation errors.

Additionally, there are two whitespace/newline changes which seem unnecessary.

std::optional<std::string> getPlatformSpecificConfigFile() {
std::string config_home = xdg_get_config_dir();
fs::CreateAllDirs(config_home);
return config_home + DIR_DELIM CONFIGFILE;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return config_home + DIR_DELIM CONFIGFILE;
return config_home + DIR_DELIM + CONFIGFILE;

// glibc-only pretty much
#include <malloc.h>
#endif

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#include "constants.h"

#endif
#if defined(__APPLE__)
#include <mach-o/dyld.h>
#import <Foundation/Foundation.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an Objective-C/C++ framework. It cannot be used in C++ code directly. You have to do an Objective-C++ wrapper, I assume.
Something like porting_ios files in #15451

@Zughy Zughy added the Action / change needed Code still needs changes (PR) / more information requested (Issues) label Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Action / change needed Code still needs changes (PR) / more information requested (Issues) @ Engine Core What happens inside the very engine Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants