Skip to content
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

Linux executable build on Windows via WSL1 not detected as output #487

Open
ompadu opened this issue Jan 6, 2024 · 1 comment
Open

Linux executable build on Windows via WSL1 not detected as output #487

ompadu opened this issue Jan 6, 2024 · 1 comment

Comments

@ompadu
Copy link

ompadu commented Jan 6, 2024

Hello,

I am using the following Lua rule on Windows to successfully build a Linux executable:

tup.definerule{ inputs = {'source/main.c'}, command = 'wsl clang %f -o %o', outputs = {'build/hello'} }

Even though the file is produced at the expected path and it runs under WSL1 as expected, tup throws the following error:

0) wsl clang source/main.c -o build/hello
 *** tup messages ***
tup error: Expected to write to file 'build/hello' from cmd 48 but didn't
 *** Command failed due to errors processing the output dependencies.

Maybe there's something up with elf executable detection?

@gittup
Copy link
Owner

gittup commented Mar 17, 2024

I ran a wsl clang ... command on the command-line manually with Process Monitor enabled. It looks like the actual writes to the output file come from DllHost.exe, which is already running before tup executes anything (so, DllHost.exe is not a subprocess of wsl or clang, so tup can't do it's DLL injection to it in order to see file reads/writes). I guess when you run wsl the subcommands go through some service rather than doing the work themselves?

What is the benefit you are looking for to run clang through wsl instead of natively on Windows? Or, why not use tup inside wsl and then use the Linux subsystem's clang directly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants