Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Building after svn export

<< < (2/3) > >>

Urxae:

--- Quote from: thomas on January 04, 2006, 10:24:17 am ---
--- Quote from: mandrav on January 04, 2006, 08:51:21 am ---Heh, interesting :)
Thomas, will you fix this?
--- End quote ---
Although I disagree on the term "fix", I've changed it. Actually, the program was doing exactly what it should ;)

--- End quote ---

Well yes, but it also aborted the build process. If you could alter the makefiles to not run the autorevision target if not in a working copy but just supply a default autorevision.h stored elsewhere in the source tree that might be a "cleaner" solution. Or just patch autorevision to do that of course. A new command-line parameter "-d[efault]" maybe?
EDIT: And maybe just quit if the output file already exists to not overwrite revision information already present?


--- Quote ---autorevision will now silently continue in absence of revision information and output "0" as the revision number.

EDIT:
Hmmm... something else just comes to my mind:
How can you actually get an error about a missing file? autorevision used to exit with status -1 on error, so should the build not abort at that point, and you would never see the message about a missing file?

--- End quote ---

How do you mean the build shoundn't abort? AFAIK both the C::B build system and make abort when a non-zero exit code is returned by any program (make can be explicitly told to ignore it by a '-' at the beginning of the line).

And why would not aborting the build cause the error message to be hidden?
From the autorevision sources:

--- Code: ---    ifstream inFile(docFile.c_str());
    if (!inFile)
    {
        puts("Error: could not open input file");
        return -1;
    }
--- End code ---
It first outputs the error and then returns -1, so the message would show up anyway if the build continued.

killerbot:

--- Quote ---EDIT: And maybe just quit if the output file already exists to not overwrite revision information already present?
--- End quote ---

That would be interesting, then 2 files don't have to recompile each time when you build some or your own modified sources (though you can see this also as a revision, but it won't make it to svn).

Urxae:

--- Quote from: killerbot on January 04, 2006, 11:48:58 am ---
--- Quote ---EDIT: And maybe just quit if the output file already exists to not overwrite revision information already present?
--- End quote ---

That would be interesting, then 2 files don't have to recompile each time when you build some or your own modified sources (though you can see this also as a revision, but it won't make it to svn).

--- End quote ---

Actually, I meant only if the input file (.svn/entries) couldn't be opened. So this wouldn't change anything when rebuilding in an SVN working copy.

php-coder:

--- Quote from: thomas on January 04, 2006, 10:24:17 am ---autorevision will now silently continue in absence of revision information and output "0" as the revision number.
--- End quote ---

Hmmm.. C::B build successfully but revision 0 (see http://img461.imageshack.us/my.php?image=codeblocks5cr.png) not right IMHO. Thnx to quick fix! Now i try hint from Urxae...

thomas:

--- Quote from: Urxae on January 04, 2006, 11:34:31 am ---Well yes, but it also aborted the build process.
--- End quote ---
That was intended, even though it really did not.


--- Quote ---EDIT: And maybe just quit if the output file already exists to not overwrite revision information already present?
--- End quote ---
In that case, your revision will never change, no matter to what revision you update. This defeats the purpose of autorevision, you could just as well hardcode a revision number into your sources then. The purpose of this tool is to update the revision number that is visible in the application every time the revision of the source files has changed, without any interaction from the user.


--- Quote ---How do you mean the build shoundn't abort?
--- End quote ---
It should. That's my point. As you can see from the source which you posted yourself, the exit code was -1. Therefore, the error "missing file autorevision.h" should be entirely impossible because the build process should immediately break after autorevision exits.


--- Quote from: killerbot on January 04, 2006, 11:48:58 am ---...then 2 files don't have to recompile each time when you build some or your own modified sources (though you can see this also as a revision, but it won't make it to svn).
--- End quote ---
This is not the case anyway. The tool itself is never compiled, except if you run "rebuild all" (and it only takes one second to compile, anyway).
The header file is modified if and only if the revision in the header file is different from the revision of the working copy, and there are no exceptions to that rule.
Any "improvements" on that behaviour render the tool entirely useless. The revision number is something you have to be able to rely on, as it is used to track down bugs in the application. If there are exceptions to whether or not the revision is updated, then you are off better to not use it at all.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version