On Sun, Aug 13, 2023 at 11:28:14PM +0200, Omar Polo wrote:

[...]

> > This fixes returning to the project manager when quitting the editor
> > with Shift-Ctrl-Q or menu Project -> Quit to Project List. (Without
> > this patch what happens is that it will just abort with an error about
> > not finding its binary, rather than returning to the project manager.)
> 
> I'm sad of going back on this.  I still have a PR open upstream and
> still believe that one day it'll be merged.  (uptream cares about
> portability and has already merged patches from us to fix things.)
> 
> Godot currently does something incredibly stupid to get the path for
> its executable, but since upstream cares about portability I'd prefer
> to have it fixed there in a portable manner rather than going back to
> hardcoding paths.  (they never noticed because there's specialized
> code for linux/freebsd/macos/windows and they were lucky that it never
> failed since the portable code is used as fallback.)
> 
> I'd prefer to investigate on what goes wrong in the scenario you're
> describing and fixing it.  (I'm not asking you to debug it, I'll try
> to reproduce and figure out what's going wrong.)
> 
> My wish for Godot would be for it to build out-of-the-box on OpenBSD
> without the port tree.

I apologize, that error that I observed must have been from something
that I can't reproduce anymore. I've tried the 3.5.2p2 package from my
package mirror, and also a build without the hard-coded binary paths
and everything is working without a patch.

So I would say let's better leave this alone, even if it's not entirely
clear to me how Godot solved the problem...

[...]

> not against these patches.  godot can be pretty chatty :-)
> 
> should we also report this upstream?  I'm slightly worried that once
> these will be fixed upstream we'll still be carring these changes
> locally...

I submitted a PR: https://github.com/godotengine/godot/pull/80600

New diff with only the verbosity changes. Ok?

Index: Makefile
===================================================================
RCS file: /cvs/ports/games/godot/Makefile,v
retrieving revision 1.48
diff -u -p -r1.48 Makefile
--- Makefile    13 Aug 2023 12:34:23 -0000      1.48
+++ Makefile    14 Aug 2023 02:14:43 -0000
@@ -7,7 +7,7 @@ V =             3.5.2
 GODOTSTEAM_V = v3.20
 DISTNAME =     godot-${V}-stable
 PKGNAME =      godot-${V}
-REVISION =     4
+REVISION =     5
 
 CATEGORIES =   games
 
Index: patches/patch-core_object_cpp
===================================================================
RCS file: patches/patch-core_object_cpp
diff -N patches/patch-core_object_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-core_object_cpp       14 Aug 2023 02:14:43 -0000
@@ -0,0 +1,19 @@
+when building without tools, don't warn about leaked instances at exit unless 
'--verbose'
+
+Index: core/object.cpp
+--- core/object.cpp.orig
++++ core/object.cpp
+@@ -2067,8 +2067,13 @@ RWLock ObjectDB::rw_lock;
+ void ObjectDB::cleanup() {
+       rw_lock.write_lock();
+       if (instances.size()) {
++#ifdef TOOLS_ENABLED
+               WARN_PRINT("ObjectDB instances leaked at exit (run with 
--verbose for details).");
++#endif
+               if (OS::get_singleton()->is_stdout_verbose()) {
++#ifndef TOOLS_ENABLED
++                      WARN_PRINT("ObjectDB instances leaked at exit.");
++#endif
+                       // Ensure calling the native classes because if a 
leaked instance has a script
+                       // that overrides any of those methods, it'd not be OK 
to call them at this point,
+                       // now the scripting languages have already been 
terminated.
Index: patches/patch-core_resource_cpp
===================================================================
RCS file: patches/patch-core_resource_cpp
diff -N patches/patch-core_resource_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-core_resource_cpp     14 Aug 2023 02:14:43 -0000
@@ -0,0 +1,20 @@
+when building without tools, don't display error about resources still in use 
at
+exit unless '--verbose'
+
+Index: core/resource.cpp
+--- core/resource.cpp.orig
++++ core/resource.cpp
+@@ -414,8 +414,13 @@ RWLock ResourceCache::path_cache_lock;
+ 
+ void ResourceCache::clear() {
+       if (resources.size()) {
++#if defined(TOOLS_ENABLED)
+               ERR_PRINT("Resources still in use at exit (run with --verbose 
for details).");
++#endif
+               if (OS::get_singleton()->is_stdout_verbose()) {
++#ifndef TOOLS_ENABLED
++              ERR_PRINT("Resources still in use at exit (run with --verbose 
for details).");
++#endif
+                       const String *K = nullptr;
+                       while ((K = resources.next(K))) {
+                               Resource *r = resources[*K];

Reply via email to