View previous topic :: View next topic |
Author |
Message |
pingtoo Veteran


Joined: 10 Sep 2021 Posts: 1684 Location: Richmond Hill, Canada
|
Posted: Tue Feb 01, 2022 5:12 am Post subject: How better emerge |
|
|
Hi,
Today is Chinese New Year's Eve, I feel I can start a new topic for chat about my current thinking of emerge the command. kind review my past year experience.
There are two parts of my thinking about the emerge,
Part 1, Using python as development language for the emerge application.
Part 2. emerge command options somewhat misleading.
1. Using python for emerge application.
First please understand I have nothing against python the language, it very good general programming language and it could be good fit for develop emerge the command. However it demonstrated one bad sign for a system management tool. It change too frequent. even worse it demonstrate the language compatibility issue when major version upgrade.
I think system management tool should not be bound to a development tool which may create system update problem due to time progress. I accept that an older version may only perform lesser functions than most current version, but it is very difficult to accept due to time progress my older version system manage tool need to update before it can do anything. Yet that same tool need to bring the runtime update which sometime create circulate problem.
I remember when I start with Gentoo the emerge was just bunch of bash scripts. I have no concern use interpreter language, but I think we should choose a more stable, less changed language for the emerge. Could it be possible use a mini-python to replace the full python?
2. emerge command options somewhat misleading.
May be it just me being English as second language, I found some of emerge option name sometime lead me to believe it will do one thing but it actually does something else or it does not apply to the context where I think it will happen. For example most recent post I apparently mis-suggest using '--keep-going' in where a emerge action still in resolution discover phase.
Or for example I am using binpkg for my primary desktop system, however I have multiple USE flags for some packages in binhost, this create a condition where some place I may not have udev or static-libs vs none static-libs therefor I have multiple instance of same version package. on my desktop system when I update I got prompt told me some packages were ignored then another message stated that if I set the option to 'y' it will silent the message or force use the binpkg? (i.e. --binpkg-respect-use, If set to 'y' Am I force use binpkg's USE flag?)
I wish if emerge can have docker/git command alike context argument, for example I wish there are emerge build {--optionA|optionB|optionC ...} where those options are build context specific and another emerge install {--optionA|--optionB|--optionC ...} where options are install context related.
With a context command this possible give a break point where additional maneuver can be perform (for example break the result into smaller segment for incremental process, instead a failure and need to redo everything from beginning again).
P.S. Please forgive my bad English. If you not sure what I mean please ask, I will try my best to explain. |
|
Back to top |
|
 |
fedeliallalinea Administrator


Joined: 08 Mar 2003 Posts: 31705 Location: here
|
Posted: Tue Feb 01, 2022 6:54 am Post subject: |
|
|
For first point something is moving, not to change programming language but to make it less dependent on change.
The second point of discussion is a bit more complex. Using emerge in a deep way implies that you should know some mechanisms of the ecosystem (understand the use flags, the various phases of emerge,...).
So far I haven't found any poorly documented options, just read the portage man, I found it more difficult to navigate through all the options, there are really a lot.
Adding more for the compilation/installation phases seems to me to complicate things even more but that's my personal opinion. _________________ Questions are guaranteed in life; Answers aren't.
"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968 |
|
Back to top |
|
 |
pingtoo Veteran


Joined: 10 Sep 2021 Posts: 1684 Location: Richmond Hill, Canada
|
Posted: Tue Feb 01, 2022 2:59 pm Post subject: |
|
|
First, Thank you for taking time to read through my ideas,
federalization wrote: | For first point something is moving, not to change programming language but to make it less dependent on change. | I like those idea of using *static python* or the *resuce python script*.
federalization wrote: | The second point of discussion is a bit more complex. Using emerge in a deep way implies that you should know some mechanisms of the ecosystem (understand the use flags, the various phases of emerge,...). | No disagreement here,
federalization wrote: | So far I haven't found any poorly documented options, just read the portage man, I found it more difficult to navigate through all the options, there are really a lot.
Adding more for the compilation/installation phases seems to me to complicate things even more but that's my personal opinion. | I think may be I express my idea poorly, I agree that there are enough options (if not too much) What I suggest are may be create a *command* as first argument for emerge as in emerge build option list, where the word build help catagolize following options belong to the building phase of emerge process.
Also I don't mean options are poorly documented, I mean the option name itself sometime are misleading (or at least for Non-English speaker) because they lead someone believe they understood the option but the end result isn't what one expected.
I found in Gentoo, we sometime choose very generic words to name artifact, for example @world or the libcrypt -> libxcrypt upgrade path that suggest use a word *system* in USE flag, I think the use of word *system* may lead to user mistake thinking it is the word *systemd* and create a wasted trip of emerge round. |
|
Back to top |
|
 |
figueroa Advocate


Joined: 14 Aug 2005 Posts: 3020 Location: Edge of marsh USA
|
Posted: Wed Feb 02, 2022 5:32 am Post subject: |
|
|
I understand the questions, but I don't agree.
1. Generalities don't seem to be meaningful here. Specifically, any high-level language is subject to change that may cause future breakage. The objective is to not let change break portage for the user. To the extent possible, eliminate the rough patches, and where unavoidable provide a proper migration path.
This hasn't been a regular occurrence in the last 15+ years, and the recent 2021 python migration(s) were decently handled. They were mainly tedious. It is the responsibility of the user to stay reasonably informed, keep their systems reasonably up-to-date given the pace of upstream development and closure of security issues, and to read and heed the news when developers and maintainers use that channel to communicate with us.
I am a user with long experience but no training and extremely limited programming knowledge or abilities. Yet, I'm satisfied. Change in language for portage is way above my pay grade and position. I don't care.
2. Portage language and syntax. I don't find anything exotic with portage (emerge) commands or syntax. Specific commands require one to read and follow instructions, and translate the meaning into some understanding of the outcome. I am more or less bilingual and I understand the problem. Portage is complicated, and most of it is foreign to me in ANY language.
Emerge syntax is similar to many other complex Unix/Linux programs. Take tar, for example, compared to emerge. One enters the name of the executable, the command, the options, and the object. So in tar:
Code: | tar czpf /mnt/backups/freddocuments.tgz /home/user/fred/Documents/ |
where:
tar is the executable
c is the command (create)
zp are the options (gzip + keep permissions)
f /mnt/backups/freddocuments.tgz is the destination file archive
/home/user/fred/Documents is the object being archived with tar.
Code: | emerge -uDU @world -p |
emerge is the executable
-u is the command (update)
DU are the options (deep + changed USE)
@world is the object of the command update
-p another option (pretend)
In fact, emerge is friendly enough to let the user put the command object and options in ANY order, so I could have entered:
emerge -p -uDU @world
or
emerge @world -p -uDU
and the outcome will be the same; which I can't do with the tar command because tar is more syntax sensitive. In each case, the user has to learn the command which is much like learning a language.
I think I will find this discussion informative if it continues. _________________ Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi |
|
Back to top |
|
 |
pingtoo Veteran


Joined: 10 Sep 2021 Posts: 1684 Location: Richmond Hill, Canada
|
Posted: Wed Feb 02, 2022 5:56 pm Post subject: |
|
|
Thank you for participate in this conversation.
I am sorry but I don't understand what does this mean? figueroa wrote: | Generalities don't seem to be meaningful here. | If your refer to my concern of using python as development tool for emerge. What I mean is not directly toward to the language itself. It is about python's implementation, for example the implementation cause Portage use a wrapper in order to cope changes. (Please note I don't mean any following is better but just to help illustrate my idea.)
if emerge was a C program it will unlikely suffer the C language evolution. It is more likely a two years old emerge C program worked for today's portage with lesser function as opposite to create a condition where update system require update C compiler first but the emerge itself cannot update C compiler because it is too old.
Or using TCL as emerge implementation tool, TCL have very slow evolution changes, therefor it is more likely emerge can evolve with its own changes and not need to worry the underlying runtime system changes cause need to find work around. (think python's imp vs importlib)
Or using PERL as emerge implementation tool, PERL since migrate to version 5 have very little core function changes (as far as I know) so it could have been a good tool of choice.
As of Portage syntax, I don't mean they are exotic, I mean they are not straightforward.
Surely *--update (-u)* is very straightforward, it mean I want to update system or specified packages. however *--keep-going* can you tell it is only apply to building phase where build error continue but it does not apply during resolution discovery phase.
Or *--binpkg-respect-use [y | n]* to me it is somewhat ambiguous, for example I think *--binpkg-respect-use=y* mean I want to take binpkg's USE flag and not use my local USE flag. But what it actually is tell emerge if a binpkg have different USE flags than ignore the binpkg. In part of my confuse is because I have same binpkg built with different USE flags store on same binhost.
I agree that it is the user's responsibility to understand how to correctly operate the tool. But my point is primarily hope that emerge currently being one tool does entire life cycle of package/system can distinguish each phase in the life cycle. Where some options are context specific and suggest if emerge does not perform entire life cycle in one shot but separate into compile/package/install (this may not be right separation) therefor some of options can be clearly place in right context, I believe it will help other quicker get into understand the tool.
As your example using *tar* it actually have some funny/unclear options that are positional and can cause someone unexpected result, for example the *-C*, if you do tar -C <dir> [c|x|u]f ... is sometime different from tar [c|x|u]f ... -C <dir>. So I say tar could be better if it either make different options to distinguish this or just make it consistent that it always do the same way.
I start my computer experience with SysV where the primary tool for archive is cpio and I remember there are some options in cpio also are context sensitive too. So I always feel if a tool perform multiple functions depend on context I wish it have clear way to distinguish them and will give indication the option may or may not apply under the context.
figueroa wrote: | It is the responsibility of the user to stay reasonably informed, keep their systems reasonably up-to-date | I can't say that I totally agree with this. I agree in principle the concept one should keep system reasonably up-to-date, however the tool implementation should not enforce that one must always stay up-to-date without provide reasonable path to bring itself up-to-date and my point is that because python it cause emerge become unexpected difficult. |
|
Back to top |
|
 |
Leonardo.b Guru

Joined: 10 Oct 2020 Posts: 309
|
Posted: Thu Feb 03, 2022 12:34 am Post subject: |
|
|
figueroa wrote: |
Take tar, for example, compared to emerge. One enters the name of the executable, the command, the options, and the object. So in tar:
|
https://xkcd.com/1168/ |
|
Back to top |
|
 |
figueroa Advocate


Joined: 14 Aug 2005 Posts: 3020 Location: Edge of marsh USA
|
Posted: Thu Feb 03, 2022 12:47 am Post subject: |
|
|
Leonardo.b wrote: | figueroa wrote: |
Take tar, for example, compared to emerge. One enters the name of the executable, the command, the options, and the object. So in tar:
|
https://xkcd.com/1168/ |
+1
Do it often enough, it becomes muscle memory. _________________ Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi |
|
Back to top |
|
 |
pjp Administrator


Joined: 16 Apr 2002 Posts: 20612
|
Posted: Thu Feb 03, 2022 3:08 am Post subject: |
|
|
Leonardo.b wrote: | figueroa wrote: |
Take tar, for example, compared to emerge. One enters the name of the executable, the command, the options, and the object. So in tar:
|
https://xkcd.com/1168/ | "A" valid command isn't that challenging. tar cvf foo.tar <path to valid file>. The one I'm afraid of is rsync. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
 |
|
|
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
|
|