mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
build-system/pyproject: Avoid PEP427 substitution on binary files.
In some rare cases, the dest-path can be an elf-file, which are unreadable by substitute*, leading to an error instead of just continuing which makes more sense in this case. * guix/build-system/pyproject.scm (check): Guard substitution attempt with basic readability guarantees. Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
This commit is contained in:
parent
9abb1ffe7d
commit
75614b830b
1 changed files with 5 additions and 4 deletions
|
@ -218,10 +218,11 @@ builder.build_wheel(sys.argv[3], config_settings=config_settings)"
|
||||||
(lambda (file)
|
(lambda (file)
|
||||||
(chmod file #o755)
|
(chmod file #o755)
|
||||||
;; PEP 427 recommends that installers rewrite
|
;; PEP 427 recommends that installers rewrite
|
||||||
;; this odd shebang.
|
;; this odd shebang, but avoid the binary case.
|
||||||
(substitute* file
|
(unless (elf-file? file)
|
||||||
(("#!python")
|
(substitute* file
|
||||||
(string-append "#!" python "/bin/python"))))
|
(("#!python")
|
||||||
|
(string-append "#!" python "/bin/python")))))
|
||||||
(find-files destination))))
|
(find-files destination))))
|
||||||
;; Data can be contained in arbitrary directory structures. Most
|
;; Data can be contained in arbitrary directory structures. Most
|
||||||
;; commonly it is used for share/.
|
;; commonly it is used for share/.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue