Moonshine-IDE / Moonshine-SDK-Installer

To take full advantage of Moonshine IDE you will need third party SDKs like Apache® Flex or Apache® Royale. In order to make it easier for you to setup the required SDKs, we created the Moonshine SDK Installer.
https://moonshine-ide.com/download-sdk-installer/
Other
8 stars 2 forks source link

Update Haxe to minimum 4.2.5 #105

Closed piotrzarzycki21 closed 1 year ago

piotrzarzycki21 commented 1 year ago

We are using in Super Human Installer Haxe 4.2.5 and I see in our dev version of MSDKI we have version 4.2.4. We should update this to at least 4.2.5.

rat-moonshine commented 1 year ago

It appears v4.3.1 is the latest version (https://github.com/HaxeFoundation/haxe/releases/tag/4.3.1). Do we want to distribute the latest or an earlier v4.2.5?

@joshtynjala do you see any concern if using 4.3.1 with any of our Haxe/Openfl application (?)

joshtynjala commented 1 year ago

Let's wait on Haxe 4.3. The current released versions of OpenFL and Feathers UI are not fully compatible yet.

piotrzarzycki21 commented 1 year ago

Let's wait on Haxe 4.3. The current released versions of OpenFL and Feathers UI are not fully compatible yet.

This is exactly why I have asked for upgrade installer to 4.2.5 not to 4.3. Our applications are also compiled with 4.2.5 - this update would just a handy helper if anyone wanted to try MSDKI with Haxe. However I'm ok with wait till 4.3

joshtynjala commented 1 year ago

Yeah, I don't see why we can't update to 4.2.5 in the meantime.

rat-moonshine commented 1 year ago

Okay, fine enough. I shall push the 4.2.5 in updating list then, for now.

rat-moonshine commented 1 year ago

I updated configuration to install v4.2.5. This needs to be tested when a build is available.

JoelProminic commented 1 year ago

I did a test on a fresh Windows VM today, and it failed twice in a row.

Here is the tooltip message. Note that this is URL-encoded, which may be a separate issue: image

Checking the log, I see it fails on basedir [object File] does not exist:

image

rat-moonshine commented 1 year ago

In my tests on Windows 10, I did following to enable download option against Haxe:

Unfortunately, I couldn't able to reproduce the problem @JoelProminic reported, Haxe/Neko installed successfully for me:

image

I wonder if the reported problem is an unexpected because of VM. Request to give a test on non-VM, as well.

JoelProminic commented 1 year ago

I tested this in the debugging build: image

I see that the directory from the log does not exist. It looks like this is using an old timestamp (2021 vs 2022) which may be on your machine from a previous installation.

rat-moonshine commented 1 year ago

Thank you for the logs, @JoelProminic and sorry for not seeing the obvious. I found I was testing all the time on a different branch on my Windows system. Thus, I couldn't get the break which were still using download v4.2.4 for Haxe.

I have adjusted the installer script for v4.2.5 download. Tested this works for me.

haxe-64-win.zip extracts to a folder with timestamp value. The AS3 ant API is primitive; it do not provides much options but very basic. We found it difficult to use many modern API that can help us to determine the folder-name. Thus we have a hard-coded value for the directory name in our installer script. I tried to use wild-card value but that didn't worked in said spot. Here's the fileset usage if anyone interested to think of a solution more of general in nature.

JoelProminic commented 1 year ago

I confirmed the install works now for Windows and macOS.

I did notice some warnings during the install, though:

Installer path: /Applications/MoonshineSDKInstallerDevelopment.app/Contents/Resources
Installer version 4.5.0 (mac)
Using Locale: en_US
Fetched the SDK download mirror URL from the CGI.
Downloading Haxe SDK v.4.2.5
Starting to untar: /Users/-user-/Library/Application Support/net.prominic.MoonshineSDKInstaller-dev/Local Store/haxe-4.2.5-osx.tar.gz
Completed untar Haxe SDK
Moving files to SDK directory /Users/-user-/Downloads/MoonshineSDKs/Haxe/haxe-4.2.5
Downloading Neko SDK v.2.3.0
Starting to untar: /Users/-user-/Library/Application Support/net.prominic.MoonshineSDKInstaller-dev/Local Store/neko-2.3.0-osx64.tar.gz
Completed untar Haxe SDK
Moving files to SDK directory /Users/-user-/Downloads/MoonshineSDKs/Haxe/neko-2.3.0
Deleted temp files.
Installation complete
Now continues with Haxe/Neko setup
Please enter haxelib repository path with write access
Hit enter for default (/Users/-user-/Downloads/MoonshineSDKs/Haxe/lib)
Path : 
haxelib repository is now /Users/-user-/Downloads/MoonshineSDKs/Haxe/lib

A new version (4.1.0) of haxelib is available.
Do `haxelib --global update haxelib` to get the latest version.

Downloading feathersui-1,1,0.zip...

Installing feathersui...

  Current version is now 1.1.0

Done

Installing dependency actuate 1.9.0

Downloading actuate-1,9,0.zip...

Installing actuate...

  Current version is now 1.9.0
Done

Installing dependency hxargs 3.0.2

Downloading hxargs-3,0,2.zip...

Installing hxargs...

  Current version is now 3.0.2

Done

Installing dependency openfl 9.2.1

Downloading openfl-9,2,1.zip...

Installing openfl...

  Current version is now 9.2.1

Done

A new version (4.1.0) of haxelib is available.
Do `haxelib --global update haxelib` to get the latest version.

You already have openfl version 9.2.1 installed

A new version (4.1.0) of haxelib is available.
Do `haxelib --global update haxelib` to get the latest version.

You already have actuate version 1.9.0 installed

A new version (4.1.0) of haxelib is available.
Do `haxelib --global update haxelib` to get the latest version.

Downloading lime-8,0,1.zip...

Installing lime...

  Current version is now 8.0.1

Done

Setup completes for Haxe and Neko

Should we be seeing a new version of haxelib already? I see we were waiting on Haxe 4.3.

Why do openfl and actuate show as installed already. Were they installed as dependencies for an earlier library?

rat-moonshine commented 1 year ago

Why do openfl and actuate show as installed already. Were they installed as dependencies for an earlier library?

We setup following libraries during the setup process besides haxelib:

I now think I possibly seen feathersui installs actuate and openfl as part of its installation process; Maybe, I should remove the extra actuate and openfl install command from the script.

joshtynjala commented 1 year ago

Should we be seeing a new version of haxelib already?

They recently started occasionally releasing new versions of Haxelib on Haxelib, which allows it to be optionally updated independently from the Haxe compiler.

JoelProminic commented 1 year ago

For the removed dependencies, we should run some quick sanity tests to make sure this doesn't break the templates or the Moonshine-IDE source. It is unlikely that we will see problems, since the libraries are already installed as dependencies.

JoelProminic commented 1 year ago

@piotrzarzycki21 recommended testing the Haxe 4.2.5 dependencies with Super.Human.Installer.

Projects install configured dependencies automatically, so trying to test the dependency changes with a project build doesn't make sense. It should be sufficient to check that all the original libraries are installed with the latest update.

JoelProminic commented 1 year ago

I checked the haxelib updates on macOS, and this looks reasonable. It looks like newer versions fo feathersui and openfl were released since my above test, but I don't see anything obviously misssing:

% $HAXE_HOME/haxelib list
actuate: [1.9.0]
feathersui: [1.2.0]
hxargs: [3.0.2]
lime: [8.0.2]
openfl: [9.2.2]

I got the same results on Windows 11. I'm satisfied with the haxelib updates.

piotrzarzycki21 commented 1 year ago

I have installed on fresh Windows 11 machine Haxe 4.2.5 using MSDKI and all other items to make project working. I have created FeatherUI project - language server successfully started. I tried to build project with target Windows and got results that I'm missing hxcpp - which is good. I have added to project.xml missing item and in the end I got following error:

: Error: 64bit is not automatically supported for this version of VC. Set HXCPP_MSVC_CUSTOM and manually configure the executable, library and include paths
: Error: Error: 64bit is not automatically supported for this version of VC. Set HXCPP_MSVC_CUSTOM and manually configure the executable, library and include paths
: Haxe build has been terminated with exit code: 1

I think I need to install from that point VS C++ build tools to pass this error. I believe despite of this issue we are good to go with closing this issue and make a release.

piotrzarzycki21 commented 1 year ago

Just FYI after installing C++ build tools I'm getting different error:

: Starting Haxe build...
: Haxe build directory: C:\Users\vagrant\Documents\NewHaxeFeathersUIProject
: Command: %HAXE_HOME%\haxelib.exe run lime build windows -debug --source="C:\Program Files\MoonshineDevelopment\elements\hxcpp-debug-adapter\hxcpp-debug-server" --haxeflag="--macro hxcpp.debug.jsonrpc.Macro.injectServer()"
: C:\Program Files\MoonshineDevelopment\elements\hxcpp-debug-adapter\hxcpp-debug-server/hxcpp/debug/jsonrpc/VariablesPrinter.hx:210: characters 9-29 : Warning : Std.is is deprecated. Use Std.isOfType instead.
: C:\Program Files\MoonshineDevelopment\elements\hxcpp-debug-adapter\hxcpp-debug-server/hxcpp/debug/jsonrpc/eval/Interp.hx:85: characters 9-19 : Warning : Std.is is deprecated. Use Std.isOfType instead.
: C:\Program Files\MoonshineDevelopment\elements\hxcpp-debug-adapter\hxcpp-debug-server/hxcpp/debug/jsonrpc/eval/Interp.hx:119: characters 9-19 : Warning : Std.is is deprecated. Use Std.isOfType instead.
: C:\Program Files\MoonshineDevelopment\elements\hxcpp-debug-adapter\hxcpp-debug-server/hxcpp/debug/jsonrpc/eval/Interp.hx:160: characters 9-19 : Warning : Std.is is deprecated. Use Std.isOfType instead.
: C:\Program Files\MoonshineDevelopment\elements\hxcpp-debug-adapter\hxcpp-debug-server/hxcpp/debug/jsonrpc/eval/Interp.hx:437: characters 9-19 : Warning : Std.is is deprecated. Use Std.isOfType instead.
: C:\Program Files\MoonshineDevelopment\elements\hxcpp-debug-adapter\hxcpp-debug-server/hxcpp/debug/jsonrpc/eval/Interp.hx:401: characters 39-58 : Warning : Std.is is deprecated. Use Std.isOfType instead.
: C:\Program Files\MoonshineDevelopment\elements\hxcpp-debug-adapter\hxcpp-debug-server/hxcpp/debug/jsonrpc/eval/Interp.hx:402: characters 33-49 : Warning : Std.is is deprecated. Use Std.isOfType instead.
: C:\Program Files\MoonshineDevelopment\elements\hxcpp-debug-adapter\hxcpp-debug-server/hxcpp/debug/jsonrpc/eval/Interp.hx:571: characters 10-42 : Warning : Std.is is deprecated. Use Std.isOfType instead.
: Creating C:/Users/vagrant/Documents/NewHaxeFeathersUIProject/bin/windows/obj/obj/msvc1964-debug-nc/__pch/haxe/hxcpp.pch...
: hxcpp.cpp
: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\yvals.h(17): fatal error C1083: Cannot open include file: 'crtdbg.h': No such file or directory
: Error: Could not create PCH
: Haxe build has been terminated with exit code: 1
rat-moonshine commented 1 year ago

@joshtynjala are these problems sounds familiar (?) https://github.com/Moonshine-IDE/Moonshine-SDK-Installer/issues/105#issuecomment-1594391015

joshtynjala commented 1 year ago

I tried to build project with target Windows and got results that I'm missing hxcpp - which is good.

The command haxelib run openfl setup should install hxcpp automatically. I'm not sure if we're running this command or not, but we probably should.

If OpenFL is setup correctly, you should not need to add hxcpp to project.xml.

fatal error C1083: Cannot open include file: 'crtdbg.h': No such file or directory

I found this answer on Stack Overflow that suggests installing the Windows 10 SDK:

https://stackoverflow.com/a/59803149/10768

I also searched for some Haxe specific results, and they basically suggest the same thing.

rat-moonshine commented 1 year ago

We installs through Ant script; I see we have some additional installation steps other than downloading - but we probably not included them in final process because SDK like feathersui do not part of Haxe.

Perhaps, I need to include in the installation like haxelib, openfl, lime. I shall look into this.

joshtynjala commented 1 year ago

Moonshine's Haxelib plugin could potentially add a special extra step when it sees that openfl is being installed.

rat-moonshine commented 1 year ago

I added the additional installation process for Openfl which installs hxcpp. Give this a test with newer build please.

piotrzarzycki21 commented 1 year ago

I added the additional installation process for Openfl which installs hxcpp. Give this a test with newer build please.

I see openfl is installed with haxe, so I think we are good here - I have tried this on Windows machine.

JoelProminic commented 1 year ago

Running a test on Windows, I confirmed that the updates cleared the hxcpp errors, but not the HXCPP_MSVC_CUSTOM error.

In the meeting we talked about whether we could install the Visual Studio C++ library (msvcpp) automatically. However, we are unclear if this will be a problem with the Microsoft license, so we need to be very careful with this.

One of the goals of Moonshine is to let the project templates Build & Run without any additional environment setup, so I'd like to get this problem fixed. We may be better off saving this for more investigation after the current release, though. The updates don't seem to make the problem worse, at least.

I see the new commands have the --quiet option, but they are still very verbose. I'll update this issue if I find other options we can use to keep the output more concise.

JoelProminic commented 1 year ago

This page has instructions for setting up a Haxe C++ environment: https://haxe.org/manual/target-cpp-getting-started.html

A C++ SDK is required. We should look into using clang++ or the built-in distribution (haxelib install minimingw).

These concerns will probably be moved to a separate issue for a later milestone.

JoelProminic commented 1 year ago

I did some quick tests with this.

I tried minimingw, but this didn't clear the 64-bit error.

I looked into clang, but I had trouble finding a Windows build on the download pages.

I tried the Visual Studio installer, but this has a massive number of options. @piotrzarzycki21 is this the option you chose? I'm trying that now, and I'll need to check back on it later. image

UPDATE: This install cleared the error, but it also installed the full Microsoft Visual Studio. I suspect I could have installed this through Individual Components, but there is a huge list of components here. I would like to see Moonshine give more guidance here, but this doesn't need to be part of this release.

piotrzarzycki21 commented 1 year ago

I did some quick tests with this.

I tried minimingw, but this didn't clear the 64-bit error.

I looked into clang, but I had trouble finding a Windows build on the download pages.

I tried the Visual Studio installer, but this has a massive number of options. @piotrzarzycki21 is this the option you chose? I'm trying that now, and I'll need to check back on it later. image

UPDATE: This install cleared the error, but it also installed the full Microsoft Visual Studio. I suspect I could have installed this through Individual Components, but there is a huge list of components here. I would like to see Moonshine give more guidance here, but this doesn't need to be part of this release.

@JoelProminic I have installed only this one:

Screenshot 2023-06-22 at 11 08 16
JoelProminic commented 1 year ago

I moved the remaining discussion to #110. The Haxe update itself looks good.