kosarev / z80

Fast and flexible Z80/i8080 emulator with C++ and Python APIs
MIT License
65 stars 10 forks source link

setup.py fails #33

Closed kidmirage closed 3 years ago

kidmirage commented 3 years ago

The indentation of line 26 in setup.py is wrong and the file fails to run with an "opts" not found message.

kosarev commented 3 years ago

Fixed in https://github.com/kosarev/z80/commit/b722d496237009d197531c566237c7052fc528ee. Thanks!

kidmirage commented 3 years ago

Note that "pip install z80" fails because of this as well.

kosarev commented 3 years ago

@kidmirage Just updated it on PyPi. Can you check if it fixes it on your end, please?

kidmirage commented 3 years ago

Thanks for getting back to me Ivan,

setup.py does not error now but I get the following result:

Collecting z80 Using cached z80-0.1b1.tar.gz (25 kB) Using legacy 'setup.py install' for z80, since package 'wheel' is not installed. Installing collected packages: z80 Running setup.py install for z80: started ERROR: Command errored out with exit status 1: command: 'd:\python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Micha\AppData\Local\Temp\pip-install-ci4n5doj\z80_90b1c9aa0e3c4aa6a7ee4f9c74e9c34c\setup.py'"'"'; file='"'"'C:\Users\Micha\AppData\Local\Temp\pip-install-ci4n5doj\z80_90b1c9aa0e3c4aa6a7ee4f9c74e9c34c\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\Micha\AppData\Local\Temp\pip-record-fi4f19lo\install-record.txt' --single-version-externally-managed --compile --install-headers 'd:\python39\Include\z80' cwd: C:\Users\Micha\AppData\Local\Temp\pip-install-ci4n5doj\z80_90b1c9aa0e3c4aa6a7ee4f9c74e9c34c\ Complete output (85 lines): running install running build running build_py creating build creating build\lib.win-amd64-3.9 creating build\lib.win-amd64-3.9\z80 copying z80_disasm.py -> build\lib.win-amd64-3.9\z80 copying z80_disasm_parser.py -> build\lib.win-amd64-3.9\z80 copying z80_error.py -> build\lib.win-amd64-3.9\z80 copying z80_instr.py -> build\lib.win-amd64-3.9\z80 copying z80_machine.py -> build\lib.win-amd64-3.9\z80 copying z80_main.py -> build\lib.win-amd64-3.9\z80 copying z80_source.py -> build\lib.win-amd64-3.9\z80 copying z80_token.py -> build\lib.win-amd64-3.9\z80 copying z80__init.py -> build\lib.win-amd64-3.9\z80 running build_ext building 'z80._z80' extension creating build\temp.win-amd64-3.9 creating build\temp.win-amd64-3.9\Release creating build\temp.win-amd64-3.9\Release\z80 C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Id:\python39\include -Id:\python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /EHsc /Tpz80/_z80module.cpp /Fobuild\temp.win-amd64-3.9\Release\z80/_z80module.obj -std=c++11 -Wall -fno-exceptions -fno-rtti -O3 cl : Command line warning D9002 : ignoring unknown option '-std=c++11' cl : Command line warning D9002 : ignoring unknown option '-fno-exceptions' cl : Command line warning D9002 : ignoring unknown option '-fno-rtti' cl : Command line warning D9002 : ignoring unknown option '-O3' _z80module.cpp C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\corecrt_io.h(49): warning C4820: '_finddata32i64_t': '4' bytes padding added after data member '_finddata32i64_t::name' C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\corecrt_io.h(54): warning C4820: '_finddata64i32_t': '4' bytes padding added after data member '_finddata64i32_t::attrib' C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\corecrt_io.h(64): warning C4820: 'finddata64_t': '4' bytes padding added after data member 'finddata64_t::attrib' C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\corecrt_io.h(69): warning C4820: 'finddata64_t': '4' bytes padding added after data member '__finddata64_t::name' C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\time.h(36): warning C4820: '_timespec64': '4' bytes padding added after data member '_timespec64::tv_nsec' C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\time.h(43): warning C4820: 'timespec': '4' bytes padding added after data member 'timespec::tv_nsec' d:\python39\include\object.h(198): warning C4820: '': '4' bytes padding added after data member '::slot' d:\python39\include\object.h(206): warning C4820: '': '4' bytes padding added after data member '::flags' d:\python39\include\cpython/object.h(228): warning C4820: '_typeobject': '4' bytes padding added after data member '_typeobject::tp_flags' d:\python39\include\cpython/object.h(272): warning C4820: '_typeobject': '4' bytes padding added after data member '_typeobject::tp_version_tag' d:\python39\include\cpython/bytesobject.h(15): warning C4820: '': '7' bytes padding added after data member '::ob_sval' d:\python39\include\cpython/bytesobject.h(65): warning C4820: '': '4' bytes padding added after data member '::small_buffer' d:\python39\include\cpython/unicodeobject.h(218): warning C4820: '': '4' bytes padding added after data member '::state' d:\python39\include\cpython/unicodeobject.h(626): warning C4820: '': '2' bytes padding added after data member '::readonly' d:\python39\include\longintrepr.h(88): warning C4820: '_longobject': '4' bytes padding added after data member '_longobject::ob_digit' d:\python39\include\memoryobject.h(45): warning C4820: '': '4' bytes padding added after data member '::flags' d:\python39\include\memoryobject.h(62): warning C4820: '': '4' bytes padding added after data member '::flags' d:\python39\include\methodobject.h(40): warning C4820: 'PyMethodDef': '4' bytes padding added after data member 'PyMethodDef::ml_flags' d:\python39\include\moduleobject.h(63): warning C4820: 'PyModuleDef_Slot': '4' bytes padding added after data member 'PyModuleDef_Slot::slot' d:\python39\include\cpython/code.h(27): warning C4820: 'PyCodeObject': '4' bytes padding added after data member 'PyCodeObject::co_firstlineno' d:\python39\include\cpython/code.h(64): warning C4820: 'PyCodeObject': '3' bytes padding added after data member 'PyCodeObject::co_opcache_size' d:\python39\include\cpython/initconfig.h(16): warning C4820: '': '4' bytes padding added after data member '::_type' d:\python39\include\cpython/initconfig.h(19): warning C4820: '': '4' bytes padding added after data member '::exitcode' d:\python39\include\cpython/initconfig.h(209): warning C4820: '': '4' bytes padding added after data member '::parse_argv' d:\python39\include\cpython/initconfig.h(364): warning C4820: '': '4' bytes padding added after data member '::legacy_windows_stdio' d:\python39\include\cpython/initconfig.h(374): warning C4820: '': '4' bytes padding added after data member '::pathconfig_warnings' d:\python39\include\cpython/initconfig.h(381): warning C4820: '': '4' bytes padding added after data member '::module_search_paths_set' d:\python39\include\cpython/initconfig.h(401): warning C4820: '': '4' bytes padding added after data member '::skip_source_first_line' d:\python39\include\cpython/initconfig.h(424): warning C4820: '': '4' bytes padding added after data member '::_isolated_interpreter' d:\python39\include\cpython/pystate.h(65): warning C4820: '_ts': '2' bytes padding added after data member '_ts::recursion_critical' d:\python39\include\cpython/pystate.h(73): warning C4820: '_ts': '4' bytes padding added after data member '_ts::use_tracing' d:\python39\include\cpython/pystate.h(96): warning C4820: '_ts': '4' bytes padding added after data member '_ts::gilstate_counter' d:\python39\include\cpython/pystate.h(130): warning C4820: '_ts': '4' bytes padding added after data member '_ts::coroutine_origin_tracking_depth' d:\python39\include\genobject.h(33): warning C4820: '': '7' bytes padding added after data member '::gi_running' d:\python39\include\genobject.h(52): warning C4820: '': '7' bytes padding added after data member '::cr_running' d:\python39\include\genobject.h(67): warning C4820: '': '7' bytes padding added after data member '::ag_running' d:\python39\include\genobject.h(80): warning C4820: '': '4' bytes padding added after data member '::ag_running_async' d:\python39\include\descrobject.h(29): warning C4820: 'wrapperbase': '4' bytes padding added after data member 'wrapperbase::offset' d:\python39\include\descrobject.h(33): warning C4820: 'wrapperbase': '4' bytes padding added after data member 'wrapperbase::flags' d:\python39\include\structseq.h(20): warning C4820: 'PyStructSequence_Desc': '4' bytes padding added after data member 'PyStructSequence_Desc::n_in_sequence' d:\python39\include\cpython/pyerrors.h(19): warning C4820: '': '7' bytes padding added after data member '::suppress_context' d:\python39\include\cpython/pyerrors.h(23): warning C4820: '': '7' bytes padding added after data member '::suppress_context' d:\python39\include\cpython/pyerrors.h(33): warning C4820: '': '7' bytes padding added after data member '::suppress_context' d:\python39\include\cpython/pyerrors.h(40): warning C4820: '': '7' bytes padding added after data member '::suppress_context' d:\python39\include\cpython/pyerrors.h(49): warning C4820: '': '7' bytes padding added after data member '::suppress_context' d:\python39\include\cpython/pyerrors.h(54): warning C4820: '': '7' bytes padding added after data member '::suppress_context' d:\python39\include\cpython/pyerrors.h(66): warning C4820: '': '7' bytes padding added after data member '::suppress_context' d:\python39\include\modsupport.h(100): warning C4820: '_PyArg_Parser': '4' bytes padding added after data member '_PyArg_Parser::max' d:\python39\include\cpython/import.h(41): warning C4820: '_frozen': '4' bytes padding added after data member '_frozen::size' d:\python39\include\cpython/abstract.h(62): warning C4365: 'return': conversion from 'size_t' to 'Py_ssize_t', signed/unsigned mismatch d:\python39\include\cpython/fileutils.h(54): warning C4820: '_Py_stat_struct': '4' bytes padding added after data member '_Py_stat_struct::st_dev' d:\python39\include\cpython/fileutils.h(56): warning C4820: '_Py_stat_struct': '2' bytes padding added after data member '_Py_stat_struct::st_mode' d:\python39\include\cpython/fileutils.h(60): warning C4820: '_Py_stat_struct': '4' bytes padding added after data member '_Py_stat_struct::st_rdev' d:\python39\include\cpython/fileutils.h(63): warning C4820: '_Py_stat_struct': '4' bytes padding added after data member '_Py_stat_struct::st_atime_nsec' d:\python39\include\cpython/fileutils.h(65): warning C4820: '_Py_stat_struct': '4' bytes padding added after data member '_Py_stat_struct::st_mtime_nsec' d:\python39\include\cpython/fileutils.h(69): warning C4820: '_Py_stat_struct': '4' bytes padding added after data member '_Py_stat_struct::st_reparse_tag' z80/_z80module.cpp(17): warning C4464: relative include path contains '..' z80/_z80module.cpp(17): fatal error C1083: Cannot open include file: '../z80.h': No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\bin\HostX86\x64\cl.exe' failed with exit code 2

