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 · 17 comments
Open

MacOS & Linux Support #159

adam-coster opened this issue Sep 20, 2023 · 17 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)

@adam-coster adam-coster moved this to Triage in Stitch Nov 2, 2023
@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

@GiuMagnani
Copy link

Hi! I discovered this extension yesterday and it would be a game changer but I can't seem to get it to work.

I see the pop-up window that the IDE is not installed, I click "yes", but then nothing happens. My game uses the version 2024.8.1.171 (IDE)

I tried changing the version from the Version Picker to 2024.800.0.618 (IDE) and installed that too but I don't see any difference, the popup still appears.

stitch.mp4

Thank you!

@adam-coster
Copy link
Member Author

@GiuMagnani sorry, the auto installer and runner stuff doesn't work on Mac (or Linux). We don't do any development on Mac so I don't have the devices or time to figure it all out. All of the editor features are cross-platform, since they don't have any platform specifics, but the executable features are Windows-only.

@GiuMagnani
Copy link

@adam-coster thanks for the quick reply!

@PoshoDev
Copy link

Hi! I discovered this extension yesterday and it would be a game changer but I can't seem to get it to work.

I see the pop-up window that the IDE is not installed, I click "yes", but then nothing happens. My game uses the version 2024.8.1.171 (IDE)

I tried changing the version from the Version Picker to 2024.800.0.618 (IDE) and installed that too but I don't see any difference, the popup still appears.

stitch.mp4
Thank you!

I was going to open a Q&A Discussion but this is exactly the same problem I'm having. Additionally, clicking on the Stitch: Open in GameMaker button simply throws out these two errors:

Error running command stitch.openIde: No program files directory provided. This is likely caused by the extension that contributes stitch.openIde.
Error running command stitch.run.noDefaults: No program files directory provided. This is likely caused by the extension that contributes stitch.run.noDefaults.

image

By any chance, is there a way to manually define the path for a runtime? I looked everywhere in the extension's setting but it's either not there or I overlooked it. 😅 I remember using GMEdit years ago and it lets you do just that.

@adam-coster
Copy link
Member Author

Unfortunately all of the executable-discovery is done dynamically and doesn't have any overrides. It's a lot of Windows-specific logic. We don't do any development on Mac at all (I don't even have access to one), so I haven't figured out how to make it all work cross-platform.

In principle it wouldn't be that hard to add a setting to specify a runtime path, but I wouldn't be able to test it if I did that.

@PoshoDev
Copy link

@adam-coster Thank you so much for the fast reply. I'd say I'd look into it, but I don't know the first thing about writing VS Code extensions. 😅
Thank you though!

@adam-coster
Copy link
Member Author

@PoshoDev Yeah, this is an ongoing problem -- there are all kinds of things that people in the GameMaker community would like to have in Stitch, but there are several big hurdles to contributing (requires knowledge of Typescript, Node, VSCode APIs) and I can really only work on things needed by my own team.

@PoshoDev
Copy link

@adam-coster It's really okay, what you have already is God's work. I'll definitely give it a go on Windows next chance I have because Stitch is what I've been daydreaming of ever since I started using VS Code like 5~ years ago. Cheers!

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

7 participants