-
-
Notifications
You must be signed in to change notification settings - Fork 274
feat: add --basechrootpkgs to customize chroot base packages #1426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add --basechrootpkgs to customize chroot base packages #1426
Conversation
| ideally patch the package yourself or report the problem to the maintainer. | ||
|
|
||
| If you want to permanently add a package to the chroot use \fBparu -Ci package\fR | ||
| to install packages into the master chroot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/master/root
src/config.rs
Outdated
| "BatFlags" => self.bat_flags.extend(split), | ||
| "FileManagerFlags" => self.fm_flags.extend(split), | ||
| "ChrootFlags" => self.chroot_flags.extend(split), | ||
| "BaseChrootPkgs" => self.base_chroot_pkgs = split.collect(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading through makechrootpkg again it seems the terminology arch uses root chroot . We should probably match both here and in the flag name.
man/paru.8
Outdated
| .TP | ||
| .B \-\-basechrootpkgs <packages> | ||
| Comma-separated list of packages to install when creating the base chroot. | ||
| These packages REPLACE the default base-devel group. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's a need to point out it replaces base-devel. Just that base-devel is the default. As all the flags replace the defaults.
man/paru.8
Outdated
| paru --basechrootpkgs=base-devel,multilib-devel | ||
| .fi | ||
|
|
||
| To create a minimal chroot with only base: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
base isn't suitable for chroots and base-devel is required for building so I wouldn't give examples without it. If the user is choosing to do so I assume they know what they are doing and don't need examples.
src/command_line.rs
Outdated
| Arg::Long("chrootpkgs") => self | ||
| .chroot_pkgs | ||
| .extend(value?.split(',').map(|s| s.to_string())), | ||
| Arg::Long("basechrootpkgs") => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be in [options] not [bin].
src/help.rs
Outdated
| printtr!(" --[no]installdebug Also install debug packages when a package provides them"); | ||
| printtr!(" --[no]sudoloop Loop sudo calls in the background to avoid timeout"); | ||
| printtr!(" --[no]chroot Build packages in a chroot"); | ||
| printtr!(" --basechrootpkgs <package(s)> for base chroot (replaces base-devel)"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess --chrootpkgs is mising from the help text so there's no obvious place to put this. But it shouldn't be in the middle of the boolean options.
src/config.rs
Outdated
| pub chroot_dir: PathBuf, | ||
| pub chroot: bool, | ||
| pub chroot_pkgs: Vec<String>, | ||
| pub base_chroot_pkgs: Vec<String>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have a [default] setting.
src/config.rs
Outdated
| "BatFlags" => self.bat_flags.extend(split), | ||
| "FileManagerFlags" => self.fm_flags.extend(split), | ||
| "ChrootFlags" => self.chroot_flags.extend(split), | ||
| "BaseChrootPkgs" => self.base_chroot_pkgs = split.collect(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should .extend ()like other options.
src/chroot.rs
Outdated
| let tmp = pacman_conf(&self.pacman_conf)?; | ||
| let dir = self.path.join("root"); | ||
|
|
||
| let base_pkgs: Vec<&str> = if self.base_pkgs.is_empty() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With [default] on the config struct this can be removed and we can pass the value right through.
man/paru.8
Outdated
| These packages REPLACE the default base-devel group. | ||
|
|
||
| If specified, you must explicitly include base-devel if you want it. | ||
| For example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think example if overkill, we should expect people to know how to use a flag. Though it's probably useful to mention including multilib-devel is one of the reasons you may want this flag.
d479361 to
c205ceb
Compare
man/paru.8
Outdated
|
|
||
| One use case for this is to include multilib-devel for building multilib packages: | ||
| .nf | ||
| paru --rootchrootpkgs=base-devel,multilib-devel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think users need to be shown how to use the flag.
man/paru.conf.5
Outdated
|
|
||
| Example: | ||
| .nf | ||
| [options] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above. User doesn't need to be show how the config file works. Also detail here should be copied from the flag docs instead of mentioning the paru man page.
src/config.rs
Outdated
| None => Sign::Yes, | ||
| } | ||
| } | ||
| "RootChrootPkgs" => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should go in the match below so that the unwrap can be replaced with ?
c205ceb to
bf60f06
Compare
Introduces a new --rootchrootpkgs flag and BaseChrootPkgs config option to allow customization of packages installed when creating the base chroot. This solves the problem of multilib packages failing to build in chroot environments because multilib-devel was not available in the default base-devel installation. Related: Morganamilo#1355
bf60f06 to
e0ba510
Compare

Introduces a new --basechrootpkgs flag and BaseChrootPkgs config option to allow customization of packages installed when creating the base chroot.
This solves the problem of multilib packages failing to build in chroot environments because multilib-devel was not available in the default base-devel installation.
Related: #1355