From: Pjotr Prins <pjotr.public12@thebird.nl>
To: Hartmut Goebel <h.goebel@crazy-compilers.com>
Cc: guix-devel@gnu.org
Subject: Provide python:debug with --with-pydebug switch
Date: Sat, 24 Mar 2018 09:12:34 +0100 [thread overview]
Message-ID: <20180324081234.GA14831@thebird.nl> (raw)
[-- Attachment #1: Type: text/plain, Size: 352 bytes --]
Attached a quick hack I did to get a Python interpreter with full
debug facilities. It includes the built-in debugging/tracing
facilities. I think this is a valuable thing to have as a package
https://pythonextensionpatterns.readthedocs.io/en/latest/debugging/debug_python.html
especially when writing native extensions (shared libs)
wdyt?
Pj.
[-- Attachment #2: python-debug.patch --]
[-- Type: text/x-diff, Size: 1598 bytes --]
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 4baef4391..79788520a 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -387,7 +387,6 @@ data types.")
(package (inherit python)
(name "python-minimal")
(outputs '("out"))
-
;; Build fails due to missing ctypes without libffi.
;; OpenSSL is a mandatory dependency of Python 3.x, for urllib;
;; zlib is required by 'zipimport', used by pip.
@@ -395,6 +394,28 @@ data types.")
("openssl" ,openssl)
("zlib" ,zlib)))))
+(define-public python-debug
+ (package (inherit python)
+ (name "python-debug")
+ (outputs '("out" "debug"))
+ ;; Build fails due to missing ctypes without libffi.
+ ;; OpenSSL is a mandatory dependency of Python 3.x, for urllib;
+ ;; zlib is required by 'zipimport', used by pip.
+ (inputs `(("libffi" ,libffi)
+ ("openssl" ,openssl)
+ ("zlib" ,zlib)))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f
+ #:configure-flags
+ (list "--enable-shared" ;allow embedding
+ "--with-system-ffi" ;build ctypes
+ "--with-ensurepip=install" ;install pip and setuptools
+ "--enable-unicode=ucs4"
+ "--with-pydebug"
+ (string-append "LDFLAGS=-Wl,-rpath=" (assoc-ref %outputs "out") "/lib"))
+ ))))
+
(define* (wrap-python3 python
#:optional
(name (string-append (package-name python) "-wrapper")))
next reply other threads:[~2018-03-24 8:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-24 8:12 Pjotr Prins [this message]
2018-03-26 13:13 ` Provide python:debug with --with-pydebug switch Ludovic Courtès
2018-03-26 19:12 ` Hartmut Goebel
2018-03-27 5:48 ` Pjotr Prins
2018-03-29 13:20 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180324081234.GA14831@thebird.nl \
--to=pjotr.public12@thebird.nl \
--cc=guix-devel@gnu.org \
--cc=h.goebel@crazy-compilers.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).