-
Notifications
You must be signed in to change notification settings - Fork 14
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
No Go depedency #214
base: master
Are you sure you want to change the base?
No Go depedency #214
Conversation
…ts, "binaries" command generates a list of binaries to be generated for go4hx, test-os attempts to run compiler on windows and mac with no Go
Failing because of Haxe compiler error for some reason: HaxeFoundation/haxe#12008 |
I've run into a problem. The compiler relies on running 2 Go cmd commands The trouble is that the functionality to do this is hidden away in It is not trivial to pull out, and adding the Go compiler as a dependency defeats the point of this PR. So there are a few options left:
|
I’m not sure what approach you’ve decided to take @PXshadow. The audience that wants to just try go2hx out, probably on a small trial go program, without installing the go compiler proper, would be happy for the stdgo dependencies to be vendored. But as soon as they wanted to create their own library the problem would start again. So the question is, how much time would it take to create a go get etc specialist program, and would that be time well spent? |
A day or two, yes it would be well spent. I should be able to pull the internal package and place it in the go2hx repo and then I will have access to it. I can keep the whole cmd chunk at first and then trim what is not being used. |
I'll just give my opinion below (please do ignore if it's bad or unnecessary) First of all: I think that having go removed as a dependency is a great thing!
At the end of the day it will be time well spent, but if it's worth it to work on now is debatable in my honest opinion. |
@mikaib Sorry for the late reply. Finally removing Go as a dependency at this stage means compiling multiple binaries of all of the Go code present in the go2hx repo as a single statically linked binary. With this approach, even if more Go code is added into the compiler, it won't cause go2hx to have Go as a dependency again. |
Yeah that seems like a good way to go :D |
I've been working on this and how to pull out the I think the best approach now might be to follow what @jeremyfa game engine ceramic does: We can embed a Go compiler into the project for the user, and even embed the Haxe nightly version and not have to wait for a 5.0 release. This is a tradeoff between setup time vs reliability of tooling. Current idea all together
go build cmd/go
Still potential issues
|
Even more fun to think about! https://go.dev/doc/manage-install |
Trying a version 2 of this approach, by handling how to install Go and use the correct version. #239 |
Removes Go as a dependency!
Prebuilt binaries of the Go part of the compiler and auto commits them into the repo.
When the compiler is ran (in Haxe) checks if go4hx (Go part of the compiler) exec exists if it doesn't it tries to build it,
If for any reason it cannot be built (missing Go, issue in build process etc) it will look for the OS and ARCH of a pre built binary.
For Haxe devs with no connection to Go this allows using the compiler with no install of Go necessary! Big win for over coming the barrier to entry of trying out the compiler and working on it.