fosskers / aura

A multilingual package manager for Arch Linux and the AUR.
https://fosskers.github.io/aura/
GNU General Public License v3.0
1.76k stars 114 forks source link

Auto-detection of `*-git` repo changes #812

Open fosskers opened 1 year ago

fosskers commented 1 year ago

Discussed in https://github.com/fosskers/aura/discussions/811

Originally posted by **sonicbhoc** August 15, 2023 So one thing that I've noticed is that I have to constantly tell Aura for each package that I don't want to view diffs for the build files. On top of this, there doesn't seem to be a way to automatically skip packages that haven't changed their build files. I'd love to see options to configure these (and if they are there, I don't know how I missed them). Finally, I noticed that some packages fail when copying files or when the build uses cmake due to path issues. I'm not sure exactly what causes these failures. The packages that failed include: * ofono-git * uavs3d-git * bluez-tools-git
fosskers commented 1 year ago

@sonicbhoc Thank you for reporting! Are you using Aura 3 or Aura 4 when trying to build these?

sonicbhoc commented 1 year ago

Aura 4.

Also, I was going to mention that the incessant nagging for viewing the diffs was indeed a configuration option I accidentally enabled in the config toml file. Oops.

That being said, the rest of them are real issues. I'd love to be able to tell aura to skip building git packages if the build files didn't actually change after a pull. makepkg does it this way iirc; I don't recall it rebuilding things if nothing changed. I imagine such a feature could be added as something in the toml config file that can also be overridden with a command-line switch if necessary.

Lastly, the list of packages I encountered issues with (you can add bluez-git to the list, but bluez-alsa-git surprisingly works just fine) all seem to fail if the build has to do something with pathing or the local build directory somehow. Copying files and CMake list file failures seem to be common. When I get home I can paste the output from Aura for you. Thanks!

fosskers commented 1 year ago

makepkg does it this way iirc

Aura is calling makepkg internally, so this may be due to passing the --force flag that's making it do a build no matter what.

When I get home I can paste the output from Aura for you.

Yes this would be helpful, thanks! I will also try building on my own machine.

fosskers commented 4 months ago

In an attempt to build ofono-git:

10:41:10 [DEBUG] (1) aura::command::aur::build: Copying git://git.kernel.org/pub/scm/libs/ell/ell.git

Taking a look at it's PKGBUILD, we see:

source=("$pkgname::git+https://git.kernel.org/pub/scm/network/ofono/ofono.git"
  git://git.kernel.org/pub/scm/libs/ell/ell.git)

I believe the second entry this is improperly set. So this is an error by the package maintainer.

fosskers commented 4 months ago

Regarding ofono-git, I've commented on its AUR page regarding the improperly set source. However, that package hasn't been updated for a few years, so you may wish to maintain a local copy.

fosskers commented 4 months ago

Regarding the others, I was able to build uavs3d-git and bluez-tools-git just now without issue. Can you confirm if the failures are still occurring for you?

sonicbhoc commented 4 months ago

Regarding the others, I was able to build uavs3d-git and bluez-tools-git just now without issue. Can you confirm if the failures are still occurring for you?

I'm sorry, I wasn't getting notifications for this for some reason. I'll get back to you after I get done with my work day.

fosskers commented 4 months ago

By the way, it's now easier to install. https://aur.archlinux.org/packages/aura-git is updated to package Aura 4.

sonicbhoc commented 3 months ago

I haven't been using Arch as much recently, unfortunately. When I get my laptop running I'll definitely give it a go.

xfzv commented 3 months ago

+1 for this.

% aura -V
aura-pm 4.0.0

It would be useful to have a way to build VCS packages only if there's a newer commit available. That's what paru does with --devel as argument or Devel in the config file.

fosskers commented 3 months ago

This should already be what's happening, unless you force to rebuild with --git. What behaviour are you noticing at the moment?

xfzv commented 3 months ago

This should already be what's happening, unless you force to rebuild with --git. What behaviour are you noticing at the moment?

% paru -Sua
:: Looking for devel upgrades...
1 devel/neovim-git  0.11.0.r537.ge1d48d5cf2-1 -> latest-commit
:: Packages to exclude (eg: 1 2 3, 1-3):
::
% aura -Au
aura :: Fetching package information...
aura :: Comparing package versions...
aura :: No AUR package upgrades necessary.
fosskers commented 3 months ago

Right. Aura will automatically detect when a -git package on the AUR has actually updated its version, otherwise you need to pass --git to force a rebuild.

kureta commented 3 months ago

I did set git = true in the config file, thinking that it wouldn't check for -git package updates otherwise. Set it back to false now it seems to work normally, but I have to wait until a git package I use gets updated.

The wording in the user guide "--git will consider all such packages for updates:" made me think that it will check all git packages for updates, as if normally it considers only some packages according to some internal logic or something. Wouldn't it be clearer to say "--git will force all such packages to be updated", or is it my comprehension skills? :)

fosskers commented 3 months ago

--git will force all such packages to be updated

You're right, I'll alter the wording.

xfzv commented 3 months ago

Indeed, the description for git in the config file is more accurate in my opinion:

git bool Force update all VCS packages during -Au.

Right. Aura will automatically detect when a -git package on the AUR has actually updated its version, otherwise you need to pass --git to force a rebuild.

OK, thanks for the clarification. I assumed

aura :: Comparing package versions...

meant that aura would compare current local commit and latest upstream commit for -git packages, turns out it's also versions.

I don't think this way of dealing with -git packages updates is ideal. Many -git packages on the AUR haven't had their version bumped in years, so aura will assume that said packages are up to date whereas they're clearly not.

aura -Au --git will force rebuilding all VCS packages, that's overkill in the case the user would like to update just one of them to the latest commit.

aura -A <package-name-git> would be more efficient but the user would have to check upstream first to know whether there are newer commits or not (to avoid rebuilding for nothing if already using latest commit).

Would you consider adding such a mechanism?

fosskers commented 3 months ago

Would you consider adding such a mechanism?

You mean, auto-detection of whether the actual upstream package has new commits?

xfzv commented 3 months ago

Would you consider adding such a mechanism?

You mean, auto-detection of whether the actual upstream package has new commits?

Yes, exactly.