-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
Postinstall on Windows #468
Comments
I'm not sure what make sense because I rarely use postinstall. When I do I use crystal alone instead of make. What I know I would like is to have a Although it does not offer any input in a more portable postinstall support, it does offer a workaround and a transition. |
This is for libraries that have some part implemented in C. I may also not use make at the top level but something is needed to compile code after installation. |
@bcardiff These options are great 👍 But the postinstall hook should nevertheless work on any system. So running it with |
Oh, that sucks. Hmmm. And the slash transform doesn't seem like a safe idea, we can't just replace everything. |
Replacing only |
That's weirdly intriguing |
@straight-shoota Hmm? I just checked and |
Works for me: C:\Users\Johannes>type test\test.cmd
echo Hello World
C:\Users\Johannes>cmd /c .\test/test
C:\Users\Johannes>echo Hello World
Hello World
C:\Users\Johannes>cmd.exe /h
Microsoft Windows [Version 10.0.19043.844]
(c) 2020 Microsoft Corporation. Alle Rechte vorbehalten. |
@straight-shoota Well this is quite bizarre. Your example actually works as just |
Oh, that's weird. So it won't give us an easy solution. I actually had a |
As a general note: There's no reason to expect |
Apparently, the From crystal-ameba/ameba#230 (comment) :
|
I think the I think it would be weird to skip the install executable entirely if WDYT? |
Let's discuss this in a dedicated issue, #498 |
Hm, I suppose with crystal-lang/crystal#12278 we do have the code :D |
Shards usually specify
postinstall: make
. But on Windows that line means thatmake.exe
must exist. Usually it is not globally available, of course, and even when it is, it's some quirky alternative implementation ofmake
.What I've been doing is adding a
make.cmd
file to my Windows-supporting libs and telling people to run that directly. Unfortunately, even though running just "make
" in a CMD shell would invoke thatmake.cmd
file,StartProcess
(the current underlying implementation ofsystem()
in Crystal) doesn't do that (unconditionally expects.exe
extension), so anyone installing a shard that needspostinstall: make
on POSIX will always get an error on Windows.It's not even possible to skip the
postinstall
step, or stopshards
from deleting the lib files altogether on such a failure.Anyway... Even though I've been arguing that
system()
should not pick any shell on Windows, specifically for Shards postinstall it would probably be useful to wrap the supplied command intocmd /c
. Maybe I'm saying this just because it happens to make mymake.cmd
hack work. But in any case, I think this is strictly an upgrade from the current state.Let me know if there are any concerns, or I'll send a PR doing that. Or, well, any other ideas are welcome. Seems hard without allowing OS-specific command lines.
The text was updated successfully, but these errors were encountered: