Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 836599 - dev-python/symengine-0.9.2 - error: Multiple top-level packages discovered in a flat-layout: [cmake, symengine].
Summary: dev-python/symengine-0.9.2 - error: Multiple top-level packages discovered in...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Science Mathematics related packages
Depends on:
Blocks: 836676
  Show dependency tree
Reported: 2022-04-01 14:31 UTC by Toralf Förster
Modified: 2022-05-04 04:29 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---

emerge-info.txt (emerge-info.txt,19.48 KB, text/plain)
2022-04-01 14:31 UTC, Toralf Förster
dev-python:symengine-0.9.2:20220401-110159.log (dev-python:symengine-0.9.2:20220401-110159.log,3.29 KB, text/plain)
2022-04-01 14:31 UTC, Toralf Förster
emerge-history.txt.bz2 (emerge-history.txt.bz2,130.03 KB, application/x-bzip)
2022-04-01 14:31 UTC, Toralf Förster
environment (environment,125.89 KB, text/plain)
2022-04-01 14:31 UTC, Toralf Förster
etc.portage.tar.bz2 (etc.portage.tar.bz2,56.48 KB, application/x-bzip)
2022-04-01 14:31 UTC, Toralf Förster
temp.tar.bz2 (temp.tar.bz2,28.16 KB, application/x-bzip)
2022-04-01 14:31 UTC, Toralf Förster

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2022-04-01 14:31:22 UTC
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-python/symengine-0.9.2/work/ ...
 * python3_9: running distutils-r1_run_phase distutils-r1_python_compile
python3.9 build -j 4
error: Multiple top-level packages discovered in a flat-layout: ['cmake', 'symengine'].

To avoid accidental inclusion of unwanted files or directories,


  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1-j4-20220321-160039


gcc-config -l:
 [1] x86_64-pc-linux-gnu-9.3.1
 [2] x86_64-pc-linux-gnu-10.3.1
 [3] x86_64-pc-linux-gnu-11.2.1 *
clang/llvm (if any):
clang version 14.0.0
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/14/bin
Python 3.9.12
Available Ruby profiles:
  [1]   ruby26 (with Rubygems)
  [2]   ruby27 (with Rubygems)
  [3]   ruby31 (with Rubygems) *
Available Rust versions:
  [1]   rust-bin-1.59.0
  [2]   rust-1.59.0 *
The following VMs are available for generation-2:
1)	Eclipse Temurin JRE 11.0.14_p9 [openjdk-jre-bin-11]
*)	Eclipse Temurin JRE 8.322_p06 [openjdk-jre-bin-8]
Available Java Virtual Machines:
  [1]   openjdk-jre-bin-8  system-vm
  [2]   openjdk-jre-bin-11 

The Glorious Glasgow Haskell Compilation System, version 8.10.4
php cli:

  HEAD of ::gentoo
commit 0c0e3603ab8f258dede73f6a65d2102ddadc7a4f
Author: Repository mirror & CI <>
Date:   Fri Apr 1 10:19:43 2022 +0000

    2022-04-01 10:19:41 UTC

emerge -qpvO dev-python/symengine
[ebuild  N    ] dev-python/symengine-0.9.2  USE="-test" PYTHON_TARGETS="python3_9 -python3_8 -python3_10"
Comment 1 Toralf Förster gentoo-dev 2022-04-01 14:31:23 UTC
Created attachment 768386 [details]
Comment 2 Toralf Förster gentoo-dev 2022-04-01 14:31:24 UTC
Created attachment 768387 [details]
Comment 3 Toralf Förster gentoo-dev 2022-04-01 14:31:26 UTC
Created attachment 768388 [details]
Comment 4 Toralf Förster gentoo-dev 2022-04-01 14:31:27 UTC
Created attachment 768389 [details]
Comment 5 Toralf Förster gentoo-dev 2022-04-01 14:31:28 UTC
Created attachment 768390 [details]
Comment 6 Toralf Förster gentoo-dev 2022-04-01 14:31:29 UTC
Created attachment 768391 [details]
Comment 7 Maurizio Contu 2022-04-11 08:48:51 UTC
I have the same problem, seems this issue is related with setuptools. In my build dev-python/symengine only compiles with dev-python/setuptools-60.9.2!
Comment 8 Cecil Curry 2022-05-02 03:32:30 UTC
I third this. Thanks to Maurizio Contu for identifying a quick fix! In my case, though, I'm *definitely* not downgrading setuptools just to emerge symengine – especially because setuptools > 60.9.2 is absolutely correct here:

    If you are trying to create a single distribution with multiple packages
    on purpose, you should not rely on automatic discovery.
    Instead, consider the following options:
    1. set up custom discovery (`find` directive with `include` or `exclude`)
    2. use a `src-layout`
    3. explicitly set `py_modules` or `packages` with a list of names

It's symengine's "" that's at fault here. The standard way for upstream to handle this is to pass the "packages" parameter to setup() ala:

    import setuptools

Would someone mind filing (or linking to) an upstream symengine issue on this?
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-05-02 03:39:53 UTC
There's but then I end up with:
 *   Installing the wheel to /var/tmp/portage/dev-python/symengine-0.9.2/work/
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.8/gpep517", line 4, in <module>
  File "/usr/lib/python3.8/site-packages/gpep517/", line 136, in main
    return func(args)
  File "/usr/lib/python3.8/site-packages/gpep517/", line 77, in install_wheel
    install(source, dest, {})
  File "/usr/lib/python3.8/site-packages/installer/", line 109, in install
    record = destination.write_file(
  File "/usr/lib/python3.8/site-packages/installer/", line 207, in write_file
    return self.write_to_fs(scheme, path_, stream, is_executable)
  File "/usr/lib/python3.8/site-packages/installer/", line 167, in write_to_fs
    raise FileExistsError(message)
FileExistsError: File already exists: /var/tmp/portage/dev-python/symengine-0.9.2/work/
 * ERROR: dev-python/symengine-0.9.2::gentoo failed (compile phase):
Comment 10 Larry the Git Cow gentoo-dev 2022-05-03 00:50:06 UTC
The bug has been closed via the following commit(s):

commit da3446bb7624729eb9d057fa17a10cdc46ff9d25
Author:     Sam James <>
AuthorDate: 2022-05-03 00:49:40 +0000
Commit:     Sam James <>
CommitDate: 2022-05-03 00:49:40 +0000

    dev-python/symengine: fix build with >=setuptools-61; wheel duplication
    Thanks-to: Michał Górny <>
    Signed-off-by: Sam James <>

 .../files/symengine-0.9.2-cmake-setuptools.patch   | 84 ++++++++++++++++++++++
 .../files/symengine-0.9.2-setuptools-61.patch      | 17 +++++
 dev-python/symengine/symengine-0.9.2-r1.ebuild     | 56 +++++++++++++++
 3 files changed, 157 insertions(+)