-
-
Notifications
You must be signed in to change notification settings - Fork 655
More fix for vergen #1489
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
More fix for vergen #1489
Conversation
@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? |
@andralex Drop windows support? |
@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 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). |
I opened a pull #1500, which is one of the results of my trial and errors. |
@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. |
Isn't the simplest solution just to directly add the quotes to the VERSION file? |
That would only work for the C files. What about every other use of VERSION? |
Just strip them off in whatever application uses them? |
@klickverbot which gets us back to the original problem :) |
@andralex: What other clients for VERSION are there right now? |
The various installers, the release file names, the changelog, etc. |
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. |
@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. |
@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. |
It's currently used only in the installer, see osx/Makefile. |
@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 |
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. |
Please fix that soon, everybody is already annoyed by the massive |
I'm embarassed to say I've forgotten about a little known feature of Digital Mars make. Consider the make rule: verstr.h : ..\VERSION 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. |
@WalterBright: that's nice but doesn't quite fix the tooling problem. |
That's good news, dlang/druntime#400, but there are more issues. |
Oh, should have hit refresh. |
It does make vergen.c no longer needed for win32.mak for dmd. |
I'll do a pull for win32.mak later today. |
then maybe we can eliminate vergen.c - on posix alternatives are easy |
No description provided.