-
Notifications
You must be signed in to change notification settings - Fork 427
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
Win installer: Unversion LR target path #413
Conversation
@ignacio any idea why LR refuses to run, complaining that the current directory doesn't exist? The added debug line "cd && dir" gives proper output... I had a quick look at the source in |
Hi @Tieske . Will take a look at this later today and get back to you. |
It's already fixed. I thought it to be an appveyor issue, but it turned out to be an issue with So back to the original issue; location of the system tree... Any ideas? |
Perhaps bring the issue to the LR mailing list to see if any other Windows users chime in? I trust you guys to make the final call, but it would be nice to at least hear what users have to say on this matter. |
I think of two options.
|
If I understand correctly, the current issue is that a |
iirc it was for security reasons, LR data is not real "data" but application code, and as such needs admin priviledges to write to, hence the Program Files location, as AppData is not protected in that way.
@siffiejoe you did
Not the cleanest solution imo, also very vulnerable to upgrade mistakes if files are moved/added/renamed. Due to the versioned directory they were separated before, my preference would be to keep them separated
I don't see how this could work? The other discussion was regarding one LR installation serving rocks for multiple Lua installations, maybe that is what you meant? This pull request takes care of retaining the |
I thought of that option too. Alternatively, how about this?
Looks very Windows-y to me ;) |
I like the LuaRocks.org namespacing. 👍 Alternatively I was considering using the Lua tree;
This is the default structure of the makefile for MinGW. And Lua 5.3 includes the defaults paths for these as well (LuaWinMake also creates this structure when installing). as a bonus it would be versioned (except for |
we could even place a small |
Yeah, that would be the Unix-y solution. I think that's what I wanted to go with in the earliest days (due to sheer laziness/simplicity of having everything look/work the same everywhere) but for some reason we didn't go with that (Kepler already had different conventions, maybe? Or maybe Windows people were offended by the Unix-like paths, I don't remember :) ) |
I think things have changed, the tree structure has been standardized a little bit more by Lua 5.3 including the defaults paths for this structure. And the earlier mentioned security, previously everyone on Windows had admin rights, and that has also changed (for the better). If LR adopts this structure, I think the 'standard' would become a little stronger again... |
Well, you certainly have my support for the unified bin+lib+share structure in all OSes :) |
So, what would |
At the same time my system tree is;
So if I would point my system tree to |
So you'd be install the system tree in |
Yes, just the system rocktree would be integrated into the Lua directory tree, LuaRocks would still have its own, non-versioned, installation directory. |
Great. I'm ok with this. |
Just updated this PR with the change as discussed. Please give this a try and let me know whether it is good to go. |
Sorry about chiming in late, but... changing the tree to a Unix-like structure is good, but I'm unsure about our installer installing Lua at OR... While we're at it... why two trees? If the LR system tree will store stuff in Lua's tree anyway, why not install LuaRocks itself there too? In other words...
Removing a LuaRocks version when upgrading equates to deleting |
Also, this will be a major usability change for users... maybe we should make this move in the |
The bundled Lua version is installed as
I'm not sure about this one. I see your point, but I'm not comfortable with it (yet). Have to give it some thought. Maybe take it one step at a time. And make that a next step.
No, I don't think so. Last time we moved the tree, it also was a point release. A user just needs the /TREE argument to move the tree elsewhere, or he doesn't move it and just reinstalls the modules he wants/needs. Imho adding a note to the release should suffice. |
To clarify: We are talking about four directory trees. Two are also rocks trees (one requires admin rights, the other doesn't). Then there is the Lua installation directory, and the LuaRocks installation directory. The current plan is to put one of the rocks trees into the Lua installation directory, because then Lua 5.3, when installed using a certain directory layout, doesn't need any Another idea was to move the LuaRocks modules from the LuaRocks installation directory into the system rocks tree. This is already done on Unix, and it will happen anyway as soon as we support updating LuaRocks via rockspec on Windows, so I'm all for it. (Btw., what is holding us back there?) If all of this is realized, we only have two directory trees left: One Lua installation directory which includes the system rocks tree and the LuaRocks installation, and one separate user rocks tree. This is exactly like on Unix but with some additional subdirectories in |
Yes, they must not be in the path. Care is taken to address them using absolute paths so a LR install won't mess with my libeay32.dll and so on.
IIRC, the trouble is replacing files while in use. This issue mentions it. |
Yes, but that should not apply to Lua modules since they are opened, parsed, compiled, and then closed. So when LuaRocks code is executed there shouldn't be any Lua files in use. Is it the batch files that are the problem? I'll try to dig up the original source of that info ... |
I think the problem was related to C modules which LR can use if available (LuaSocket, LuaSec, etc). Maybe there is no actual problem upgrading LuaRocks itself. |
Yes, that's why we have
Yes, maybe there isn't, and to be honest I just never tested it. |
Note however that for self-upgrade to work the first install has to be different, so that the LuaRocks files show up in the manifest. On Unix that required a special rockspec and makefile changes, for which I never implemented equivalents on Windows. |
Conceptually this is ok I think. LuaRocks is just a tool that helps extend the Lua environment, hence it has to modify it. So a rockstree is part of a Lua installation, but managed by LuaRocks.
Here it is different imo. LuaRocks is a different application, one could consider it just a coincidence that it is written in Lua itself. But still it is a different application. Hence my hesitation. But reducing platform differences might be worth it.
As an alternative; see this commit, it adds a "shortcut" batch file to the bin directory to access LR itself. And hence the LR installation remains separate from the Lua installation. Just a thought... |
as for updating LuaRocks by itself; there are also the included binaries, and batchfiles. I'm not worried about the binaries, but the batchfiles might be an issue. The way I understand they work is by executing a line, if the batch file is changed/deleted, the next line is read, but might be different because of a change. Probably if multiple statements are within () they are considered one, even if on multipe lines, so that makes it even less predictable. I think workarounds can be devised, but it does require some care. |
for now; should we merge this PR and open a new issue for making LR update itself on windows? |
updated to warn if an environment variable is given, but the file referred to isn't available. |
@hishamhm Can this be merged or is there still an issue left? PS. I think we need a different branching model if developing in parallel for LR 3 and LR 2. Something like a development branch, for which all enhancements will be merged in both the master branch (LR 2.x) and in the LR 3 branch. New LR 3 features are only to be merged in the LR 3 branch. |
@Tieske Yes, I believe this can be merged. As for branches, I've been remiss and committed stuff into |
Win installer: Unversion LR target path
This PR fixes the installer to use a non-versioned path for the LR installation (fixes #151). As discussed here #403 (comment) . It also fixes the retainment of the existing config files.
One problem though; because the LR path is moving one level up, the system rock tree is now in the same path. e.g. default used to be
c:\program files (x86)\luarocks\2.2
and now isc:\program files (x86)\luarocks
. This means that when deleting that existing directory upon installation, the default location of the system tree;c:\program files (x86)\luarocks\systree
, is now also deleted.iirc correctly the system tree used to be installed in the Lua directories, not the LuaRocks directories. Some 2 years ago this was changed, but with hind sight that seems a bad change, so maybe that should be reverted.
For now; this is for discussion only, do not merge yet, until the systree location issue is resolved.