gittup / tup

Tup is a file-based build system.
http://gittup.org/tup/
GNU General Public License v2.0
1.18k stars 146 forks source link

MSVC under Wine work incorect #442

Open ghost opened 3 years ago

ghost commented 3 years ago

Problem with build project with MSVC under Wine. MSVC works well, when I run it manualy. But I get error below when start build with Tup:

* 2218) programs/media/ac97snd: cl /c /O2 /Os /Oy /GF /GS- /GR- /EHs-c- /fp:fast /GL /QIfist /Gr /arch:IA32 /DAUTOBUILD /Focrt.obj ac97snd/crt.c >&2                                  
wine: could not open working directory L"Z:\\repo\\programs\\media\\ac97snd\\", starting in the Windows directory.
Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30136 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

cl : Command line warning D9035 : option 'QIfist' has been deprecated and will be removed in a future release
crt.c
c1: fatal error C1083: Cannot open source file: 'ac97snd/crt.c': No such file or directory
 *** tup messages ***
 *** Command ID=55660 failed with return value 2
gittup commented 3 years ago

Are you running a Windows version of tup.exe in Wine as well? Or is it a Linux-based tup that shells out to cl.exe through Wine?

If it's the latter, you might need to add export declarations in your Tupfile to pass the MSVC environment variables through. Tup runs subprocesses with a mostly clean environment, but on Windows it will add the necessary MSVC variables automatically so that toolchain works out-of-the-box (see: https://github.com/gittup/tup/blob/master/src/tup/environ.c#L31-L48). Those won't be set on Linux, however. You could set them in the Tupfile by doing eg:

export SYSTEMROOT
export DevEnvDir
...
: |> cl.exe ... |>

If you're running the whole thing including tup in Wine, I'm not sure off-hand why that would be. If this is the case, could you provide some info on how you setup the dev environment?