bedrocklinux / bedrocklinux-userland

This tracks development for the things such as scripts and (defaults for) config files for Bedrock Linux
https://bedrocklinux.org
GNU General Public License v2.0
612 stars 66 forks source link

Tracking for pmm development #103

Open xacrimon opened 5 years ago

xacrimon commented 5 years ago

Initial list of high priority package managers to support:

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.

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.

Mouvedia commented 5 years ago

We will also need to decide on which package managers CLI interface we want to replicate.

paradigm commented 5 years ago

Here's some open research items we'll need to work on pmm:

There could also be value in gathering:

paradigm commented 5 years ago

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.

Mouvedia commented 5 years ago

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 […].

paradigm commented 5 years ago

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.

xacrimon commented 5 years ago

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?

xacrimon commented 5 years ago

And, yes. Supporting all package managers you detailed is on the horizon

xacrimon commented 5 years ago

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.

xacrimon commented 5 years ago

Better do it once and properly than invest lots of time in building something that won't scale. I've been there before.

paradigm commented 5 years ago

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?

xacrimon commented 5 years ago

Seems like we can agree! 👍

Mouvedia commented 5 years ago

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.

paradigm commented 5 years ago

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.

Mouvedia commented 5 years ago

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 - or N/A.

So you are picking "empty".

paradigm commented 5 years ago

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.

Mouvedia commented 5 years ago
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.

paradigm commented 5 years ago

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.

Mouvedia commented 5 years ago

with an undefined order.

Exactly what I wanted to avoid… Some pms are way slower than others.

paradigm commented 5 years ago

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.

Mouvedia commented 5 years ago

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.

xacrimon commented 5 years ago

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.

xacrimon commented 5 years ago

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.

paradigm commented 5 years ago

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.