Skip to content
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

MacOS & Linux Support #159

Open
adam-coster opened this issue Sep 20, 2023 · 9 comments
Open

MacOS & Linux Support #159

adam-coster opened this issue Sep 20, 2023 · 9 comments
Labels
✨ feature New feature or request ⌨️ vscode The Stitch extension for VSCode 🆘 help wanted Lower priority for Bscotch, so external help needed to resolve

Comments

@adam-coster
Copy link
Member

adam-coster commented Sep 20, 2023

At our studio we only use Windows for development, so we have neither the means nor the incentive to ensure that Stitch VSCode (or any other Stitch packages) work properly on other operating systems. We'd love to get help from GameMaker community members who want Stitch on those platforms!

While we ourselves won't be able to work on MacOS/Linux support, we still want to be able to keep track of platform-specific issues so that we or others can eventually resolve them. So please post an issue if you run into one!

The large majority of Stitch is built with Node.js and webtech, so it's cross-platform by default. There are some exceptions, though:

  • File locations (e.g. for finding installed GameMaker versions) my yield incorrect (or no) results on other OSes
  • Igor (the GameMaker CLI) calls go through Node's child_process module, and the constructed commands might not work on other OSes
  • Automatic installs of GameMaker are definitely Windows-only
  • The Pixel Checksum package uses Rust to create a compiled binary that definitely only works on Windows. This is a dependency of the SpriteSources feature in the VSCode extension, so that feature is disabled on non-Windows systems.

The order of ops for solving these would be:

  • Automatic installs and Igor calls
    1. Update the releases package to include installer URLs for MacOS and Linux
    2. Update the launcher package to implement automatic GameMaker IDE installs on MacOS & Linux
    3. Update the launcher package to ensure Igor commands work on MacOS & Linux
  • Separate VSCode VSIX builds per platform
    1. Ensure that the pixel-checksum package can be compiled and passes tests on MacOS & Linux
    2. Update the CI workflow for VSCode extension builds to make and publish separate VSIX builds per platform
@adam-coster adam-coster added ✨ feature New feature or request 🆘 help wanted Lower priority for Bscotch, so external help needed to resolve ⌨️ vscode The Stitch extension for VSCode labels Sep 20, 2023
@adam-coster adam-coster pinned this issue Sep 20, 2023
@msvit
Copy link

msvit commented Sep 20, 2023

macOS user here, happy to help, I'll post if I see anything weird going on.

@Meissnerinc
Copy link

Meissnerinc commented Sep 21, 2023

same here, I'll be happy to post anything that comes up! (love this extension btw)

@treenoder
Copy link

Can't we specify directory of GM installation? On Mac vscode shows error when trying to run a project.

Could not find a release of GameMaker v2023.8.2.108 to run this project.

@adam-coster
Copy link
Member Author

@treenoder There are a few things going on here:

  • Stitch uses the Windows release notes to figure out which IDE versions go with which runtime versions, and v2023.8.2.108 is in the Windows release notes. That's why you're getting that particular error message.
  • Stitch has complex logic for dealing with GameMaker IDE versions, since it handles installation of missing versions and caches installs to enable switching between versions without re-installing. There's also a lot of complexity in discovering GameMaker installs, since GameMaker has changed conventions over time and users can override some aspects of GameMaker's default installation behavior. Stitch for VSCode taps into that logic, which makes it not really work for non-Windows systems.

That aside, there's always the option to provide an override. It would need to be checked at the top of this method:

At the end of that method Stitch composes a CLI command for Igor (GameMaker's runner), which probably doesn't work out of the gate on Mac even if we had an option to override the runner path. So that would also need an update.

Which is all to say that getting all of that stuff to work on Mac would take a fair bit of experimenting and discovery!

@Braffolk
Copy link

Braffolk commented Dec 6, 2023

I've forked the repo to attempt to get the VSCode extension to seamlessly work on MacOS. I would really like a proper IDE experience with GML, so I'll see how easy it is to get everything working.

From the list of things, I have got the following working:

  • Update the releases package to include installer URLs for MacOS
  • Update the launcher package to implement automatic GameMaker IDE installs on MacOS

https://github.com/Braffolk/stitch-macos-fork

I haven't done any code cleanup on the additions yet, so it's all experimental and slightly messy. Still becoming familiar with the codebase.

Edit

Nearly everything in the launcher package now works. Runtime selection, running projects, etc. As long as the tests cover everything, of course.

There are some issues though. For older runtimes, they don't have Igor packaged for MacOS. So I'm assuming they used some other script/tool as an entrypoint, which I haven't identified yet.

Another problem is that getting some of the release notes breaks on MacOS, so I had to make the requirement of release notes soft. All Windows releases have notes, but if a Mac release doesn't have a Windows version equivalent to it, then it will link to a non-existing release notes file.

image

@Braffolk
Copy link

Braffolk commented Dec 6, 2023

And the VSCode extension mostly works too now. Downloading IDEs is a bit flaky there, but shouldn't be too hard to fix.

Pixel-checksum and Spritely also work without any issues, although only by all tests passing. Haven't done any further testing.

stitch.on.mac.mov

I don't daily work with Node.js apps, so couldn't figure everything out. For example, the environment variable Mac equivalents of PROGRAMDATA, APPDATA, and PROGRAMFILES aren't added to the compiled package. I've only tested them by adding them to the vscode extension launch config.

For changes and major issues, I've included them in the fork readme.

@adam-coster
Copy link
Member Author

@Braffolk dope, looks like you're making some solid progress here!

Some notes:

  • process.env should be available at runtime in VSCode, so I'm not sure what's going on there. It might be that VSCode on Mac doesn't load those environment variables or something, though then it's weird that it's doing it properly during debugging.
  • If there's anything specific you want my input on, you can make an Issue in your fork with a permalink to the code in question and @ me on it (I'm pretty sure GitHub will notify me in that case)

@Braffolk
Copy link

Braffolk commented Dec 7, 2023

@adam-coster
Thanks! Created one issue there.

I'll also add a short update on the progress:

  • VSCode package creation now works. I set up a GitHub action, which creates the package under releases (for anyone considering, DO NOT run this without your project backed up)
  • Extension can now correctly install new IDEs. This works, although the installation can easily go 5 minutes or longer. Tested on a maxed-out M1 Mac.
  • Since Butterscotch devs only use windows, it seemed like a good idea to set up automatic testing on Github actions with MacOS. When a push happens, all tests are run. I thought of adding automatic reports too (on the action page), but that would require modifying every package.json (adding another run config). Not sure if that's in an acceptable scope

In general, I have reached the point where most of the big changes are done. Now it'll be mostly refactoring and bug hunting.

@Braffolk
Copy link

Braffolk commented Dec 8, 2023

Managed to get the biggest bugs out of the way. The main problematic part was getting Mono-dependent runtimes to work.

Also, for the Github action that runs tests on Mac, I managed to get automatically installing both the IDE and a runtime working. So all tests, except the ones requiring being logged in on the IDE, work. There are two of those that require login.

Also, one sprite-source test fails, but that seems to be a broken test because it points to a non-existing path.

image

https://github.com/Braffolk/stitch-macos-fork/runs/19432937769#r3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feature New feature or request ⌨️ vscode The Stitch extension for VSCode 🆘 help wanted Lower priority for Bscotch, so external help needed to resolve
Projects
Archived in project
Development

No branches or pull requests

5 participants