ERROR: Command errored out with exit status 1: 'd:\python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Micha\AppData\Local\Temp\pip-install-ci4n5doj\z80_90b1c9aa0e3c4aa6a7ee4f9c74e9c34c\setup.py'"'"'; file='"'"'C:\Users\Micha\AppData\Local\Temp\pip-install-ci4n5doj\z80_90b1c9aa0e3c4aa6a7ee4f9c74e9c34c\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\Micha\AppData\Local\Temp\pip-record-fi4f19lo\install-record.txt' --single-version-externally-managed --compile --install-headers 'd:\python39\Include\z80' Check the logs for full command output. Running setup.py install for z80: finished with status 'error' FINISHED

Mike

On Sun, Aug 29, 2021 at 12:54 PM Ivan Kosarev @.***> wrote:

@kidmirage https://github.com/kidmirage Just updated it on PyPi. Can you check if it fixes it on your end, please?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kosarev/z80/issues/33#issuecomment-907826680, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARSB2XPZP3VTGRIQ3AISA7LT7JQ4XANCNFSM5DAKHYOQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

kosarev commented 3 years ago

Right, there's no Windows support yet. I should be able to look into this, if you can give me the full command reproducing the issue (sorry, I have no experience with Python on Windows).

kidmirage commented 3 years ago

Hi Ivan,

I have been able to install z80 on a Raspberry Pi 4 and run the exercisers.py and single_stepping.py examples. Since this is my target environment for the Sol 20 emulator anyway I'm Ok with this for now (although Pi/Thonny is not as powerful as my Windows/LiClipse development environment). In both environments I get the following error when trying to use pip:

z80/_z80module.cpp(17): warning C4464: relative include path contains

'..' z80/_z80module.cpp(17): fatal error C1083: Cannot open include file: '../z80.h': No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\bin\HostX86\x64\cl.exe' failed with exit code 2

To get z80 to install on the raspberry pi I cloned from git and ran "python setup.py install" manually. If I try a manual install on Windows I get the compile errors I forwarded earlier.

Mike

On Sun, Aug 29, 2021 at 1:29 PM Ivan Kosarev @.***> wrote:

Right, there's no Windows support yet. I should be able to look into this, if you can give me the full command reproducing the issue (sorry, I have no experience with Python on Windows).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kosarev/z80/issues/33#issuecomment-907832780, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARSB2XI42TYAFPZC2JOYO6DT7JU7ZANCNFSM5DAKHYOQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

kosarev commented 3 years ago

Windows install issues went to #36.