OpenSWE1R / openswe1r

An Open-Source port of the 1999 Game "Star Wars Episode 1: Racer"
https://openswe1r.github.io/
GNU General Public License v2.0
312 stars 26 forks source link

build instruction problems with msys2 x64 windows unicorn says Python is not found #156

Closed mzaman07 closed 6 years ago

mzaman07 commented 6 years ago

Hello,

So I was following the instructions from here. More specifically the msys2 x64 build instructions. After following the msys2 instructions from the website, I made sure pacman was updated and upgraded. I also had to install the make command as it was not part of the original msys upgrade.

After running MINGW_INSTALLS=mingw64 makepkg-mingw -sLf -i command the following error message is output.

 MINGW_INSTALLS=mingw64 makepkg-mingw -sLf -i
==> Making package: mingw-w64-unicorn 1.0.1-1 (Mon, May 21, 2018  5:17:18 PM)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found unicorn-1.0.1.tar.gz
==> Validating source files with sha512sums...
    unicorn-1.0.1.tar.gz ... Passed
==> Extracting sources...
  -> Extracting unicorn-1.0.1.tar.gz with bsdtar
==> Starting prepare()...
==> Removing existing $pkgdir/ directory...
==> Starting build()...
make -C qemu clean
make[1]: Entering directory '/c/Users/MOLAPTOP/Desktop/project/openswe1r/build/unicorn/src/unicorn-1.0.1/qemu'
rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
find . \( -name '*.l[oa]' -o -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f -exec rm {} +
rm -f   qemu-ga TAGS cscope.* *.pod *~ */*~
rm -rf .libs */.libs
rm -f config-host.h config-host.h-timestamp qapi-types.h qapi-types.h-timestamp qapi-visit.h qapi-visit.h-timestamp
rm -f qapi-types.c qapi-types.c-timestamp qapi-visit.c qapi-visit.c-timestamp
rm -rf qapi-generated
for d in ; do \
if test -d $d; then make -C $d clean || exit 1; fi; \
        done
make[1]: Leaving directory '/c/Users/MOLAPTOP/Desktop/project/openswe1r/build/unicorn/src/unicorn-1.0.1/qemu'
rm -rf *.d *.o
rm -rf libunicorn* unicorn*.lib unicorn*.dll unicorn*.a unicorn*.def unicorn*.exp cygunicorn*.dll
make -C samples clean
make[1]: Entering directory '/c/Users/MOLAPTOP/Desktop/project/openswe1r/build/unicorn/src/unicorn-1.0.1/samples'
rm -rf *.o sample_arm.exe sample_armeb.exe sample_arm64.exe sample_mips.exe sample_sparc.exe sample_x86.exe shellcode.exe mem_apis.exe sample_x86_32_gdt_and_seg_regs.exe sample_batch_reg.exe sample_m68k.exe
make[1]: Leaving directory '/c/Users/MOLAPTOP/Desktop/project/openswe1r/build/unicorn/src/unicorn-1.0.1/samples'
make -C tests/unit clean
make[1]: Entering directory '/c/Users/MOLAPTOP/Desktop/project/openswe1r/build/unicorn/src/unicorn-1.0.1/tests/unit'
rm -rf test_x86_soft_paging test_mem_map test_multihook test_sanity test_gdt_idt_x86 test_x86 test_pc_change test_mem_map_ptr test_x86_shl_enter_leave test_mem_high test_x86_rip_bug test_hookcounts test_tb_x86 test_hang
make[1]: Leaving directory '/c/Users/MOLAPTOP/Desktop/project/openswe1r/build/unicorn/src/unicorn-1.0.1/tests/unit'
cd qemu && \
./configure --cc="cc" --extra-cflags="-DUNICORN_HAS_X86 -DUNICORN_HAS_ARM -DUNICORN_HAS_ARMEB -DUNICORN_HAS_M68K -DUNICORN_HAS_ARM64 -DUNICORN_HAS_MIPS -DUNICORN_HAS_MIPSEL -DUNICORN_HAS_MIPS64 -DUNICORN_HAS_MIPS64EL -DUNICORN_HAS_SPARC " --target-list="x86_64-softmmu, arm-softmmu, armeb-softmmu, m68k-softmmu, aarch64-softmmu, mips-softmmu, mipsel-softmmu, mips64-softmmu, mips64el-softmmu, sparc-softmmu,sparc64-softmmu," --disable-debug-info --disable-stack-protector

ERROR: Python not found. Use --python=/path/to/python

make: *** [Makefile:214: qemu/config-host.h-timestamp] Error 1
==> ERROR: A failure occurred in build().
    Aborting...

-Mo

JayFoxRox commented 6 years ago

What shell are you using? msys installs a number of shells. We should also add such information to our build instructions in the future.

You could try to run pacman -S python2; if the respective package is not found, try pacman -Ss python and see if any package has a fitting name.

We should report this issue upstream to msys; python seems to be a build dependency (I also know that QEMU depends on it, which Unicorn is forked from).

mzaman07 commented 6 years ago

I have been using the mingw 64 bit shell, also tried it in the MSYS shell same problem. Yeah when MSYS installed and pacman is updated it defaults to installing python3. From researching the issue it stems from Arch Linux mentality of using the latest feature because pacman is the main package manager for it. When I ran pacman -S python it installed python3 and when you run the python command it works. When I reran the build command the following error message is shown.

ERROR: Cannot use 'python', Python 2.4 or later is required. Note that Python 3 or later is not yet supported. Use --python=/path/to/python to specify a supported Python. So it looks like qemu and unicorn uses python 2.7. I ll see if I can get rid of python3 or somehow change the symlinks to point to python 2.7 when the command runs. I am also going to write an issue upstream to msys.

JayFoxRox commented 6 years ago

Yeah we have the same issue in XQEMU. But I'd expect it to find python2 automatically. Will report upstream as this looks like an annoying issue for users to address themselves.

JayFoxRox commented 6 years ago

This was hopefully fixed upstream now. Please re-test @mzaman07

mzaman07 commented 6 years ago

Looks like it works now, I just reran the build intstructions.