Repository navigation
feat: add ability to override configs per-package - #1515
shssoichiro wants to merge 1 commit into
Conversation
|
Does this handle matching for upstream package groups as well? Not sure if we wanted to support that or not, because honestly this works fine, and I'm not too sure they're getting much use anyway (upstream's groups, I mean!) |
|
It currently doesn't. It could be added by having paru resolve the group name in the |
|
Hmm, yeah I reckon you're right, keep it simple and have it user defined! Besides, for those who do want the packages in a group, they can find it rather easily on the arch repo sites :] |
57c66d4 to
997c217
Compare
|
Do we support listing patch files, yet? That might be something we could consider. Having an automated patch function is quite easy, and allowing users to list patchfiles could help a lot when managing packages that might take a while before getting an upstream patch actually pushed. I'd recommend supporting patches JUST for patching PKGBUILD, so it's somewhat freedom for the user to patch the PKGBUILD to then load whatever patches they want for subprojects etc for each repo they want to do it for manually. EDIT: I'm gonna push a PR to this PR, if that's ok? It'll include the ability to patch the PKGBUILD, using either remote or local patchfiles. |
|
shssoichiro#1 welcoming testing on this one! :3 |
cef8e8f to
e4d1de9
Compare
|
Been using it for a while as a daily driver including your patches. @ninetailedtori I'm going to squash your commit into mine to make rebasing easier, but I'll be sure to keep the attribution. |
e4d1de9 to
09d8c5d
Compare
Co-authored-by: Toria <ninetailedtori@uwu.gal>
09d8c5d to
9e74160
Compare
pfeifferj
left a comment
There was a problem hiding this comment.
left some comments, otherwise lgtm
| let saved_env = config.env.clone(); | ||
|
|
||
| if let Some(ref ov) = pkg_override { | ||
| apply_patches(config, cwd, &ov.pkgbuild_patches).await?; |
There was a problem hiding this comment.
cwd is the directory where paru was invoked. if we use that instead of dir (the package checkout) this can fail to find the target or modify an unrelated checkout
There was a problem hiding this comment.
shoot, alright, that's a good shout!
| pkgdest: Option<&str>, | ||
| ) -> Command { | ||
| let mut cmd = Command::new(&config.makepkg_bin); | ||
| cmd.envs(config.env.iter().map(|(key, value)| (key, value))); |
There was a problem hiding this comment.
this passes compiler overrides through the environment, but makepkg subsequently overwrites CFLAGS and similar settings when loading its configuration
we should pass these as makepkg KEY=value arguments
There was a problem hiding this comment.
wait, so it doesn't act similar to prepended-var setting? iirc it sets as an execve before calling, right? but I'm not too sure if it'll override like prepending in cli would, like CFLAGS="foo" makepkg vs this method of cmd.envs, as I do know of course that cli override > config > system but...curious to see.
| if let Some(ref conf) = ov.makepkg_conf { | ||
| config.makepkg_conf = Some(conf.clone()); | ||
| if config.chroot { | ||
| self.chroot.makepkg_conf = conf.clone(); |
There was a problem hiding this comment.
this changes the chroot's makepkg_conf field after chroot setup, and Chroot::build doesn't end up reading that field. with the default empty ChrootPkgs, the host package-list query uses the override while the actual chroot build keeps its existing configuration. the selected configuration needs to reach the build chroot
| tr!("override.group.{} must have MakepkgConf or Overrides", name) | ||
| ); | ||
| for pkg in packages { | ||
| let entry = self.overrides.entry(pkg).or_default(); |
There was a problem hiding this comment.
a later group can overwrite package-specific settings, contrary to the documented precedence. reversing the sections loses nonconflicting group settings through the package branch's insert. imo we should merge group settings first, then apply package-specific settings
There was a problem hiding this comment.
yea, I think that's what we should have, ya! I'll swap that around rq
This feature enables users to specify per-package overrides in
/etc/paru.conf. These overrides can be specified for individual packages or for a group of package.A per-package override may be defined as follows:
This configuration would utilize the specified makepkg config file for only the firefox package.
A group override may be defined as follows:
This configuration allows specifying multiple packages that will use the same custom config. Both package and group overrides allow specifying either or both
MakepkgConf, which uses a custom config file, andOverrideswhich directly applies the specified env vars to the build.Closes #901