Open xacrimon opened 5 years ago
We will also need to decide on which package managers CLI interface we want to replicate.
install
remove
(AKA rm
and uninstall
)upgrade
search
(AKA find
)info
(AKA show
)update
: update local database/index of packagesHere's some open research items we'll need to work on pmm
:
brl fetch --list
distro on x86_64
, which at the time of writing is: alpine arch centos debian devuan fedora gentoo ubuntu void void-musl. These are what most users will expect.apt
/aptitude
or yum
/dnf
, to make sure our architecture handles that situation.brl fetch
a distro that works with a given package manager, that will make testing difficult, and thus it's best to leave the package manager off for now.apt
) and which brl-fetch distros they're native to (e.g. debian, devuan, and ubuntu), which work on the native package list but aren't native (e.g. yay
) and their brl-fetch distros (e.g. arch and arch-arm), and which are not native and use their own repos (e.g. pip
).apt install <packages>
and apt update
.pmm
would look like if it tried to mimic the given package manager's command format for the given operation. For example:
apt install <packages>
would be pmm install <packages>
pacman -S <packages>
would be pmm -S <packages>
emerge <packages>
would be pmm <packages>
xbps-install <packages>
would be pmm-install <packages>
apt
uses apt-file
for some features, and apt-file
is not installed in Debian by default.pmm
-specific cross-package-manager feature, and what that feature would be. For example, a pmm
command to install a package might take a flag --newest
flag to indicate the newest version from all of the available ones is desired. Feel free to get creative here.--noconfirm
or --quiet
, and their equivalents for each initially targeted package manager.
pmm
's CLI, we might also want to add pmm
configuration to have these set by default.pacman
and an AUR helper using the same list of installed packages.brl fetch
it and install it. I'm not yet certain whether this feature will make the cut for the initial pmm
release, if at all.pmm
will use its own output format for.
pmm
's UI to also indicate corresponding strata and package managers. It may indicate, for example, that arm_now
comes from arch
's pip3
.There could also be value in gathering:
Initial list of high priority package managers to support:
I'd like to expand the scope well past that.
We will also need to decide on which package managers CLI interface we want to replicate. This could be along the style of pacman or maybe apt-get. We should probably either have a community vote or @paradigm should decide this.
We should support mimicing the CLI interface of every package manager we plan to support in any other fashion. Broadly, either we support the package manager, or we don't.
pmm
will be written in C99 to comply with Bedrock standards.
Current plan is to do it in busybox shell. If we run into performance problems we can revisit the possibility of using C99.
If we cannot
brl fetch
a distro that works with a given package manager, that will make testing difficult, and thus it's best to leave the package manager off for now.
Which means doing a fetching script for that distro becomes a prerequisite […].
If we cannot
brl fetch
a distro that works with a given package manager, that will make testing difficult, and thus it's best to leave the package manager off for now.Which means doing a fetching script for that distro becomes a prerequisite […].
For development and testing, yes.
For use, no. Users can get the package manager by acquiring the associated distro some other way, such as hijacking it or installing it in a VM and copying the files over.
Fantastic! I'll start responding and collecting and putting together information tomorrow. This is going to be a huge project. Probably >2.5kloc. I heavily advise writing this is C for the reason that shell will have problems with database stuff and will heavily bottleneck performance. C will also win in project organization and resource consumption.
Im going to be putting together a design document from input from everyone here and gathered info. Discussion regarding design will take place. Once the design document is complete and agreed upon the project can start development. Does this sound good @paradigm?
And, yes. Supporting all package managers you detailed is on the horizon
I don't know of you have worked with package managers before but writing this in busybox shell is going to be unnecessarily hard in a couple of ways and the performance is going to be agonizingly slow. Package managers need to do a LOT of work. This is no exception.
Better do it once and properly than invest lots of time in building something that won't scale. I've been there before.
Fantastic! I'll start responding and collecting and putting together information tomorrow.
Excellent!
And, yes. Supporting all package managers you detailed is on the horizon
Nice :)
This is going to be a huge project. Probably >2.5kloc. I heavily advise writing this is C for the reason that shell will have problems with database stuff and will heavily bottleneck performance. C will also win in project organization and resource consumption. [...] I don't know of you have worked with package managers before but writing this in busybox shell is going to be unnecessarily hard in a couple of ways and the performance is going to be agonizingly slow. Package managers need to do a LOT of work. This is no exception. [...] Better do it once and properly than invest lots of time in building something that won't scale. I've been there before. [...] Im going to be putting together a design document from input from everyone here and gathered info. Discussion regarding design will take place. Once the design document is complete and agreed upon the project can start development. Does this sound good @paradigm?
We seem to be on completely different pages here. Either I'm missing the difficulties you're seeing, or you're missing the solutions I'm seeing.
How about this: in the immediate future, you work on the research items I laid out while I work on other pressing Bedrock priorities. Whatever architectural and language approach we take, those things need to get done anyways. When the research is done, I'll take a quick run at writing a representative chunk of it over my next free weekend. If it ends up being too hard, or too slow, we'll toss it and revisit design ideas. If it works out fine, we continue with it. That seem agreeable?
Seems like we can agree! 👍
What about the output of the commands?
Do we reformat and normalize the output?
Do we separate the results of let's say search
per pm? Or do we go agnostic?
If we go agnostic, what about missing fields of info
? Should it be empty or skipped?
Would it be better to rely on a subset that is guaranteed to be provided?
e.g. not all nix packages have descriptions Should we try to retrieve the missing information from other pms? If so which one will be the preferred one?
Id advise against weights. Parallel requests would be much better: race them.
What about the output of the commands? Do we reformat and normalize the output?
Operations where we're just forwarding things along to the backing package managers, such a installing a package, will use the backing package manager's output. I don't think cost/benefit favors trying to parse it.
Operations against pmm's database, such as searching, will probably use our own format, at least at first. Maybe later we'll something to mimic other package manager's output formats.
Do we separate the results of let's say search per pm? Or do we go agnostic? If we go agnostic, what about missing fields of info? Should it be empty or skipped? Would it be better to rely on a subset that is guaranteed to be provided? e.g. not all nix packages have descriptions
We'll take it by a case-by-case basis. We might restrict our output to things everything supports, or if only a handful are missing a given field we can indicating it's invalid in this context with something like -
or N/A
.
Should we try to retrieve the missing information from other pms? If so which one will be the preferred one?
If you're proposing using descriptions from one package manager to describe packages from another, I don't think that worthwhile. I prefer to treat each package manager as responsible for its own subset of the system.
Id advise against weights. Parallel requests would be much better: race them.
I don't understand what you're saying here.
I don't understand what you're saying here.
Ill rephrase then. Weighting is a way to sort/order/rank the pms using a pre-populated config file. The implementation of such a system is often cryptic and results in subjective defaults. Depending on the elapsed time between the request and the response is fairer and simpler.
we can indicating it's invalid in this context with something like
-
orN/A
.
So you are picking "empty".
Ill rephrase then. Weighting is a way to sort/order/rank the pms using a config file. The implementation of such a system is often cryptic and results in subjective defaults. Depending on the elapsed time between the request and the response is fairer and simpler.
I still don't follow. I don't know what you mean by request and response here, and I don't see any possible values that would make sense to contrast against weighing/sorting/ordering/ranking package managers.
nix: 100
pacman: 80
eopkg: 79 # what happens when the user sets it to 80?
Instead I recommend to launch all requests concurrently and show their results once they arrive.
Ah, I think I see what you're saying. For operations that communicate with multiple package managers, you see two options:
And you're recommending the latter one.
First release of pmm
will probably run such operations sequentially with an undefined order. It'll be simpler to implement and will make it easier to handle scenarios such as errors by the backing package manager. We can look into optimizing those by parallelizing them down the road.
with an undefined order.
Exactly what I wanted to avoid… Some pms are way slower than others.
With most operations we're either:
The exceptions are things like instructions to remove orphaned packages. I don't follow why the ordering of the output would be important. While it may certain be faster if we parallelize, I'd prefer to take a performance hit early on for the sake of simplicity and getting something out the door. We can always go back to parallelize those later.
We can always go back to parallelize those later.
That was just a recommendation. Everything will rely on the sequentiality: I reckon you will have a hard time refactoring.
Ah, I think I see what you're saying.
Third time's the charm.
Okay, there hasnt been much progress lately from me (barely any). This is because im currently on vacation with GF. Once I return the gears should start turning again.
Okay, due to some recent acute financial issues I currently do not have the free time to work on this project. Im fully busy keeping myself afloat. I may return. I don't know. I'm incredibly sorry for the inconvenience.
No worries. That's how life goes sometimes. No pressure here; it's all volunteer work when people have the energy, interest, and time. The most important part of a software development environment is the keyboard actuator - take care of yourself first. If your situation improves and interest remains such that you contribute later, that's great, but if not, that's honestly fine as well.
Initial list of high priority package managers to support:
apt/dpkg
dnf/yum
portage
pacman
eopkg
We will also need to decide on which package managers CLI interface we want to replicate. This could be along the style of
pacman
or maybeapt-get
. We should probably either have a community vote or @paradigm should decide this.If you want a package manager added to the list, reply and it will be added.
pmm
will be written in C99 to comply with Bedrock standards.