Skip to content

Conversation

9rnsr
Copy link
Contributor

@9rnsr 9rnsr commented Jan 16, 2013

No description provided.

WalterBright added a commit that referenced this pull request Jan 16, 2013
@WalterBright WalterBright merged commit 4c52f07 into dlang:master Jan 16, 2013
@andralex
Copy link
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
Copy link
Contributor

@andralex Drop windows support?

@9rnsr
Copy link
Contributor Author

9rnsr commented Jan 17, 2013

@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
Copy link
Contributor Author

9rnsr commented Jan 17, 2013

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

@andralex
Copy link
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.

@dnadlinger
Copy link
Contributor

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

@WalterBright
Copy link
Member

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

@dnadlinger
Copy link
Contributor

Just strip them off in whatever application uses them?

@andralex
Copy link
Member

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

@dnadlinger
Copy link
Contributor

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

@WalterBright
Copy link
Member

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

@leandro-lucarella-sociomantic
Copy link
Contributor

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
Copy link
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
Copy link
Contributor

@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
Copy link
Member

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

@dnadlinger
Copy link
Contributor

@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
Copy link
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
Copy link
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
Copy link
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
Copy link
Member

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

@MartinNowak
Copy link
Member

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

@MartinNowak
Copy link
Member

Oh, should have hit refresh.

@WalterBright
Copy link
Member

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

@WalterBright
Copy link
Member

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

@andralex
Copy link
Member

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

@WalterBright
Copy link
Member

#1582

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants