Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Custom ebuild fails
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
erg_samowzbudnik
Apprentice
Apprentice


Joined: 09 Sep 2011
Posts: 211
Location: European sticks

PostPosted: Sun Jan 07, 2024 5:05 pm    Post subject: Custom ebuild fails Reply with quote

TLDR: package fails to install with: `Unable to obtain build-backend from pyproject.toml`

Not skilled in build systems, wrote only most simple ebuilds, guidance would be much appreciated.

I'm trying to install a small and simple Django package, django-defender. It is not in portage, here's ebuild I wrote:

Code:

# Copyright 2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

# DISTUTILS_USE_PEP517=hatchling
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python{3_7,3_8,3_9,3_10,3_11} )

inherit distutils-r1

DESCRIPTION="Django-defender package"
HOMEPAGE="https://github.com/jazzband/django-defender"
SRC_URI="https://files.pythonhosted.org/packages/52/aa/861c07260758ddf0de6913cd50c2d3b877679f71e66838c54c9dd620390b/${P}.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~arm64"
S="${WORKDIR}"

DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
RDEPEND="
    >=dev-lang/python-3.6
    >=dev-python/django-3
    >=dev-db/redis-5
"

distutils_enable_tests pytest


The only deviation from norm is the `S` variable as that package does not create `work` subfolder.

Installation fails with:
Code:

 * Package:    dev-python/django-defender-0.9.7:0
 * Repository: localrepo
 * USE:        arm64 elibc_glibc kernel_linux python_targets_python3_11
 * FEATURES:   distcc network-sandbox preserve-libs sandbox userpriv usersandbox
>>> Unpacking source...
>>> Unpacking django-defender-0.9.7.tar.gz to /var/tmp/portage/dev-python/django-defender-0.9.7/work
>>> Source unpacked in /var/tmp/portage/dev-python/django-defender-0.9.7/work
>>> Preparing source in /var/tmp/portage/dev-python/django-defender-0.9.7/work ...
 * Build system packages:
 *   dev-python/gpep517            : 15
 *   dev-python/installer          : 0.7.0
 *   dev-python/hatchling          : 1.21.0
 *   dev-python/hatch-fancy-pypi-readme:
 *   dev-python/hatch-vcs          : 0.4.0
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/dev-python/django-defender-0.9.7/work ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-python/django-defender-0.9.7/work ...
 * python3_11: running distutils-r1_run_phase distutils-r1_python_compile
 * ERROR: dev-python/django-defender-0.9.7::localrepo failed (compile phase):
 *   Unable to obtain build-backend from pyproject.toml
 *
 * Call stack:
 *     ebuild.sh, line  136:  Called src_compile
 *   environment, line 3830:  Called distutils-r1_src_compile
 *   environment, line 1834:  Called _distutils-r1_run_foreach_impl 'distutils-r1_python_compile'
 *   environment, line  696:  Called python_foreach_impl 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 3451:  Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 3008:  Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 3006:  Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 1119:  Called distutils-r1_run_phase 'distutils-r1_python_compile'
 *   environment, line 1816:  Called distutils-r1_python_compile
 *   environment, line 1631:  Called distutils_pep517_install '/var/tmp/portage/dev-python/django-defender-0.9.7/work/build-python3_11/install'
 *   environment, line 2156:  Called _distutils-r1_get_backend
 *   environment, line  488:  Called die
 * The specific snippet of code:
 *           die "Unable to obtain build-backend from pyproject.toml";
 *
 * If you need support, post the output of `emerge --info '=dev-python/django-defender-0.9.7::localrepo'`,
 * the complete build log and the output of `emerge -pqv '=dev-python/django-defender-0.9.7::localrepo'`.
 * The complete build log is located at '/var/log/portage/dev-python:django-defender-0.9.7:20240106-195710.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/dev-python/django-defender-0.9.7/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-python/django-defender-0.9.7/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-python/django-defender-0.9.7/work'
 * S: '/var/tmp/portage/dev-python/django-defender-0.9.7/work'


emerge --info:
Code:

