Open craigtubb57 opened 6 months ago
Can you see "GMEdit-Constructor" in the list of plugins in your preferences? Also can you see its submenu in the top left hamburger menu?
Can you see "GMEdit-Constructor" in the list of plugins in your preferences?
Yes, albeit with no selectable options - just the usual open; reload.
Also can you see its submenu in the top left hamburger menu?
No. I currently use builder which has Run, Stop, Fork, Clean menu options. Nothing for constructor unfortunately.
Debugging a weird issue now between two people (you being one) on OSX that I can't reproduce on Windows or OSX - did you download Constructor by downloading source code from Releases?
If so, is the folder name GMEdit-Constructor-0.8.1
(or similar?)
... and if so, does renaming it to GMEdit-Constructor
magically fix it?
Back again! Looks like its caused by running GMEdit in Rosetta. GMEdit has a native build for M1, so if you switch over to that you should be all good.
I've also just pushed an update that checks if you're running under Rosetta and bails loading, notifying the user, since it seems to generate a heap of very obscure strange issues.
Let me know if this fixes your problems!
Debugging a weird issue now between two people (you being one) on OSX that I can't reproduce on Windows or OSX - did you download Constructor by downloading source code from Releases?
No actually I cloned this repo into the plugins directory, just like I did with builder :)
If so, is the folder name
GMEdit-Constructor-0.8.1
(or similar?)
It is named "GMEdit-Constructor".
... and if so, does renaming it to
GMEdit-Constructor
magically fix it?
Nope, see above :)
Back again! Looks like its caused by running GMEdit in Rosetta. GMEdit has a native build for M1, so if you switch over to that you should be all good.
Ah, that won't be my problem then as I do not have an M1 machine. Apologies, I should have included that info: MacBook Pro 15-inch 2018 (2.6 GHz 6-Core Intel Core i7)
I've also just pushed an update that checks if you're running under Rosetta and bails loading, notifying the user, since it seems to generate a heap of very obscure strange issues.
So this should do nothing in my case right?
I just tried the new version and discovered the Dev Tools at the same time. Saw an error related to that Rosetta check code:
Uncaught (in promise) Error: Command failed: sysctl -n sysctl.proc_translated
sysctl: unknown oid 'sysctl.proc_translated'
at checkExecSyncError (node:child_process:835:11)
at execSync (node:child_process:909:15)
at rosetta_check (GMConstructor.js:230:20)
at Function.create (GMConstructor.js:155:13)
at load (init.js:20:52)
at async Object.init (init.js:25:13)
I just tried the new version and discovered the Dev Tools at the same time. Saw an error related to that Rosetta check code:
Uncaught (in promise) Error: Command failed: sysctl -n sysctl.proc_translated sysctl: unknown oid 'sysctl.proc_translated' at checkExecSyncError (node:child_process:835:11) at execSync (node:child_process:909:15) at rosetta_check (GMConstructor.js:230:20) at Function.create (GMConstructor.js:155:13) at load (init.js:20:52) at async Object.init (init.js:25:13)
Whoops, my bad on that one. Need to add in a flag to that command so it doesn't error if you don't have that value.
Debugging a weird issue now between two people (you being one) on OSX that I can't reproduce on Windows or OSX - did you download Constructor by downloading source code from Releases?
No actually I cloned this repo into the plugins directory, just like I did with builder :)
If so, is the folder name
GMEdit-Constructor-0.8.1
(or similar?)It is named "GMEdit-Constructor".
... and if so, does renaming it to
GMEdit-Constructor
magically fix it?Nope, see above :)
Back again! Looks like its caused by running GMEdit in Rosetta. GMEdit has a native build for M1, so if you switch over to that you should be all good.
Ah, that won't be my problem then as I do not have an M1 machine. Apologies, I should have included that info: MacBook Pro 15-inch 2018 (2.6 GHz 6-Core Intel Core i7)
I've also just pushed an update that checks if you're running under Rosetta and bails loading, notifying the user, since it seems to generate a heap of very obscure strange issues.
So this should do nothing in my case right?
Interesting with all that - I made a bunch of assumptions as I was debugging the exact same set of symptoms for someone on an M1 running in Rosetta (which turned out to be the reason). Thanks for being patient on this, I might have to dig out an old x86 Mac to see if something's just up on there in general, and not Rosetta's fault.
The main oddities we found was that:
x64
folder (process.arch
being that under Rosetta) rather than correctly arm64
for M1The first of those caused the weird behaviour with the preferences area not loading, and the second caused it to not find any runtimes.
Interesting with all that - I made a bunch of assumptions as I was debugging the exact same set of symptoms for someone on an M1 running in Rosetta (which turned out to be the reason). Thanks for being patient on this, I might have to dig out an old x86 Mac to see if something's just up on there in general, and not Rosetta's fault.
The main oddities we found was that:
- Dots in the path of the plugin name caused it to not resolve imports properly
- It failed to verify any runtime names because it was looking for the Igor executable under an
x64
folder (process.arch
being that under Rosetta) rather than correctlyarm64
for M1The first of those caused the weird behaviour with the preferences area not loading, and the second caused it to not find any runtimes.
No problem and don't treat this as too urgent as I still have builder :)
Anything I can do to help debug it? Can it be run in a dev environment / are there any automated tests for it anywhere?
Dev environment is my deskop or my laptop :p
Not too much you can do at the moment unless you're willing to throw log statements everywhere to see what's going on - I did the exact same process when debugging for the person with Rosetta but deleted that branch (probably shouldn't have in hindsight...)
I'm not gonna ask you to do that though unless you're feeling curious and have time to burn, so it'll be a while before I get a moment to check this on my end unfortunately.
As for points 1 and 2:
Lastly though, since you cloned the repo, feel free to jump over to the dev (bettor-igor-use
) branch since that's currently functional and has some changes to how some of this stuff is handled, case that magically fixes it.
Do note though whatever the case that error in rosetta_check
is gonna be halting launch completely so as you're in native feel free to just replace the function body with return false
.
Cheers, I'l try some stuff :)
So I switched to the 'better-igor-use' branch and returned 'false' for the Rosetta check and did get an Output window this time. Could be a misdirection but it seems to lack permission to access the various properties files. Perhaps a flag is missing from the Igor invocation?
This output is from pressing F5. The game did not run after this, which I think it's supposed to?
/Users/Shared/GameMakerStudio2/Cache/runtimes/runtime-2023.8.2.152/bin/igor/osx/x64/Igor /project=<<project_path>>/<<project_name>>.yyp /config=Default /rp=/Users/Shared/GameMakerStudio2/Cache/runtimes/runtime-2023.8.2.152 /runtime=VM Mac Run
Options: /Users/Shared/GameMakerStudio2/Cache/runtimes/runtime-2023.8.2.152/bin/platform_setting_defaults.json
Options: <<project_path>>/local_settings.json
Failed to load Options from <<project_path>>/local_settings.json
Setting up the Asset compiler
System.UnauthorizedAccessException: Access to the path '<<project_path>>/cache/<<project_name>>/<<project_name>>/Default' is denied.
---> System.IO.IOException: Permission denied
--- End of inner exception stack trace ---
at System.IO.FileSystem.CreateDirectory(String fullPath)
at System.IO.Directory.CreateDirectory(String path)
at YoYoStudio.Resources.FileIO.<>c.<SetDefaultFileFunctions>b__54_13(String _path) in /home/runner/work/GameMaker/GameMaker/GameMaker/Runner/GMAssetCompiler/CoreResources/FileIO/FileIO.cs:line 251
Found Project Format 2
(5,30): GMSC Error: Unexpected JSON property 'option_ios_build_number'.
+++ ORIGINAL SERIALISATION SUCCESSFUL LOAD AND LINK TIME: 606.612ms
Loaded Project: <<project_name>>
finished.
Found Project Format 2
+++ FAST SERIALISATION SUCCESSFUL LOAD AND LINK TIME (with worker concurrency 8): 43.017ms
Loaded Project: __yy_sdf_shader
finished.
Found Project Format 2
+++ FAST SERIALISATION SUCCESSFUL LOAD AND LINK TIME (with worker concurrency 8): 32.765ms
Loaded Project: __yy_sdf_effect_shader
finished.
Found Project Format 2
+++ FAST SERIALISATION SUCCESSFUL LOAD AND LINK TIME (with worker concurrency 8): 29.858ms
Loaded Project: __yy_sdf_blur_shader
finished.
Found Project Format 2
+++ FAST SERIALISATION SUCCESSFUL LOAD AND LINK TIME (with worker concurrency 8): 34.224ms
Loaded Project: _filter_vignette
finished.
Found Project Format 2
+++ FAST SERIALISATION SUCCESSFUL LOAD AND LINK TIME (with worker concurrency 8): 33.506ms
Loaded Project: GMPresetParticles
finished.
System.UnauthorizedAccessException: Access to the path '<<project_path>>/cache/<<project_name>>/PlatformOptions.json' is denied.
---> System.IO.IOException: Permission denied
--- End of inner exception stack trace ---
at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream fileStream, String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
at System.IO.StreamWriter.ValidateArgsAndOpenPath(String path, Boolean append, Encoding encoding, Int32 bufferSize)
at System.IO.File.WriteAllText(String path, String contents)
at YoYoStudio.Resources.FileIO.<>c.<SetDefaultFileFunctions>b__54_4(String _path, String _data) in /home/runner/work/GameMaker/GameMaker/GameMaker/Runner/GMAssetCompiler/CoreResources/FileIO/FileIO.cs:line 242
System.UnauthorizedAccessException: Access to the path '<<project_path>>/cache/<<project_name>>/MainOptions.json' is denied.
---> System.IO.IOException: Permission denied
--- End of inner exception stack trace ---
at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream fileStream, String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
at System.IO.StreamWriter.ValidateArgsAndOpenPath(String path, Boolean append, Encoding encoding, Int32 bufferSize)
at System.IO.File.WriteAllText(String path, String contents)
at YoYoStudio.Resources.FileIO.<>c.<SetDefaultFileFunctions>b__54_4(String _path, String _data) in /home/runner/work/GameMaker/GameMaker/GameMaker/Runner/GMAssetCompiler/CoreResources/FileIO/FileIO.cs:line 242
System.UnauthorizedAccessException: Access to the path '<<project_path>>/cache/<<project_name>>/ExtensionOptions.json' is denied.
---> System.IO.IOException: Permission denied
--- End of inner exception stack trace ---
at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream fileStream, String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
at System.IO.StreamWriter.ValidateArgsAndOpenPath(String path, Boolean append, Encoding encoding, Int32 bufferSize)
at System.IO.File.WriteAllText(String path, String contents)
at YoYoStudio.Resources.FileIO.<>c.<SetDefaultFileFunctions>b__54_4(String _path, String _data) in /home/runner/work/GameMaker/GameMaker/GameMaker/Runner/GMAssetCompiler/CoreResources/FileIO/FileIO.cs:line 242
Release build
Options: <<project_path>>/cache/<<project_name>>/PlatformOptions.json
Failed to load Options from <<project_path>>/cache/<<project_name>>/PlatformOptions.json
The given key (option_mac_output_dir) was not present in the dictionary.
Igor complete.
(project path and name obfuscated).
So I'm pretty sure this is related to that PlatformOptions.json
file. On my system that file always exists as it should be generated by the IDE anyway. Would you mind checking if its actually there, and if so, what permissions it has?
Only ideas really are that for some reason either it doesn't exist or Igor spawned by GMEdit doesn't have read permissions, which doesn't really make sense.
I've also just pushed the latest update to main - this doesn't really affect what's going on here but it does mean the better-igor-use
branch is now gone.
So I'm pretty sure this is related to that
PlatformOptions.json
file. On my system that file always exists as it should be generated by the IDE anyway. Would you mind checking if its actually there, and if so, what permissions it has?Only ideas really are that for some reason either it doesn't exist or Igor spawned by GMEdit doesn't have read permissions, which doesn't really make sense.
This appears to be correct. And the reason for that I believe is my cache exists in a different location, and that's where GameMaker is generating that, and other, files. Pretty sure I didn't choose the location of my cache in GameMaker settings and it's just out-of-the-box, but I could be wrong. It's not a path I would have thought to choose myself tbh.
So tl;dr suggested solution:
I was going to have a go myself but I need to head out today. Might get a chance later but I'm not too familiar with JS/TS so not sure how successful I'll be.
I grabbed the call to Igor from GameMaker and compared it to how Constructor is calling it:
GM:
"/Users/Shared/GameMakerStudio2/Cache/runtimes/runtime-2023.11.1.160/bin/igor/osx/x64/Igor" -j=8 -options="/tmp/GameMakerStudio2/GMS2TEMP/build.bff" -v -- Mac Run
Constructor:
"/Users/Shared/GameMakerStudio2/Cache/runtimes/runtime-2023.8.2.152/bin/igor/osx/x64/Igor" /project=<<project_path>>/<<project_name>>/<<project_name>>.yyp /config=Demo /rp=/Users/Shared/GameMakerStudio2/Cache/runtimes/runtime-2023.8.2.152 /runtime=VM Mac Run
(-v doesn't appear to be documented here, and neither is -options, so that's fun. Perhaps they are standard Windows executable things?)
GameMaker passes an options file argument so I pulled the relevant ones out for comparison:
GM: /project=<<project_path>>/<<project_name>>/<<project_name>>.yyp
Constructor: "projectPath": "<<project_path>>/<<project_name>>/<<project_name>>.yyp"
GM: . /config=Default
Constructor: "config": "Default"
GM: /rp=/Users/Shared/GameMakerStudio2/Cache/runtimes/runtime-2023.8.2.152
Constructor: "runtimeLocation": "/Users/Shared/GameMakerStudio2/Cache/runtimes/runtime-2023.11.1.160"
GM: /runtime=VM
Constructor: {default}
(Don't you just love how inconsistent the naming is between the options file and the Igor arguments. Classic GameMaker.)
It seems Constructor was grabbing an older runtime from my runtimes directory. I hadn't actually chosen one in preferences so perhaps this could be tweaked to look for a more recent file too. I have since deleted the old versions and chosen the newest in Constructor preferences.
That all seems generally fine but no mention of where that PlatformOptions file is yet. Here's the full options file GameMaker is using:
{
"targetFile": " ",
"assetCompiler": "",
"debug": "False",
"rerun": "False",
"compile_output_file_name": "/tmp/GameMakerStudio2/GMS2TEMP/<<project_name>>_43A36491_VM/<<project_name>>.win",
"useShaders": "True",
"steamOptions": "/Users/<<user>>/.config/GameMakerStudio2/Cache/GMS2CACHE/<<partial_project_name>>_EB9C1123_F1E7ABF0/steam_options.yy",
"config": "Default",
"configParents": "",
"outputFolder": "/tmp/GameMakerStudio2/GMS2TEMP/<<project_name>>_43A36491_VM",
"projectName": "<<project_name>>",
"macros": "/Users/<<user>>/.config/GameMakerStudio2/Cache/GMS2CACHE/<<partial_project_name>>_EB9C1123_F1E7ABF0/macros.json",
"projectDir": "<<project_path>>/<<project_name>>",
"preferences": "/Users/<<user>>/.config/GameMakerStudio2/Cache/GMS2CACHE/<<partial_project_name>>_EB9C1123_F1E7ABF0/preferences.json",
"projectPath": "<<project_path>>/<<project_name>>/<<project_name>>.yyp",
"tempFolder": "/tmp/GameMakerStudio2/GMS2TEMP",
"tempFolderUnmapped": "/tmp/GameMakerStudio2/GMS2TEMP",
"userDir": "/Users/<<user>>/.config/GameMakerStudio2/<<yoyo_user>>_31063",
"runtimeLocation": "/Users/Shared/GameMakerStudio2/Cache/runtimes/runtime-2023.11.1.160",
"targetOptions": "/Users/<<user>>/.config/GameMakerStudio2/Cache/GMS2CACHE/<<partial_project_name>>_EB9C1123_F1E7ABF0/targetoptions.json",
"targetMask": "2",
"applicationPath": "/Applications/GameMaker.app/Contents/MacOS/x86_64/GameMaker.dll",
"verbose": "False",
"helpPort": "51290",
"debuggerPort": "6509"
}
There's some options here that tell us Igor is looking in a different cache location when run with GameMaker:
"steamOptions": "/Users/<<user>>/.config/GameMakerStudio2/Cache/GMS2CACHE/<<partial_project_name>>_EB9C1123_F1E7ABF0/steam_options.yy",
"macros": "/Users/<<user>>/.config/GameMakerStudio2/Cache/GMS2CACHE/<<partial_project_name>>_EB9C1123_F1E7ABF0/macros.json",
"preferences": "/Users/<<user>>/.config/GameMakerStudio2/Cache/GMS2CACHE/<<partial_project_name>>_EB9C1123_F1E7ABF0/preferences.json",
"targetOptions": "/Users/<<user>>/.config/GameMakerStudio2/Cache/GMS2CACHE/<<partial_project_name>>_EB9C1123_F1E7ABF0/targetoptions.json",
No specific mention of PlatformOptions or the cache location itself (maybe it's working it out?) but I would hope passing the /cache
argument would do the job. I remember messing with Igor a while back in order to compile and push to itch.io with a command and I do recall using this argument and it working.
For completeness I also grabbed the subsequent call to AssetCompiler that Igor is doing when run with GameMaker, in case you can see what Constructor is ultimately invoking, and it's useful to compare:
/Users/Shared/GameMakerStudio2/Cache/runtimes/runtime-2023.11.1.160/bin/assetcompiler/osx/x64/GMAssetCompiler.dll /c /mv=1 /zpex /iv=0 /rv=0 /bv=0 /j=8 /gn="<<project_name>>" /td="/tmp/GameMakerStudio2/GMS2TEMP" /cd="/Users/<<user>>/.config/GameMakerStudio2/Cache/GMS2CACHE/<<partial_project_name>>_EB9C1123_F1E7ABF0" /rtp="/Users/Shared/GameMakerStudio2/Cache/runtimes/runtime-2023.11.1.160" /zpuf="/Users/<<user>>/.config/GameMakerStudio2/<<yoyo_user>>_31063" /ffe="d3t+fjZrf25zeTdwgjZ5em98a3GCN4ODbTZzeH5vdnZzfW94fW82eH92dnN9cjZ2eXFzeGl9fXk2fm99fjZtf31+eXdpb3iANnBzdn41cII2cYJpd3luaYFrdnZ6a3pvfDZxgml3eW5pcWt3b31+fHN6NnZzgG9pgWt2dnprem98aX1/bH1tfHN6fnN5eA==" /m=mac /tgt=2 /nodnd /cfg="Demo" /o="/tmp/GameMakerStudio2/GMS2TEMP/<<project_name>>_382145DB_VM" /sh=True /optionsini="/tmp/GameMakerStudio2/GMS2TEMP/<<project_name>>_382145DB_VM/options.ini" /cvm /baseproject="/Users/Shared/GameMakerStudio2/Cache/runtimes/runtime-2023.11.1.160/BaseProject/BaseProject.yyp" "<<project_path>>/<<project_name>>/<<project_name>>.yyp"
Hello again! It's been a very long time - sorry about that, lot of school work and other stuff's had my attention since - but if you're still willing to give Constructor another go, v0.9.4 fixed an issue where Igor's stderr
output was being lost. I'm not sure whether that'll come into this one or not, but it might be worth a shot to see if there's some error that's being lost that might give more information on what exactly was going wrong.
No problem, gotta focus on life's priorities :)
Thanks though, I shall give that version a go and see what happens!
So I've tried this and I get the output window displaying nicely so that's all a big improvement there :)
I still have the same errors though, and I realised that ultimately Igor cannot write to the project cache directory in one of the first steps:
Setting up the Asset compiler
System.UnauthorizedAccessException: Access to the path '<<project_path>>/cache/<<project_name>>/<<project_name>>/<<profile_name>>' is denied.
---> System.IO.IOException: Permission denied
--- End of inner exception stack trace ---
at System.IO.FileSystem.CreateDirectory(String fullPath)
at System.IO.Directory.CreateDirectory(String path)
at YoYoStudio.Resources.FileIO.<>c.<SetDefaultFileFunctions>b__54_13(String _path) in /home/runner/work/GameMaker/GameMaker/GameMaker/Runner/GMAssetCompiler/CoreResources/FileIO/FileIO.cs:line 251
Out of curiosity, I'd like to see if YYC works for you as it has just been added in the latest release, and as a part of getting it working Igor is passed the flag to disable the cache, which may incidentally fix the issue, or at least narrow down exactly what's wrong further.
Also, what permissions are set on your project folder? Could try a recursive chmod 777
on it just to see if that makes Igor happy.
Hi, sorry I've had a really busy couple of weeks and only just got to try this.
Unfortunately, results are identical to before. In fact I get an identical error output regardless of if I choose Clean
, Compile
or Run
.
I have tried VM
and YYC
using both Stable
and LTS
runtimes.
While the chmod option obviously isn't a permanent solution I tried it anyway (chmod -R 777 ./
specifically) and got the following output:
chmod: Unable to change file mode on ./cache/{project_name}: Operation not permitted
chmod: Unable to change file mode on ./output/{project_name}: Operation not permitted
So it seems the cache isn't being disabled at all. In fact I still do think the opposite solution is needed, where a cache location can be passed to Igor (which I think is one of the flags?) because Igor is looking for project files such as PlatformOptions.json
in a different location to where they actually exist on my system:
GameMaker:
Options: /{user_path}/.config/GameMakerStudio2/Cache/GMS2CACHE/{partial_project_page}_EB9C1123_F1E7ABF0/PlatformOptions.json
(The EB9C1123_F1E7ABF0
above is randomly generated each compile)
Constructor:
Options: /{user_path}/dev/gamemaker/{project_name}/cache/{project_name}/PlatformOptions.json
OS: macOS Ventura 13.6.3 GMEdit version: GMEdit-Mac, 6 Sep 2023 GMEdit-Cnnstructor version: v0.8.1
Pressing F5 just makes the cursor invisible and nothing appears to happen.
Also tried other shortcuts such as Ctrl + F5, Cmd + F5 to the same effect.
Looked for manual Compile and Run options in menus so I can check if its just shortcuts or the commands to Igor but can't see anything unfortunately.