-
-
Notifications
You must be signed in to change notification settings - Fork 71
Created a no-dependency script to bootstrap Windows DMD. #18
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
Conversation
rem ------------------------------------------------------------------------- | ||
|
||
rem Detect whether Git is available | ||
call gitsssssssa --help > NUL 2> NUL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Wed, 29 May 2013 07:02:58 -0700
Andrei Alexandrescu notifications@github.com wrote:
+echo.rename %%WORK_DIR%%%%2-%%DMD_BRANCH%%
%%2 >> %FAKE_GIT_SCRIPT% +rem
+rem Generate script to run real Git
+echo.^@echo
+rem
off >
%REAL_GIT_SCRIPT% +echo.rem This script is only intended to be run
from bootstrap-dmd.bat >> %REAL_GIT_SCRIPT%
+echo.%REAL_GIT_SCRIPT%
+echo.pushd .%REAL_GIT_SCRIPT% +echo.cd
%%WORK_DIR%%%REAL_GIT_SCRIPT% +echo.call git clone --depth 1 --branch
%%DMD_BRANCH%% %%1.git %%2 >> %REAL_GIT_SCRIPT%
+echo.popd%REAL_GIT_SCRIPT%
+rem
- +rem Detect whether Git is available
+call gitsssssssa --help > NUL 2> NULwhat's this?
A debugging edit that I accidentally left in ;)
This is nice work. I'll leave review to people who are more fluent with Windows. |
This is nice but we will need a binary bootstrap once we port part of the compiler to D. |
Script looks fine to me, can't comment on the Visual Basic stuff, I'm clueless there. I've tried it on Win7 and it works. Nice work! But, I think maybe using "bin32" as the folder name for the binary could confuse some tools. E.g. IDE tools might expect a "bin" directory instead. And some build tools for libraries expect to find a "lib" folder instead of "lib32". Other than that it looks great. Btw, if you want to redirect both stdout and stderr at once you can do Also, Nick your avatar is scary. :P |
Hmm, I suppose that does kinda throw a wrench in it.... Although...Perhaps it could be useful as a backup-solution if, for some reason, there's ever any trouble with the (future) binary bootstrap (ex: Maybe a new version of the OS that breaks something?). Then this could be used to bootstrap the last C++-only version, and then use that to compile a newer D, and so on up to the latest. Just a thought.
I was thinking partly about forward compatibility since, presumably, there'd eventually be a 64 bit binary. (Or not?) Also, this keeps the directory names the same between Win/Lin (but then again OSX is just "bin" and "lib" too, though IIRC...) But maybe it is better to just keep with existing DMD convention and then change to "bin32", etc if/when the DMD releases start doing that. Opinions? Consensus?
Normally, yea, but if they're just going to NUL anyway than
Heh :) I originally made it for a Nine Inch Nails message board some years back (partly inspired by what the "DOOM guy" does in the HUD when you're doing well.) It's probably more Marilyn Manson-ish than NIN-ish, but heck, he was on Trent Reznor's Nothing label, too. The picture actually is me...sort of... |
Or, a newer version of this script could just simply auto-download an existing already-packaged-and-released DMD, just like it currently does with DMC, and use that to build a newer version (say, a beta or master) off of GitHub. I think that could still be potentially useful. |
Definitely. |
ping - ready to merge? |
AndrejMitrovic is right: The bin/lib directory names should match current DMD Windows convention. I've just done that now. |
I would have merged this myself, but I don't have merge rights here (btw, where can one see a list of projects they have write access to?) |
LGTM, please merge. |
Created a no-dependency script to bootstrap Windows DMD.
While this pull is just for Windows, a Posix version is in the works.
This is a one-file tool that has no prerequisites other than an internet connection and a working Windows machine (XP and up - untested on 2k). It will use Git if it's detected, but does not require it. The only other dependencies (DMC and a command-line unzip) are automatically downloaded by this script (but not installed system-wide, just placed in a subdirectory).
One nice effect of the above is that, if this pull is merged, any internet-connected Windows user who has wget installed can go from having no DMD whatsoever to a basic bootstrapped DMD with nothing more than one command:
(However, this script does not require wget or curl.)
This script is deliberately limited to building and setting up nothing more than Win32 DMD, Druntime, Phobos and RDMD. My intention is with that much bootstrapped by this batch file, any further tasks can be implemented in D.
I tested this on WinXP 32-bit and Win7 64-bit, and also from arbitrary directories (it not just the directory with the script), and inside paths containing spaces.
BTW, I put it in it's own separate "bootstrap" subdirectory because my intention is to also have an equivalent Posix script plus D-based cross-platform "stage 2" files. Using this common directory ensures both Windows and Posix users can run the script using the same command:
"path"~dirSep~"boostrap-dmd"