LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-08-2020, 08:27 AM   #1
solarhurricane1337
LQ Newbie
 
Registered: Aug 2020
Distribution: noobuntu
Posts: 2

Rep: Reputation: Disabled
Thumbs up Coding a package manager in Rust


since i'm an idiot, i have decided that i am going to build a linux package manager in rust. i'm planning to host the packages on a github repo, unless you can convince me to do otherwise. i've already got a basic sketch for a package format in my head, but i have a few questions.

1. my package manager is focused on speed, so should i use lzo, lz4, or zstd for the quickest decompression speeds?

2. how can i implement install, uninstall, query, and upgrade commands?

3. how can i make the program source configuration files (mirrors, xfer settings, etc)?

4. once i have mastered the basics, how can i implement more advanced stuff like an alternatives system and dependency management?
 
Old 08-08-2020, 08:31 AM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,242

Rep: Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322
If speed is the actually THE focus, then don’t compress at all.

Dependencies would be modeled using a data structure called a “directed acyclic graph”, and queried using algorithms named “depth first search” and “topological sort”.

Last edited by dugan; 08-08-2020 at 08:33 AM.
 
Old 08-08-2020, 08:46 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,930

Rep: Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321
Hello, and welcome here, at LQ

I would suggest you to read how the debian and rpm based package managers work (like apt and zypper amongst others), how they handle dependencies, how they look for packages at all...
What does install, uninstall, (reinstall), query, remove, update, upgrade (rollback?) mean?
How can we create and maintain a deb or rpm mirror...
What to do in case of an error (to keep the system in a consistent state....)
 
Old 08-08-2020, 07:16 PM   #4
KGIII
Member
 
Registered: Sep 2015
Location: North-Western, Maine - in the mountains.
Distribution: Lubuntu 18.04 LTS
Posts: 158
Blog Entries: 6

Rep: Reputation: 64
Reading your post, the only listed reason I can see for you doing this is 'speed.'

Is that really justification? Is package management really slowing you down? What niche does this fill? Who is your anticipated end-user?

The list of questions I could ask is pretty long, but let's just start there. They're mostly rhetorical anyhow.

If you're doing it for a hobby, to learn, or just to spend some time (or whatever), that's just fine. After all, it's your time that's going to be invested. But, do you expect it to take off, have input from other developers, maybe make it as a default in a distro some day?

Before writing a line of code, I'd better define your reasons and your expectations. I'd establish a clear goal, pick a project management solution, and start lining up goals. I'd query potential users for their expectations and see if they align with your expectations.

Again, it's your time. I'm just expressing what I'd do before committing to a time investment. Personally, I expect consistency, reliability, stability, and (reasonably) bug-free operation from a package manager. Speed is way down on the list of my priorities. I suspect that's true for most Linux users.

This isn't meant to dissuade you, by any means.
 
1 members found this post helpful.
Old 08-09-2020, 05:07 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
^ Agreed.
Quote:
Originally Posted by solarhurricane1337 View Post
since i'm an idiot, i have decided that i am going to build a linux package manager in rust. i'm planning to host the packages on a github repo, unless you can convince me to do otherwise. i've already got a basic sketch for a package format in my head, but i have a few questions.

1. my package manager is focused on speed, so should i use lzo, lz4, or zstd for the quickest decompression speeds?

2. how can i implement install, uninstall, query, and upgrade commands?

3. how can i make the program source configuration files (mirrors, xfer settings, etc)?

4. once i have mastered the basics, how can i implement more advanced stuff like an alternatives system and dependency management?
1. Make it work first, worry about compression later
2. That question is too wide. Do you have any coding experience at all?
3. That's very basic stuff. Do you have any coding experience at all?
4. Make the basics work first, worry about this later

All in all, your post reads more like "Can you recommend me some good beginners' coding tutorials".
 
Old 08-10-2020, 06:21 AM   #6
bifferos
Member
 
Registered: Jul 2009
Posts: 401

Rep: Reputation: 149Reputation: 149
Not a package manager as such (doesn't uninstall!), however I wrote a parallel-tasking dependency-managing Slackware package builder in about 5 days solid. I'm sure I would need to triple that to do the same thing in Rust.
https://github.com/bifferos/afterpkg

Python will give you all the libraries you need and instant compile time, if you really want it in Rust, I'd convert it after you've got it working.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] No package 'x11' found No package 'xext' found No package 'xdamage' found No package 'xfixes' found No package 'x11-xcb' found Jigsaw Linux From Scratch 14 02-23-2021 08:35 PM
[SOLVED] slackware64-current: ldconfig message related to rust package tomac.pl Slackware 2 04-25-2020 02:37 PM
LXer: This week at LWN: A taste of Rust LXer Syndicated Linux News 0 04-26-2013 08:42 PM
LXer: Mozilla's Rust language version 0.3 released LXer Syndicated Linux News 0 07-13-2012 03:50 PM
Poll: Yast Package Manager vs. Smart Package Manager in 10.1 agentchange SUSE / openSUSE 6 06-02-2006 08:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration