-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Running and upgrading haxelib #172
Comments
I propose that C:\HaxeToolkit\haxe\haxelib.exe should become a small shim. If the user has not setup haxelib, it should be able to find a default install of haxelib_client, included with Haxe. This could be located under C:\HaxeToolkit\haxe\std\tools\haxelib_client for example. If the user has setup haxelib, it should look for a "haxelib_client" package in the haxelib local repository, for example, C:\HaxeToolkit\haxe\lib\haxelib_client\3,2,1 In the Lime and OpenFL tools, I use a simple script like this:
I believe @ncannasse said that not being dependent on Neko would be preferable, so Benefits You would be able to update the haxelib_client automatically using You could You would not need to use I would be happy to help implement this |
I will see to it that haxelib becomes a .bat on windows, that just launches a haxelib.n, which we can replace while running. The |
So currently, haxelib.exe is the haxelib.n + Neko boot. I was thinking, the shim could use Neko boot, but could use the Neko "loadModule" code in order to find the haxelib_client.n file. This would not require Neko on the system, nor would it require the Haxe executable (helping to avoid a chicken-and-egg problem) Yes, it would need to find the path, but the shim would need to understand this logic itself. That would be the only shared functionality. Worst-case, you have a haxelib shim that doesn't understand how to run a haxelib_client from an eccentric new source. I think it's still a good step forward. You cannot do a batch file on Windows, because that would make a calling batch script exit immediately. I just had this problem recently with the "openfl" and "lime" scripts. I'm running this through Neko + Neko boot to create an executable instead: https://github.com/openfl/lime/blob/master/tools/AliasScript.hx This could instead be logic for finding the haxelib_client and running that |
I don't understand why I can't use batch files. Can't the calling batch file use |
The user expects to be able to create a batch file like this:
Similarly, I think they would expect the same of haxelib:
Sure, it would work if they used "call" but I don't think people will catch that they had to do this. A simple self-executable (like the one I linked) keeps things working well within other batch files, while still forwarding commands to the next link in the chain as expected |
I'm not exactly sure that this is a sensible expectation. If there is an error, I would expect it to terminate the script instead of continuing. I think error suppression should be an opt-in, as permitted by call. Does anybody else have an opinion on this? |
Oh, no... batch scripts would exit after the first call, regardless of whether there was an error. It would simply only call the first instance of "haxelib" and exit. |
Sorry, got confused. In the second case that would indeed be an issue. In On Mon, Mar 9, 2015 at 7:40 PM, Joshua Granick notifications@github.com
|
Like @andyli said in #283 we can't tell people to update unless selfupdate works :) Currently it's in two steps:
The first one is done with the install/update mechanism and has no issues, This issue propose to use the run mechanism, which we know works. I've tried this var args = ["haxelib.n"].concat(Sys.args());
args.pop();
Sys.exit(Sys.command("neko", args)); as run script for haxelib, then I tested all commands and saw no issues, The difference from what is proposed here is that I wouldn't make the bundled haxelib a shim, That way once selfupdate (which is really just an update at this point) it'll use the set version of haxelib_client, which should be the latest update, or a dev version. And if something is broken there's always the |
That sounds good actually. So we can bundle a nekobooted executable everywhere! \o/ |
Didn't use a nekobooted version since that's os specific. edit: oh I think I understand what you meant, that was about the bundled version next to haxe |
I think because we're moving to use a compiled neko version, we can also remove this nonsense and use macro \o/ |
This was implemented in #291 |
…now, since we're compiling to run.n (see #172 (comment))
After a discussion with @jgranick, I agree that we need to make sure that users can easily upgrade haxelib so we can introduce new usages without waiting for a new haxe release.
Maybe we should always use the haxe macro system on all OS (including Windows), and make sure that we can update the client by saving it into a directory we are sure the user has write access. I'ld surely like to hear what people think about good locations for that ?
The text was updated successfully, but these errors were encountered: