From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu From: Randolph Fritz Message-ID: References: , <200101022110.QAA20807@csociety.ecn.purdue.edu> Subject: Re: [9fans] A Plan 9 Python Interest Group? Date: Wed, 3 Jan 2001 09:43:27 +0000 Topicbox-Message-UUID: 429951f6-eac9-11e9-9e20-41e7f4b1d025 On Wed, 3 Jan 2001 06:49:19 GMT, Jonathan Sergent wrote: > >I made a start at the APE port (I have not worked on it for a while...) >which you can get from > > ftp://csociety-ftp.ecn.purdue.edu/pub/plan9 > >I think mine ended up in the same situation that you have yours in... > Very cool! Mine started squirming in the APE tonight. It is actually running most of the test scripts for the modules I was able to build. The immediate problem areas are: - I don't have an environment where I can easily test the "socket" module - complex math is broken - test_longexp does lots of page thrashing (perhaps because my system doesn't have enough memory) I am also realizing, as I review my notes, that this needs to be tested with checks for memory leaks turned on. D'oh! Beyond that, I need information from Python experts on how best to add the Plan 9 platform to their source--anyone who actually knows something about this please comment!--and thoughts on how to 9ify the installation. My current thought on an installation is to have a /Python directory with $cputype and lib directories at the second level; the appropriate directories could then be unioned with the system directories. But this may be very bogus--what do you experts think? > >I am interested but I don't have tons of time. > Oh, well. I've attached my notes and the results of the builtin test scripts. I know some of the stuff I've done to get this going is gross--I am rapidly getting to hate conditional compilation--but it's sort-of working and I'm pleased with that. If anyone wants to build this you will also need a copy of my v7ish grep for the APE, to make the configure script go. Randolph ------------- Python/APE porting notes, so far --------------- Environment: CFLAGS=-lap -D_BSD_EXTENSION Makefile: set OPT to -D_BSD_EXTENSION (for some reason configure thinks a -O command works. it doesn't) Plan 9 does not support "mv -f" (remove the -f) LN=cp config.h: turn off HAVE_FSYNC, GETPGRP_HAVE_ARG, HAVE__GETPTY Add PLAN9_APE definition (I would prefer this be done by configure) Include/Python.h: (this may not work) #ifdef PLAN9_APE #undef assert #define assert(e) ((e) || (_assert(__FILE__, __LINE__),0)) #endif Modules/Makefile.pre: same for OPT Modules/mathmodule.c: #ifdef PLAN9_APE extern double hypot(double, double); #endif Modules/timemodule.c: (this needs to be fixed up--it is west coast US specific) Provide 9-ish "timezone" and "daylight" variables, hack: #ifdef PLAN9_APE static long timezone = -28800; static long daylight = 1; #endif Modules/_localemodule.c: #ifdef PLAN9_APE #include #endif Modules/fcntlmodule.c: #ifndef PLAN9_APE ret = ioctl(fd, code, buf); #else ret = ioctl(fd, code, (void*) buf); #endif Modules/selectmodule.c: #ifdef PLAN9_APE #define FD_SETSIZE 96 #endif Modules/socketmodule.c: getprotobyname() not avail--ifdef it out Modules/pwdmodule.c: .../grpmodule.c: .../mmapmodule.c: Not supported here. just drop 'em. At this point it builds...but...it fails the "cmath" test, apparently because taking the absolute value of a complex number doesn't work. test_longexp.py sends my system into page thrashing test_socket doesn't work because I don't have a network The Makefile references -lsocket and -ldir--these are unnecessary & unavailable ----------- test results ----------- test_grammar test_opcodes test_operations test_builtin test_exceptions test_types test_MimeWriter test_StringIO test_al test test_al skipped -- No module named al test_array test_atexit test_audioop test test_audioop skipped -- No module named audioop test_augassign test_binascii test_binhex test_bsddb test test_bsddb skipped -- No module named bsddb test_cd test test_cd skipped -- No module named cd test_cfgparser test_cgi test_cl test test_cl skipped -- No module named cl test_class test_compile test_contains test_cookie test_copy_reg test_cpickle test_crypt test test_crypt skipped -- No module named crypt test_dbm test test_dbm skipped -- No module named dbm test_dl test test_dl skipped -- No module named dl test_dospath test_errno test_extcall test_fcntl test test_fcntl skipped -- No module named FCNTL test_file test_fork1 test test_fork1 skipped -- No module named thread test_format test_gc test_gdbm test test_gdbm skipped -- No module named gdbm test_getopt test_gettext test_gl test test_gl skipped -- No module named gl test_grp test test_grp skipped -- No module named grp test_gzip test test_gzip skipped -- No module named zlib test_hash test_imageop test test_imageop skipped -- No module named imageop test_imgfile test test_imgfile skipped -- No module named imgfile test_import test_largefile test test_largefile skipped -- platform does not have largefile support test_linuxaudiodev test test_linuxaudiodev skipped -- No module named linuxaudiodev test_long test_math test_md5 test_mimetools test_minidom test test_minidom skipped -- No module named pyexpat test_mmap test test_mmap skipped -- No module named mmap test_new test_nis test test_nis skipped -- No module named nis test_ntpath test_openpty test test_openpty skipped -- No openpty() available. test_operator test_parser test_pickle test_pkg test_poll test test_poll skipped -- select.poll not defined -- skipping test_poll test_popen2 test_posixpath test_pow test_pty test test_pty skipped -- No module named FCNTL test_pwd test test_pwd skipped -- No module named pwd test_pyexpat test test_pyexpat skipped -- cannot import name expat test_re test_regex test_rfc822 test_rgbimg test test_rgbimg skipped -- No module named rgbimg test_rotor test_sax test test_sax skipped -- no XML parsers available test_select test_sha test_signal test_socket test test_socket crashed -- socket.error: host not found test_sre test_strftime test_string test_strop test_struct test_sunaudiodev test test_sunaudiodev skipped -- No module named sunaudiodev test_thread test test_thread skipped -- No module named thread test_time test_timing test test_timing skipped -- No module named timing test_tokenize test_ucn test_unicode test_unicodedata test_unpack test_urllib test_urlparse test_userdict test_userlist test_userstring test_wave test_winreg test test_winreg skipped -- No module named _winreg test_winsound test test_winsound skipped -- No module named winsound test_xmllib test_zipfile test_zlib test test_zlib skipped -- No module named zlib 70 tests OK. 1 test failed: test_socket 34 tests skipped: test_al test_audioop test_bsddb test_cd test_cl test_crypt test_dbm test_dl test_fcntl test_fork1 test_gdbm test_gl test_grp test_gzip test_imageop test_imgfile test_largefile test_linuxaudiodev test_minidom test_mmap test_nis test_openpty test_poll test_pty test_pwd test_pyexpat test_rgbimg test_sax test_sunaudiodev test_thread test_timing test_winreg test_winsound test_zlib