On 22/03/2024 08:25, Simon Tournier wrote:
Hi,
On jeu., 21 mars 2024 at 18:03, Alexis Simon via Guix-Science
<guix-scie...@gnu.org> wrote:
The build is failing with this error:
running build_ext
# cyvcf2: htslib mode is BUILTIN
# cyvcf2: htslib configure options is None
error: [Errno 2] No such file or directory: './configure'
error: in phase 'build': uncaught exception:
%exception #<&invoke-error program: "python" arguments: ("./setup.py"
"build") exit-status: 1 term-signal: #f stop-signal: #f>
What is very disturbing is that it builds fine in a debugging
environment following the documentation [2]
Indeed! Well, another undocumented trick. ;-)
guix build -L . python-cyvcf2 \
--with-source=python-cyvcf2=/tmp/cyvcf2-0.30.28
where /tmp/cyvcf2-0.30.28 is the uncompressed output of “guix build -S”
that I tweak. Adding this:
--8<---------------cut here---------------start------------->8---
diff -u /tmp/guix-build-python-cyvcf2-0.30.28.drv-0/cyvcf2-0.30.28/setup.py
/tmp/cyvcf2-0.30.28/setup.py
--- /tmp/guix-build-python-cyvcf2-0.30.28.drv-0/cyvcf2-0.30.28/setup.py
2024-01-30 17:46:32.000000000 +0100
+++ /tmp/cyvcf2-0.30.28/setup.py 2024-03-22 16:15:28.124301350 +0100
@@ -83,7 +83,13 @@
if htslib_configure_options:
configure_args.extend(htslib_configure_options.split())
- subprocess.run(configure_args, check=True)
+ print(configure_args,
+ "File exists?", os.path.exists(configure_args[0]),
+ flush=True)
+ try:
+ subprocess.run(configure_args, check=True)
+ except:
+ print("BANG!")
subprocess.run(["make"], check=True)
os.chdir(current_directory)
--8<---------------cut here---------------end--------------->8---
It leads to this output:
--8<---------------cut here---------------start------------->8---
running build_ext
# cyvcf2: htslib mode is BUILTIN
# cyvcf2: htslib configure options is None
['./configure', 'CFLAGS=-fPIC'] File exists? True
echo '# Default htscodecs.mk generated by Makefile' > htscodecs.mk
echo 'include $(HTSPREFIX)htscodecs_bundled.mk' >> htscodecs.mk
./hts_probe_cc.sh 'gcc' '-g -Wall -O2 -fvisibility=hidden ' '-fvisibility=hidden'
>> htscodecs.mk
/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/sh: line 1:
./hts_probe_cc.sh: No such file or directory
Makefile:141: htscodecs.mk: No such file or directory
make: *** [Makefile:124: htscodecs.mk] Error 127
BANG!
Traceback (most recent call last):
[...]
--8<---------------cut here---------------end--------------->8---
Arf, then I have not investigated further.
I think it does not come from ’./configure’ as wrongly reported but from
something triggered by it.
Let me know your progress. Maybe I could give a closer look next week.
Thanks a lot for the trick, I was able to finish compiling it, but going
another route (i.e. unbundling htslib).
I've abandoned running the tests though, I'm hitting a module not found
error. pytest doesn't manage to load the just built module, probably an
issue with the paths.
I'm attaching the new version for reference.
Cheers,
Alexis
Cheers,
simon
(define-module (cyvcf2)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (gnu packages)
#:use-module (gnu packages base)
#:use-module (gnu packages autotools)
#:use-module (gnu packages build-tools)
#:use-module (gnu packages cmake)
#:use-module (gnu packages check)
#:use-module (gnu packages python)
#:use-module (gnu packages python-build)
#:use-module (gnu packages python-check)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages python-science)
#:use-module (gnu packages python-web)
#:use-module (gnu packages bioinformatics)
#:use-module (gnu packages serialization)
#:use-module (gnu packages compression)
#:use-module (gnu packages curl)
#:use-module (gnu packages tls)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix utils)
#:use-module (guix build-system python)
#:use-module (guix build-system cargo)
#:use-module (guix build-system cmake)
#:use-module (guix build-system pyproject))
(define-public python-cyvcf2
(package
(name "python-cyvcf2")
(version "0.30.28")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/brentp/cyvcf2")
(commit (string-append "v" version))))
(sha256
(base32 "16yhfax509zyip8kkq2b0lflx5bdq5why7d785ayrqyzzq2rxqkk"))
(modules '((guix build utils)))
(snippet
'(begin
(delete-file-recursively "htslib")))))
(build-system pyproject-build-system)
(arguments
`(#:tests? #f
#:phases
(modify-phases %standard-phases
; (add-before 'check 'rm-folder
; (lambda _
; (copy-recursively "cyvcf2/tests" "./tests")
; (delete-file-recursively "cyvcf2")
; (mkdir-p "cyvcf2")
; (copy-recursively "tests" "cyvcf2/tests")))
(add-after 'unpack 'fix-setup
(lambda* (#:key inputs #:allow-other-keys)
(substitute* "setup.py"
((" or not check_libhts\\(\\)") "")
(("library_dirs=htslib_library_dirs")
(string-append "library_dirs=[\"" (assoc-ref inputs "htslib") "/lib\"]"))
(("\\+ htslib_include_dirs")
(string-append "+ [\"" (assoc-ref inputs "htslib") "/include\"]")))))
(add-before 'build 'setenv
(lambda _
(setenv "CYTHONIZE" "1")
(setenv "CYVCF2_HTSLIB_MODE" "EXTERNAL"))))))
(inputs (list htslib zlib libdeflate curl openssl python-cython))
(native-inputs (list python-pytest))
(propagated-inputs (list python-click
python-coloredlogs
python-numpy))
(home-page "https://github.com/brentp/cyvcf2/")
(synopsis "fast vcf parsing with cython + htslib")
(description "fast vcf parsing with cython + htslib")
(license license:expat)))