Skip to content

Add support for LUANTI_GAME_PATH and LUANTI_WORLD_PATH#16816

Merged
sfan5 merged 2 commits intoluanti-org:masterfrom
apteryks:add-support-for-luanti-environment-variables
Mar 11, 2026
Merged

Add support for LUANTI_GAME_PATH and LUANTI_WORLD_PATH#16816
sfan5 merged 2 commits intoluanti-org:masterfrom
apteryks:add-support-for-luanti-environment-variables

Conversation

@apteryks
Copy link
Contributor

@apteryks apteryks commented Jan 8, 2026

  • src/content/subgames.cpp (getSubgamePathEnv): Deprecate MINETEST_SUBGAME_PATH in favor of LUANTI_GAME_PATH. (getWorldPathEnv): Deprecate MINETEST_WORLD_PATH in favor of LUANTI_WORLD_PATH.

Add compact, short information about your PR for easier understanding:

  • Goal of the PR: Use LUANTI named environment variables, upstreaming a patch used in Guix.
  • How does the PR work? Tested with Guix; it works well.
  • Does it resolve any reported issue? No.
  • Does this relate to a goal in the roadmap? No.
  • If not a bug fix, why is this PR needed? What usecases does it solve?
    Naming consistency.
  • If you have used an LLM/AI to help with code or assets, you must disclose this.
    This change was authored not by me but by Liliana Marie Prikler; as far as I know they haven't used AI to author it.

To do

This PR is a Ready for Review.

How to test

I'm testing in an environment set up by Guix, via e.g.:

$ LUANTI_GAME_PATH=/home/maxim/.guix-profile/share/luanti/games LUANTI_WORLD_PATH='/tmp/worlds' luanti --verbose
# or 
$ MINETEST_GAME_PATH=/home/maxim/.guix-profile/share/luanti/games MINETEST_WORLD_PATH='/tmp/worlds' luanti --verbose

@wsor4035 wsor4035 added @ Startup / Config / Util @ Engine Core What happens inside the very engine and removed @ Engine Core What happens inside the very engine labels Jan 8, 2026
@apteryks apteryks force-pushed the add-support-for-luanti-environment-variables branch from ac625ee to 79ddbc4 Compare January 8, 2026 04:12
@apteryks apteryks requested a review from cx384 January 8, 2026 04:13
@Zughy Zughy added the Action / change needed Code still needs changes (PR) / more information requested (Issues) label Jan 8, 2026
@apteryks apteryks force-pushed the add-support-for-luanti-environment-variables branch from 79ddbc4 to ae31211 Compare January 9, 2026 01:38
@apteryks apteryks requested a review from sfan5 January 9, 2026 01:38
@cx384 cx384 removed the Action / change needed Code still needs changes (PR) / more information requested (Issues) label Jan 9, 2026
@SmallJoker
Copy link
Member

I took the liberty to reformat the code a bit to make similar functions look similar. However, please also document these environment variables in doc/luanti.6.

@apteryks apteryks force-pushed the add-support-for-luanti-environment-variables branch from 1c91504 to 9b500bb Compare January 12, 2026 01:50
@apteryks
Copy link
Contributor Author

I took the liberty to reformat the code a bit to make similar functions look similar. However, please also document these environment variables in doc/luanti.6.

Done, and doing so I noticed about MINETEST_USER_PATH, so I've adjusted that to LUANTI_USER_PATH (with supporting code) as well. Thanks for the review!

@apteryks apteryks force-pushed the add-support-for-luanti-environment-variables branch from 9b500bb to a52414c Compare January 12, 2026 02:00
@apteryks apteryks force-pushed the add-support-for-luanti-environment-variables branch from a52414c to 6013ae6 Compare January 12, 2026 13:59
@apteryks apteryks requested a review from sfan5 January 13, 2026 03:32
@Zughy Zughy added the Action / change needed Code still needs changes (PR) / more information requested (Issues) label Jan 17, 2026
@apteryks apteryks force-pushed the add-support-for-luanti-environment-variables branch from 6013ae6 to c58156f Compare January 17, 2026 11:22
@apteryks apteryks requested a review from sfan5 January 17, 2026 11:22
@Zughy Zughy removed the Action / change needed Code still needs changes (PR) / more information requested (Issues) label Jan 18, 2026
@apteryks apteryks force-pushed the add-support-for-luanti-environment-variables branch from c58156f to ce84b79 Compare January 27, 2026 00:26
@apteryks apteryks requested a review from nerzhul January 27, 2026 00:28
Copy link
Member

@sfan5 sfan5 left a comment

Choose a reason for hiding this comment

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

LGTM otherwise

Also fix duplicate warnings and an off-by-one issue in the win32 code.

* src/content/subgames.cpp (getSubgamePathEnv): Deprecate
MINETEST_SUBGAME_PATH in favor of LUANTI_GAME_PATH.
(getWorldPathEnv): Deprecate MINETEST_WORLD_PATH in favor of
LUANTI_WORLD_PATH.
(getEnvModPaths): Deprecate MINETEST_MOD_PATH in favor of
LUANTI_MOD_PATH.
* src/porting.cpp (setSystemPaths): Deprecate MINETEST_USER_PATH in favor of
LUANTI_USER_PATH.
[win32]: Fix off-by-one issue in GetEnvironmentvariable length check.
* doc/luanti.6: Update doc.
* doc/world_format.md: Likewise.
* src/content/subgames.h: Likewise.
* src/unittest/test_servermodmanager.cpp
(TestServerModManager::runTests): Adjust to use LUANTI_ prefixed
environment variables.

Co-authored-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
Co-authored-by: SmallJoker
@apteryks apteryks force-pushed the add-support-for-luanti-environment-variables branch from ce84b79 to 1bcde7e Compare March 7, 2026 01:39
Copy link
Member

@SmallJoker SmallJoker left a comment

Choose a reason for hiding this comment

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

LGTM

@sfan5 sfan5 merged commit 7aeedef into luanti-org:master Mar 11, 2026
19 checks passed
@apteryks
Copy link
Contributor Author

Thanks, everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants