pkulchenko / ZeroBraneStudio

Lightweight Lua-based IDE for Lua with code completion, syntax highlighting, live coding, remote debugger, and code analyzer; supports Lua 5.1, 5.2, 5.3, 5.4, LuaJIT and other Lua interpreters on Windows, macOS, and Linux

Home Page:http://studio.zerobrane.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Studio .app crashes on M1, Sonoma beta

rtgoodwin opened this issue · comments

I was unable to get the .app to work, nor my various twiddlings to try and get a new .app built with the various scripts; under Rosetta terminal or native, the .app just bounces in the dock and dies.

I was able to get master running from the src folder with:

  • brew installed lua53
  • luarocks
  • luarocks installed socket
  • either luarocks or brew installed wxlua, i forget (I'm fairly new to Lua, so I'm not super familiar with where things are looking for linked libraries and so on)

It's truly an impressive project and TBH I started tinkering just to debug Hammerspoon scripts, but now I'm a bit agog at how you can run a fast powerful IDE right from the source...so consider my interests piqued! :)

If you could give guidance on building the .app up from scratch from the source repo, I'm happy to do the steps and report back if it solves the issue. Alternately, anything you might like me to capture (within reason, again this being a deployed machine I can only provide certain data/logs from).

@rtgoodwin, thank you for the report. Just to confirm, (1) you were not able to run the app from the current master branch on M1 under Sonoma beta, but (2) you were able to run it with lua53, luasocket and wxlua installed?

Can you try running bin/lua src/main.lua and report anything in the output back? Has it ever started before on that macOS version. I've tested the master branch on Ventura without any issues, so am curious if this is related to the new macOS version or something else.

@rtgoodwin, I can confirm the issue, but there doesn't seem to be anything I can do (or at least nothing obvious), as the application works on Ventura, but not on the current beta of Sonoma. I also tested on a much simpler application using wxlua with the same result, so it doesn't seem to be directly related to the IDE code.

I submitted a report to Apple and will continue to investigate, but I'd wait for the the next beta or the release version to see if the issue still persists. I'll update the ticket if I get any additional information on this.

Just to confirm on the second question: are you saying it worked for you with wxlua from brew? If it did, what version of wxwidgets/wxlua was that?

To the first question:

❯ bin/lua src/main.lua
zsh: segmentation fault  bin/lua src/main.lua

With brew lua it seems to run fine (how I used it) but does throw the error you see below when exiting:

❯ lua -v
Lua 5.4.6  Copyright (C) 1994-2023 Lua.org, PUC-Rio

❯ lua src/main.lua
./src/osx/carbon/clipbrd.cpp(64): assert ""m_open"" failed in Flush(): clipboard not open
Collecting stack trace information, please wait...zsh: trace trap  lua src/main.lua

To the second, unless I'm forgetting something, this is from brew list | grep wx:

==> wxlua: stable 3.2.0.2 (bottled), HEAD
Lua bindings for wxWidgets cross-platform GUI toolkit
https://github.com/pkulchenko/wxlua
/opt/homebrew/Cellar/wxlua/3.2.0.2 (128 files, 19.3MB) *
  Poured from bottle on 2023-08-24 at 21:09:52
License: LGPL-2.0-or-later with WxWindows-exception-3.1
==> Dependencies
Build: cmake ✔
Required: lua ✔, wxwidgets ✔
==> Options
--HEAD
	Install HEAD version
==> wxwidgets: stable 3.2.2.1 (bottled), HEAD
Cross-platform C++ GUI toolkit
https://www.wxwidgets.org
/opt/homebrew/Cellar/wxwidgets/3.2.2.1_1 (834 files, 25.2MB) *
  Poured from bottle on 2023-08-24 at 16:42:38
License: LGPL-2.0-or-later with WxWindows-exception-3.1
==> Dependencies
Build: pkg-config ✔
Required: jpeg-turbo ✔, libpng ✔, libtiff ✔, pcre2 ✔
==> Options
--HEAD
	Install HEAD version

==> wxwidgets: stable 3.2.2.1 (bottled), HEAD

Thanks @rtgoodwin; I can confirm that it works with wxwidgets 3.2.2.1 and wxwidgets 3.2.1, so I may do a macOS specific release in a day or two. Unfortunately going with the newer wxwidgets version has some other issues that need to be addressed. I plan on having a version for you to test in a day or two and it would be great to have your feedback on this, as I plan to make this release before the end of the month.

Fantastic! Glad to hopefully have helped and not made more work :)

@rtgoodwin, yes, it did help; thank you! I opened a wxwidgets ticket, but it looks like they don't have resources to work on it. I'll try to bisect it to see if I can find where it broke, but given the large number of commits between 3.1.4 when it worked and 3.2.0 when it appears to have broken it may take a while.

Do you see the same issue with the "original" text displayed when you try to edit a file name in the project tree or a watch expression in the watch panel?

Looks like it. It's not the kind of thing that would bother me per se, but I imagine it could get quite annoying :)

Ran the same brew lua src/main.lua:

screenshot-2023-08-31_041512PM