unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Efraim Flashner <efraim@flashner.co.il>
To: Malte Frank Gerdes <malte.f.gerdes@gmail.com>
Cc: 43855@debbugs.gnu.org
Subject: bug#43855: gnu: python-shapely fails to build
Date: Thu, 8 Oct 2020 09:44:27 +0300	[thread overview]
Message-ID: <20201008064427.GN21174@E5400> (raw)
In-Reply-To: <86h7r567u6.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 5164 bytes --]

On Wed, Oct 07, 2020 at 11:32:01PM +0200, Malte Frank Gerdes wrote:
> Hi,
> 
> python-shapely fails to build, because it can't find the c libary,
> the package definition was not complete (patch at the end).
> 
> Now the package finds a C libary but the Test Suite fails with the
> follwoing error:
> 
> --8<---------------cut here---------------start------------->8---
> ======================================================================
> FAIL: test_operations (tests.test_operations.OperationsTestCase)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/tmp/guix-build-python-shapely-1.6.4.post2.drv-0/Shapely-1.6.4.post2/tests/test_operations.py", line 25, in test_operations
>     self.assertIsInstance(point.intersection(Point(-1, -1)),
> AssertionError: <shapely.geometry.point.Point object at 0x7fffe1544f70> is not an instance of <class 'shapely.geometry.collection.GeometryCollection'>
> --8<---------------cut here---------------end--------------->8---
> 
> This package was last successfully built on 13th September.
> 

It turns out this is due to a change in geos with 3.8
https://github.com/Toblerity/Shapely/issues/799

If I cherry-pick the patch to fix it then it passes the test suite. If I
upgrade python-shapely to 1.7.1 the fix is already included but there's
a new build error:

gcc -pthread -shared -Wl,-rpath=/gnu/store/q9rm8h9imazsq2c4qiv2yjpvlvliywqb-python-3.8.2/lib build/temp.linux-x86_64-3.8/shapely/vectorized/_vectorized.o -L/gnu/store/pinvpk9w6izxcwci4ghiwgvykmgsfy2c-geos-3.8.1/lib -L/gnu/store/q9rm8h9imazsq2c4qiv2yjpvlvliywqb-python-3.8.2/lib -lgeos_c -o /tmp/guix-build-python-shapely-1.7.1.drv-0/Shapely-1.7.1/shapely/vectorized/_vectorized.cpython-38-x86_64-linux-gnu.so
warning: no library file corresponding to '/gnu/store/603imkkh2bqs01z8ik0b2ndgpdz0jghk-python-numpy-1.17.3/lib/python3.8/site-packages/numpy/core/include' found (skipping)
warning: no library file corresponding to '/gnu/store/603imkkh2bqs01z8ik0b2ndgpdz0jghk-python-numpy-1.17.3/lib/python3.8/site-packages/numpy/core/include' found (skipping)
error: Could not find lib c or load any of its variants ['libc.musl-x86_64.so.1'].
command "python" "-c" "import setuptools, tokenize;__file__='setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\\r\\n', '\\n');f.close();exec(compile(code, __file__, 'exec'))" "test" failed with status 1
builder for `/gnu/store/2yz1ybl0156canhfz4vhay0g473c5nwv-python-shapely-1.7.1.drv' failed with exit code 1
build of /gnu/store/2yz1ybl0156canhfz4vhay0g473c5nwv-python-shapely-1.7.1.drv failed
View build log at '/var/log/guix/drvs/2y/z1ybl0156canhfz4vhay0g473c5nwv-python-shapely-1.7.1.drv.bz2'.
guix build: error: build of `/gnu/store/2yz1ybl0156canhfz4vhay0g473c5nwv-python-shapely-1.7.1.drv' failed

Do you want to take a stab at updating python-shapely to 1.7.1?

> 
> Malte
> 
> --8<---------------cut here---------------start------------->8---
> diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
> index 459526941b..02744bfc6d 100644
> --- a/gnu/packages/python-xyz.scm
> +++ b/gnu/packages/python-xyz.scm
> @@ -533,13 +533,16 @@ pidof, tty, taskset, pmap.")
>               (let ((geos (assoc-ref inputs "geos"))
>                     (glibc (assoc-ref inputs ,(if (%current-target-system)
>                                                   "cross-libc" "libc"))))
> -               (substitute* "shapely/geos.py"
> -                 (("_lgeos = load_dll\\('geos_c', fallbacks=.*\\)")
> -                  (string-append "_lgeos = load_dll('geos_c', fallbacks=['"
> -                                 geos "/lib/libgeos_c.so'])"))
> -                 (("free = load_dll\\('c'\\)\\.free")
> -                  (string-append "free = load_dll('c', fallbacks=['"
> -                                 glibc "/lib/libc.so.6']).free"))))
> +               (map
> +                (lambda (file)
> +                  (substitute* file
> +                    (("_lgeos = load_dll\\('geos_c', fallbacks=.*\\)")
> +                     (string-append "_lgeos = load_dll('geos_c', fallbacks=['"
> +                                    geos "/lib/libgeos_c.so'])"))
> +                    (("free = load_dll\\('c'\\)\\.free")
> +                     (string-append "free = load_dll('c', fallbacks=['"
> +                                    glibc "/lib/libc.so.6']).free"))))
> +                '("shapely/geos.py" "shapely/_buildcfg.py")))
>               #t)))))
>      (home-page "https://github.com/Toblerity/Shapely")
>      (synopsis "Library for the manipulation and analysis of geometric objects")
> --8<---------------cut here---------------end--------------->8---
> 

substitute* can take a list, so it would be simpler to write this as:
substitute* '("shapely/geos.py"
              "shapely/_buildcfg.py")

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-10-08  6:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-07 21:32 bug#43855: gnu: python-shapely fails to build Malte Frank Gerdes
2020-10-08  6:44 ` Efraim Flashner [this message]
2020-10-08 12:05   ` Malte Frank Gerdes
2020-10-09  4:59     ` Efraim Flashner
2020-10-08 18:25 ` bug#43855: [PATCH] gnu: python-shapely: Update to 1.7.1 Malte Frank Gerdes
2020-10-09  5:01   ` Efraim Flashner

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=20201008064427.GN21174@E5400 \
    --to=efraim@flashner.co.il \
    --cc=43855@debbugs.gnu.org \
    --cc=malte.f.gerdes@gmail.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).