Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Mixing package managers - is there any way to make it work?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
danielittlewood
n00b
n00b


Joined: 13 Apr 2020
Posts: 60

PostPosted: Fri Jan 21, 2022 10:34 pm    Post subject: Mixing package managers - is there any way to make it work? Reply with quote

I am trying very hard to avoid using more than one package manager. The basic reason is that I want to be able to seriously understand what's running on my machine, and if I have N package managers operating in parallel then I have N times as much work to comprehend them all (and god help if they are not independent).

The difficulty I'm having is that there are so many different language-specific managers that get added all the time. There are the famous ones, like pip and npm, but then there are much more obscure ones - choco, pipx, etc. Occasionally I want to install a package built with one of these tools. If I want portage to track all my software, am I forced to write an ebuild for that package and each of its dependencies?

The only advice I could find on the wiki was "Decide which package manager will work best for the use case". I don't think that tells me anything.

Is there any, even imaginary pie-in-the-sky, approach for dealing with this? Maybe some kind of API that package managers adhere to, which allows them to delegate control between each other? If you had two totally disconnected dependency trees, then manager A could handle one tree and B could handle the other. Obviously if the trees overlap, then you run the risk of clashes, but I'm optimistic that those clashes could be resolved (possibly with a lot of difficulty).
_________________
With man it is impossible, but with gcc all things are possible.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9677
Location: almost Mile High in the USA

PostPosted: Fri Jan 21, 2022 10:50 pm    Post subject: Reply with quote

Every package manager has its own way of tracking dependencies - Unless they generate the same data, they are incompatible with each other... and this will explain all your questions.

Main problem that package managers need to deal with is all the intricacies as well as the range of versions they are compatible with. What each package provides is another issue as well as special flags... like USE flags.

Also a lot of package managers are specific to a specific language. I don't even know if pip will deal with cargo files, etc. so it gets real bad real fast.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
spica
Apprentice
Apprentice


Joined: 04 Jun 2021
Posts: 285

PostPosted: Sat Jan 22, 2022 2:18 pm    Post subject: Reply with quote

If you write code, you need to stick to a set of specific dependencies for your project. Gentoo's portage will not work in this case.
Ruby - rbenv, rvm
NodeJS - nvm
Python - pyenv, virtualenv
Docker - dvm (not sure people use this)
and so on.

Deps are installed in home dir, you can easily switch between interpreter versions/dependency sets. This is how programmers do.
Back to top
View user's profile Send private message
danielittlewood
n00b
n00b


Joined: 13 Apr 2020
Posts: 60

PostPosted: Sat Jan 22, 2022 4:24 pm    Post subject: Reply with quote

spica wrote:
If you write code, you need to stick to a set of specific dependencies for your project. Gentoo's portage will not work in this case.
Ruby - rbenv, rvm
NodeJS - nvm
Python - pyenv, virtualenv
Docker - dvm (not sure people use this)
and so on.

Deps are installed in home dir, you can easily switch between interpreter versions/dependency sets. This is how programmers do.


This is true - if you're developing a program then you should keep the dependencies for that project isolated from the host system. Not least because it's easily possible (if you work on old projects) to have incompatible dependencies between the host system and the program itself. My personal approach to this is to always develop inside a docker container, so that it's not necessary to even pollute my host system with tools like rvm.

I am thinking only of user-facing programs. For instance, I recently wanted to install jrnl (a python-based journalling program), but the only documented installation options are for homebrew and pipx. This has the obvious downside that I either containerise those programs (bad), install them with the desired tools (bad and also risky) or recursively write ebuilds for it and all its dependencies (good but duplicated effort).
_________________
With man it is impossible, but with gcc all things are possible.
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30888
Location: here

PostPosted: Sat Jan 22, 2022 5:37 pm    Post subject: Reply with quote

danielittlewood wrote:
I am thinking only of user-facing programs. For instance, I recently wanted to install jrnl (a python-based journalling program), but the only documented installation options are for homebrew and pipx. This has the obvious downside that I either containerise those programs (bad), install them with the desired tools (bad and also risky) or recursively write ebuilds for it and all its dependencies (good but duplicated effort).

I find python support for writing ebuilds to be great. In 10 min I packed a first version of ebuild for jrnl even without knowing how poetry works.
I'd much rather write an ebuild than use all those "package managers" like npm, pip,...
For the record the ebuild is missing test management and ansiwrap dependency which is not in portage.

jrnl-2.8.3.ebuild:
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DISTUTILS_USE_PEP517=poetry
PYTHON_COMPAT=( python3_{8..10} )
inherit distutils-r1

DESCRIPTION="Simple journal application for the command line"
HOMEPAGE="https://jrnl.sh"
SRC_URI="https://github.com/jrnl-org/jrnl/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"

RDEPEND="
    dev-python/asteval[${PYTHON_USEDEP}]
    dev-python/colorama[${PYTHON_USEDEP}]
    dev-python/cryptography[${PYTHON_USEDEP}]
    dev-python/python-dateutil[${PYTHON_USEDEP}]
    dev-python/keyring[${PYTHON_USEDEP}]
    dev-python/parsedatetime[${PYTHON_USEDEP}]
    dev-python/pyyaml[${PYTHON_USEDEP}]
    dev-python/pyxdg[${PYTHON_USEDEP}]
"

RESTRICT="test"

src_prepare() {
    default
    sed -i "s/poetry\.masonry\.api/poetry\.core\.masonry\.api/" pyproject.toml || die
}

_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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