-
-
Notifications
You must be signed in to change notification settings - Fork 145
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
Tup can not cope with programmer tools that output random file names. #113
Comments
AFAICT, tup does not currently support this nor would it be a trivial addition. Tup depends on knowing the full dependency hierarchy before it does any actual work-- this is what allows tup to be fast/efficient. More generally... What build system does support this behavior? Indeed, what do want the build system to do? In general, you ask your build system, ultimately, to create all of the desired output files. This means, you need to be able to tell the build system what the desired output files are. You could imagine something like a glob rule, that says the final output file is output-.exe, but what do you do with the old outputs from previous builds? Does tup store somewhere what was built last time and delete it? Does that always make sense? What does tup do if there are multiple files in the directory that happen to match output-.exe; does it assume that the newest file is the current one? Indeed, how to you as a programmer know which of the many hashes are the newest-- are you constantly sorting my time-modified to figure out which executable to test? While I appreciate the merit of semantic naming for versioning, I'm not convinced it makes sense in this context and I'm not sure it's something a build system should support. |
Thank you for your kind, and prompt response. The usual way to support this using normal build tools is to use the touch program, and create a dummy file libexample.dummy which would be used as a proxy. However, tup does not support this approach, and warns on files that are created, and not mentioned in the Tupfile. Can some work around be found using this approach? |
Currently, Tup strictly has to know what files will be created from any command and does not support glob characters on output file names. The only workaround I can think of is to use the More generally, I think that to @ppannuto's point Tup could use * globs in the output filenames. I believe this would work conceptually, but I don't think the current implementation allows for the symbolic graph building you would need to allow for input and output filenames that are unknown at parse time. |
Also, from a quick skim of the man page, rustc supports Working from: https://github.com/mozilla/rust/blob/master/man/rustc.1 |
Unfortunately rustc --lib -o mylib -o mysrc.rs will output something along the lines of libmylib-68a2c114141ca-0.0.4.so . |
On Wed, May 8, 2013 at 5:06 PM, sstewartgallus notifications@github.comwrote:
I've tried to implement arbitrary file outputs in the past, but the problem For example, the command "gcc -c foo.c -o foo.o -Ipublic -Iprivate", where #include "foo.h" and only private/foo.h exists, tup will create a placeholder node in the The graph building algorithm essentially does:
If we allow arbitrary file outputs, then it is possible that a command What does the hash in the shared library provide? A build system like tup -Mike |
I have a similar issue with a temporary file a java application creates. The build just errors out and I would like to ignore the temporary file, but I found no way of doing that. The error is:
Obviously, the file bears a different name every time, so it's impossible to guess it. Note: this is on Windows. |
Interesting. Would it be acceptable for tup to simply set the |
On Thu, Aug 29, 2013 at 6:47 PM, Pat Pannuto notifications@github.comwrote:
#include <stdio.h> int main(void) If any of those are actually that directory, we should be able to ignore -Mike |
@gittup: The output of the code is:
Both TEMP and TMP environment variables are set to this same value. It seems tup takes int account the %TMP% variable on Windows XP, because I just changed TEMP to another value and tup reported the change of the %TEMP% variable, but the temporary files where still created in the old location. Strangely enough, when %TMP% was also set to a new value (and to a directory that does NOT exist), the step in question executed w/o problems :-/ . |
On Fri, Aug 30, 2013 at 7:05 PM, eddyp notifications@github.com wrote:
Thanks, |
@gittup : Sorry for the delay, I've been busy lately. I just tested tup v0.6.5-182-gd0dfe0a and it correctly passes past the problematic rule. Thanks, |
I have a similar use case: I have files that are being rsyncd down. Rsync will sometimes detect changes and write files, sometimes it won't. What would be a good way to handle that? |
There does not seem to be a way to work with programmer tools that may output random file names. For example, a tool I use is the rustc compiler for the rust language. When this compiler compiles shared libraries it puts a hash of the library, and a version number in the output file name. An example, the source for a library cool.rs might be compiled to libcool-68a2c114141ca-0.0.4.so. Unfortunately, there does not seem to be a way to work with such tools using Tup.
The text was updated successfully, but these errors were encountered: