Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

More fix for vergen #1489

Merged
merged 3 commits into from

8 participants

@9rnsr
Collaborator

No description provided.

@alexrp

Wrong remote? ;)

Collaborator

Sorry. I removed it.

No worries!

@WalterBright WalterBright merged commit 4c52f07 into D-Programming-Language:master
@andralex
Owner

@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
Collaborator

@andralex Drop windows support?

@9rnsr
Collaborator

@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
Collaborator

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

@andralex
Owner

@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
Collaborator

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

@WalterBright

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

@klickverbot
Collaborator

Just strip them off in whatever application uses them?

@andralex
Owner

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

@klickverbot
Collaborator

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

@WalterBright

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
Owner

@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
Owner

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

@klickverbot
Collaborator

@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
Owner

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
Collaborator

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

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
Owner

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

@MartinNowak
Collaborator

That's good news, D-Programming-Language/druntime#400, but there are more issues.

@MartinNowak
Collaborator

Oh, should have hit refresh.

@WalterBright

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

@WalterBright

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

@andralex
Owner

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

@ghost Unknown referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@ghost Unknown referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@ghost Unknown referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@ghost Unknown referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 16, 2013
  1. @9rnsr

    Add clean target

    9rnsr authored
  2. @9rnsr
  3. @9rnsr

    Add generated file to .gitignore

    9rnsr authored
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 1 deletion.
  1. +1 −0  .gitignore
  2. +1 −1  src/posix.mak
  3. +2 −0  src/win32.mak
View
1  .gitignore
@@ -20,6 +20,7 @@ src/dmd.exe
src/impcnvgen.exe
src/optabgen.exe
src/verstr.h
+src/vergen.exe
*.map
.DS_Store
trace.def
View
2  src/posix.mak
@@ -183,7 +183,7 @@ dmd: $(DMD_OBJS)
clean:
rm -f $(DMD_OBJS) dmd optab.o id.o impcnvgen idgen id.c id.h \
impcnvtab.c optabgen debtab.c optab.c cdxxx.c elxxx.c fltables.c \
- tytab.c core \
+ tytab.c vergen verstr.h core \
*.cov *.gcda *.gcno
######## optabgen generates some source
View
2  src/win32.mak
@@ -314,6 +314,8 @@ clean:
$(DEL) msgs.h msgs.c
$(DEL) elxxx.c cdxxx.c optab.c debtab.c fltables.c tytab.c
$(DEL) impcnvtab.c
+ $(DEL) id.h id.c
+ $(DEL) verstr.h
cd $(CPPUNIT)\src\cppunit
$(MAKE) clean
Something went wrong with that request. Please try again.