annacrombie / muon

An implementation of the meson build system in c99
https://muon.build
GNU General Public License v3.0
135 stars 9 forks source link

Commands on Stage 2 doesn't work for me #45

Open ghost opened 1 month ago

ghost commented 1 month ago

I'm on Windows 7 (without MSYS2) so I'm using a standalone MinGW-w64 distro with Windows Command Prompt. It seems the developer doesn't have this setup in mind. I don't know if his support for MSVC is any better, too.

Please note that I have managed to have muon bootstrapped successfully (see: #37).

I have to change build/muon into build\muon.exe for the command to be able to run.

build\muon.exe setup build worked. But build\muon.exe -C build samu failed. I inserted -v and this is the error message:

C:\Work\muon>build\muon.exe -v -C build_muon samu
[1/129] compiling c subprojects/tinyjson/libtiny-json.a.p/tiny-json.c.o
dbg executing : '"/bin/sh" -c gcc -std=c99 -g -O0 -Wpedantic -Wextra -Wall -I subprojects/tinyjson -I ../subprojects/tinyjson -MD -MQ subprojects/tinyjson/libtiny-json.a.p/tiny-json.c.o -MF subprojects/tinyjson/libtiny-json.a.p/tiny-json.c.o.d -o subprojects/tinyjson/libtiny-json.a.p/tiny-json.c.o -c ../subprojects/tinyjson/tiny-json.c'
err CreateProcess() failed: The system cannot find the file specified.
samu: failed to start job: failed to create process
samu: job failed to start
samu: subcommand failed

Why muon is trying to invoke sh on a pure Windows environment?

vtorri commented 1 month ago

i can build muon with the Visual Studio command prompt. I've not tried with gcc on Windows in cmd. That's a bug.

ghost commented 1 month ago

i can build muon with the Visual Studio command prompt. I've not tried with gcc on Windows in cmd. That's a bug.

Do you use the same command as Stage 2? Because if using a standalone ninja I can also build muon. The bug is of samu.

vtorri commented 1 month ago

i've not tried samu yet, too young imho. I have other stuff to do on Windows, like the vs backend.

And i would also like to add cross compilation

annacrombie commented 4 weeks ago

The issue here is similar to #41. muon's samu uses the same platform detection code to determine if it is running on windows. It seems like in this case it is erroneously deciding that it is running on a unix-like OS and therefore attempting to wrap commands in /bin/sh (this is the same as ninja's behavior on unix-like systems). I think this issue at least could be resolved by switching the samu code to use a compile time check for WIN32 or similar rather than relying on runtime information. I don't think there's ever a case where muon built on windows would want to behave like this, except maybe under Cygwin? But there I don't think WIN32 is defined?

vtorri commented 3 weeks ago

_WIN32 is not defined by cygwin compilers

vtorri commented 3 weeks ago

btw, i wonder why you decided that we are on windows (machines.c line 354) if we are also in cygwin environment

annacrombie commented 3 weeks ago

@vtorri is that wrong? Should it just be build_machine.sys == machine_system_windows?

ghost commented 3 weeks ago

@vtorri is that wrong? Should it just be build_machine.sys == machine_system_windows?

I modified machines.c so it's now only build_machine.sys == machine_system_windows. I can confirm that it's still calling /bin/sh.

vtorri commented 3 weeks ago

see https://github.com/annacrombie/muon/issues/41#issuecomment-2156362217

ghost commented 3 weeks ago

@annacrombie Please close this issue. The problem suddenly gone when I built against a newly cloned muon repository. The previous one I'm working with is from my own fork (not this repository). I don't know why it's this way because I have not modified anything in my fork. Maybe that github account is corrupted (I deleted it anyway).