emerge --info '=dev-python/django-defender-0.9.7::localrepo'
Portage 3.0.58 (python 3.11.7-final-0, default/linux/arm64/17.0, gcc-13, glibc-2.38-r7, 6.1.21_p20230405-raspberrypi-v8 aarch64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.1.21_p20230405-raspberrypi-v8-aarch64-with-glibc2.38
KiB Mem:      984024 total,    247616 free
KiB Swap:    8388604 total,   8336944 free
Timestamp of repository gentoo: Fri, 22 Dec 2023 10:00:01 +0000
Head commit of repository gentoo: 046613aa2cf147cc32d4b8a4ceb5cd76aa61d9ee
sh bash 5.2_p21-r1
ld GNU ld (Gentoo 2.41 p4) 2.41.0
distcc 3.4 aarch64-unknown-linux-gnu [enabled]
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p21-r1::gentoo
dev-lang/perl:             5.38.2-r1::gentoo
dev-lang/python:           3.10.13::gentoo, 3.11.7::gentoo, 3.12.1::gentoo
dev-lang/rust-bin:         1.74.1::gentoo
dev-util/cmake:            3.27.7::gentoo
dev-util/meson:            1.3.0-r2::gentoo
sys-apps/baselayout:       2.14-r1::gentoo
sys-apps/openrc:           0.52.1::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-devel/autoconf:        2.71-r7::gentoo
sys-devel/automake:        1.16.5-r1::gentoo
sys-devel/binutils:        2.41-r3::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/gcc:             13.1.1_p20230527::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.6::gentoo (virtual/os-headers)
sys-libs/glibc:            2.38-r7::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    volatile: False
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 3
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts:

localrepo
    location: /var/db/repos/localrepo
    masters: gentoo
    volatile: False

ACCEPT_KEYWORDS="arm64 ~arm64"
ACCEPT_LICENSE="@FREE"
CBUILD="aarch64-unknown-linux-gnu"
CFLAGS="-march=armv8-a+crc -mtune=cortex-a53 -ftree-vectorize -O2 -pipe -fomit-frame-pointer"
CHOST="aarch64-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php8.1/ext-active/ /etc/php/apache2-php8.2/ext-active/ /etc/php/apache2-php8.3/ext-active/ /etc/php/cgi-php8.1/ext-active/ /etc/php/cgi-php8.2/ext-active/ /etc/php/cgi-php8.3/ext-active/ /etc/php/cli-php8.1/ext-active/ /etc/php/cli-php8.2/ext-active/ /etc/php/cli-php8.3/ext-active/ /etc/php/fpm-php8.1/ext-active/ /etc/php/fpm-php8.2/ext-active/ /etc/php/fpm-php8.3/ext-active/ /etc/php/phpdbg-php8.1/ext-active/ /etc/php/phpdbg-php8.2/ext-active/ /etc/php/phpdbg-php8.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS=" --exclude app-emulation/qemu"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg buildpkg-live config-protect-if-modified distcc distlocks ebuild-locks fixlafiles getbinpkg ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_GB.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
MAKEOPTS="-j1"
PKGDIR="/var/cache/binpkgs"
PORTAGE_BINHOST="ssh://root@192.168.1.177/var/cache/binpkgs/ http://bloodnoc.org/~roy/BINHOSTS/17.0/gcc-13.x/armv8a"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="acl arm64 bzip2 cli crypt dri fortran gdbm iconv ipv6 libtirpc ncurses nls nptl openmp pam pcre python readline seccomp split-usr ssl test-rust unicode vim-syntax xattr zlib" ADA_TARGET="gnat_2021" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="cgroups check_uptime cpu cpufreq cpusleep df disk interface load logfile memcached memory mysql nginx ping postgresql python redis rrdtool sensors snmp swap syslog tail thermal uuid uptime users wireless write_syslog write_redis" CPU_FLAGS_ARM="edsp vfp vfpv3 vfpv4 vfp-d32 aes sha1 sha2 crc32 v8" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby31" VIDEO_CARDS="fbdev dummy" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30922
Location: here

PostPosted: Sun Jan 07, 2024 5:57 pm    Post subject: Reply with quote

Code:
PYTHON_COMPAT=( python{3_7,3_8,3_9,3_10,3_11} )

The pytthon 3.7,3.8,3.9 is no longer supported.

Code:
SRC_URI="https://files.pythonhosted.org/packages/52/aa/861c07260758ddf0de6913cd50c2d3b877679f71e66838c54c9dd620390b/${P}.tar.gz"

This URL looks completely wrong, remove SRC_URI line and inherit pypi eclass. This create automagically the download url.

Code:
S="${WORKDIR}"

This line is probably the main problem for you error, you can check what the directory /var/tmp/portage/dev-python/django-defender-0.9.7/work contains.
If in this directory isn't present setup.py file then is wrong.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1662

PostPosted: Sun Jan 07, 2024 6:37 pm    Post subject: Reply with quote

erg_samowzbudnik wrote:
Code:
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
RDEPEND="
    >=dev-lang/python-3.6
    >=dev-python/django-3
    >=dev-db/redis-5
"

Also fix up these dependencies.. Remove DEPEND as the PEP517 definition does this for you. Then:
Code:
RDEPEND="
    >=dev-python/django-3[${PYTHON_USEDEP}]
    dev-python/redis[${PYTHON_USEDEP}]
"
Back to top
View user's profile Send private message
erg_samowzbudnik
Apprentice
Apprentice


Joined: 09 Sep 2011
Posts: 211
Location: European sticks

PostPosted: Mon Jan 08, 2024 1:31 pm    Post subject: Reply with quote

fedeliallalinea, grknight: thanks a lot, cleaning it up like you both said did it, package installs like a charm now :D .
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum