- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 23.5k
 
Disable some unsafe CLI arguments in template builds by default. #111909
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
base: master
Are you sure you want to change the base?
Conversation
315fea8    to
    80df9d7      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, it works as expected.
However, I'd make the existing arguments print an error when run, so that it doesn't fail silently like it currently does:
$ path/to/template --path ~/d/3d/truck_town/
Error: Couldn't load project data at path ".". Is the .pck file missing?
If you've renamed the executable, the associated .pck file should also be renamed to match the executable's name (without the extension).
See an example of this here:
Lines 932 to 934 in 9cd297b
| ERR_PRINT( | |
| "`--test` was specified on the command line, but this Godot binary was compiled without support for unit tests. Aborting.\n" | |
| "To be able to run unit tests, use the `tests=yes` SCons option when compiling Godot.\n"); | 
Also, note that if you cd to a project folder (not a PCK), you can still run it directly with an export template binary:
$ ~/d/3d/platformer: ~/g/bin/godot.linuxbsd.template_release.x86_64
Therefore, I'm not sure the CWD handling is working correctly.
(Moving or symlinking the binary to the project folder and running it there will keep working, but I think that part is to be expected.)
| 
           Note that this PR will impact https://github.com/GodotModding/godot-mod-loader due to the removal of  godotengine/godot-proposals#6137 could make this possible using   | 
    
          
 There's already a way to use it without any changes (see comment in the proposal), which looks a bit hacky but should work.  | 
    
          
 Seems like   | 
    
185db44    to
    92da720      
    Compare
  
    92da720    to
    6f3f97e      
    Compare
  
    | 
           Some notes: Options disabled by  
 Options disabled in release templates: 
  | 
    
          
 Yeah that's a legacy option, it lets you run a Godot project while in a subfolder by looking up the  Let's keep it for now but deprecated (printing a warning about it), so if users rely on it in some scripts, they'll have until 4.7 to adapt their scripts, and we can drop it then. Edit: Actually scratch that, let's just drop it straight and document it in the migration guide. It's simple enough to work around when upgrading.  | 
    
          
 Actually, it is used for a bunch (GLTF, DDS, GDScript) of unit tests (which make sense, tests are upwards of   | 
    
6f3f97e    to
    29da942      
    Compare
  
    | 
           Removed   | 
    
Follow up to #108818
Splits
disable_overridesinto two:disable_overrides- disabled by default, only affect project config override (which can be also disabled via project setting).disable_path_overrides- enabled by default, disables project path/pack overrides and script CLI arguments, and forces PCK/project loading from executable or resource directory instead of CWD to ensure only project files bundled with executable are loaded.