Hi Matthias,
a quick look into tup's source explains this behaviour:
https://github.com/gittup/tup/blob/8e63ea4329bc8bf7e868f691ee5cdfce9fc56c91/src/tup/server/windepfile.c#L274-L292
If your command string contains any special shell operator, tup will automatically prepend either "sh -c '" or "CMD.EXE /Q /C " to it. Tup does not know anything about shell built-ins.
In your case, the command string "copy %f %o" looks like any standard command to tup, therefore it tries to run a process called "copy". Unless you have something executable in one of the places where Windows looks for them, you will see the "tup error: failed to create child process: No such file or directory".
The command string "echo Hello > %o" on the other hand contains the ">" operator. Therefore tup will execute the following string: "CMD.EXE /Q /C echo Hello > hello.txt". Now it is cmd.exe's duty to locate the command "echo". As "echo" is a shell built-in this is an easy task.
What this means:
*) To use shell built-ins like "copy" always prepend them with "cmd /c".
*) If you use shell operators, tup will add "cmd /c" for you, but this might obscure the fact that you might be using a built-in.
*) To clearly state your intentions in your Tupfiles you might always want to use "cmd /c" with built-ins, even with "echo" and "type"...
Kind regards, Bernhard.
Gesendet: Mittwoch, 22. Juli 2015 um 16:53 Uhr
Von: [email protected]
An: [email protected]
Betreff: AW: [tup] Windows 7: using `copy` in Tupfile
Von: [email protected]
An: [email protected]
Betreff: AW: [tup] Windows 7: using `copy` in Tupfile
Hi!
Thomas Costigliola wrote:
> Hi, Matthias, have you tried...
> : hello.txt |> cmd /C copy %f %o |> copy.txt
That works, thank you, even in my not-so-dumbed-down real case.
Do you have an explanation? I thought it might be related to `copy`
being an "internal" command, but as `echo` is as well, that's does not
look like a good explanatory approach.
Regards,
Matthias
On Tue, Jul 21, 2015 at 9:42 AM, <[email protected]> wrote:
>> Hi!
>>
>> The following simple Tupfile fails here:
>>
>> : |> echo Hello > %o |> hello.txt
>> : hello.txt |> copy %f %o |> copy.txt
>>
>> The output is
>>
>> [ tup ] [0.105s] Executing Commands...
>> 1) [0.100s] echo Hello > hello.txt
>> [ ] 50%tup error: failed to create child process: No such file or directory
>> *** Command ID=33 failed: copy hello.txt copy.txt
>> [ ] 50%
>> *** tup: 1 job failed.
>>
>> I'm running tup v0.7.3-18-g8e63ea4 (from
>> http://gittup.org/tup/win32/tup-latest.zip) under Windows 7 64bit.
>>
>> Perhaps this version is missing the required Win64 support (from
>> 8131823)? At the moment I don't have the option to build tup on a
>> Windows machine, so I can't test that by myself.
>>
>> Regards,
>> Matthias
Thomas Costigliola wrote:
> Hi, Matthias, have you tried...
> : hello.txt |> cmd /C copy %f %o |> copy.txt
That works, thank you, even in my not-so-dumbed-down real case.
Do you have an explanation? I thought it might be related to `copy`
being an "internal" command, but as `echo` is as well, that's does not
look like a good explanatory approach.
Regards,
Matthias
On Tue, Jul 21, 2015 at 9:42 AM, <[email protected]> wrote:
>> Hi!
>>
>> The following simple Tupfile fails here:
>>
>> : |> echo Hello > %o |> hello.txt
>> : hello.txt |> copy %f %o |> copy.txt
>>
>> The output is
>>
>> [ tup ] [0.105s] Executing Commands...
>> 1) [0.100s] echo Hello > hello.txt
>> [ ] 50%tup error: failed to create child process: No such file or directory
>> *** Command ID=33 failed: copy hello.txt copy.txt
>> [ ] 50%
>> *** tup: 1 job failed.
>>
>> I'm running tup v0.7.3-18-g8e63ea4 (from
>> http://gittup.org/tup/win32/tup-latest.zip) under Windows 7 64bit.
>>
>> Perhaps this version is missing the required Win64 support (from
>> 8131823)? At the moment I don't have the option to build tup on a
>> Windows machine, so I can't test that by myself.
>>
>> Regards,
>> Matthias
--
tup-users mailing list
email: [email protected]
unsubscribe: [email protected]
options: http://groups.google.com/group/tup-users?hl=en
---
You received this message because you are subscribed to the Google Groups "tup-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.
