More fix for vergen #1489

Merged
merged 3 commits into from Jan 16, 2013

8 participants

@9rnsr
D Programming Language member

No description provided.

@alexrp
D Programming Language member

Wrong remote? ;)

D Programming Language member

Sorry. I removed it.

D Programming Language member

No worries!

@WalterBright WalterBright merged commit 4c52f07 into dlang:master Jan 16, 2013
@andralex
D Programming Language member

@9rnsr @WalterBright This vergen deal has been a ton of work for a very simple task, which suggests we're having a tooling problem. The main issue seems to be we're using C++ instead of a simple shell language for simple shell operations. Thoughts on how we can improve that?

@yebblies
D Programming Language member

@andralex Drop windows support?

@9rnsr
D Programming Language member

@andralex I had tried that first. But, it had been unclear that we can assume Posix command tools can be used for dmd build, especially in Windows platform.

As far as I see, current dmd/src/win32.mak only requires Digital Mars make just for the dmd build. But others are not. For example, install target (which might be used for making release package by @WalterBright?) uses cp command for copying files. Furthermore, we need to install cygwin and GNU make to run dmd test suite - that means we cannot develop dmd only with Digital Mars tools (dmc, optlink, DM-make, ...).

So, I took the classic way - using C.

@WalterBright I think we need to provide a workspace project for the dmd/druntime/phobos development with good documentation, which is constructible from scratch and can be used on any platform (of course, including Windows).
In recent days I've tried to do that, but satisfactory results have not been obtained.
I'd like to know the steps how to make a release package in your local - I really want to know which part of win32.mak is actually used.

@9rnsr
D Programming Language member

I opened a pull #1500, which is one of the results of my trial and errors.

@andralex
D Programming Language member

@9rnsr understood. I wonder if it's reasonable to start dogfooding, i.e. use D for such work. In D it would be trivial to generate this:

#!/usr/local/bin/dmd
import std.stdio;
void main() {
    writeln('"', import("VERSION"), '"');
}

I think we're getting closer to the point we could and should do some bootstrapping inside the compiler. Using D for tools may be a simple entry point.

@klickverbot
D Programming Language member

Isn't the simplest solution just to directly add the quotes to the VERSION file?

@WalterBright
D Programming Language member

That would only work for the C files. What about every other use of VERSION?

@klickverbot
D Programming Language member

Just strip them off in whatever application uses them?

@andralex
D Programming Language member

@klickverbot which gets us back to the original problem :)

@klickverbot
D Programming Language member

@andralex: What other clients for VERSION are there right now?

@WalterBright
D Programming Language member

The various installers, the release file names, the changelog, etc.

@leandro-lucarella-sociomantic

I insist we should be getting the version from the Git. This way you will also never forget to tag a release before releasing it. We can at least rely on having git installed in Windows? What other tools can we use, anything else from the posix world? I will create a pull request to get the version from git, I will write it in C if necessary.

@andralex
D Programming Language member

@leandro-lucarella-sociomantic There's a script in tools/ doing that. The problem is we work on the next release while it's not tagged yet.

@leandro-lucarella-sociomantic

@andralex where exactly? I failed to find it in the dmd repo or in the toplevel directory in every repo in the d-p-l org.

@andralex
D Programming Language member

It's currently used only in the installer, see osx/Makefile.

@klickverbot
D Programming Language member

@andralex: My point was that stripping off the quotes wouldn't be a problem in virtually any client application that does some string processing. For example, on the various Posixen, you could just do cat VERSION | xargs to get rid of them in scripts.

@andralex
D Programming Language member

The problem is Windows. On Posix we can add and strip quotes no problem. On Windows we can't, which leads to the infuriating notion that we have already spent significant amounts of time on a trivial issue because we need to stick with a vanilla toolset on Windows.

@MartinNowak
D Programming Language member

Please fix that soon, everybody is already annoyed by the massive win32.mak, win64.mak, posix.mak redundancy, we should use GNU make.
I never really figured out what toolchain to use for dmd unit tests, ought to be some flavor of cygwin though.
Now this is the third issue that comes up.
You see the pattern, it's kind of a running gag.
Usually one of the first things I install on a Windows box is git which already comes with a nice mingw environment, much less intrusive than cygwin IMO.
Please let's make use of it.

@WalterBright
D Programming Language member

I'm embarassed to say I've forgotten about a little known feature of Digital Mars make.

Consider the make rule:

verstr.h : ..\VERSION
echo "$(..\VERSION)" >verstr.h

which quotes the contents of the file ..\VERSION. The little known feature is if a macro is not defined locally, on the command line, or in the environment, it'll try to load it as a file. The echo command will put quotes around it.

@andralex
D Programming Language member

@WalterBright: that's nice but doesn't quite fix the tooling problem.

@MartinNowak
D Programming Language member

That's good news, dlang/druntime#400, but there are more issues.

@MartinNowak
D Programming Language member

Oh, should have hit refresh.

@WalterBright
D Programming Language member

It does make vergen.c no longer needed for win32.mak for dmd.

@WalterBright
D Programming Language member

I'll do a pull for win32.mak later today.

@andralex
D Programming Language member

then maybe we can eliminate vergen.c - on posix alternatives are easy

@WalterBright
D Programming Language member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment