darch icon indicating copy to clipboard operation
darch copied to clipboard

AUR - how the hell?

Open phunni opened this issue 5 years ago • 17 comments

Having now managed to get a basic build running I'm now trying to work on some further images intended for other computers, but I'm banging my head against a brick wall when it comes to aur packages. I don't really care too much about build times, so I don't want to bother with maintaining and hosting my own pacman repository, but, whenever I try and build a packge in a script, I run into the issue that trizen/makepkg cannot be run as root, but pacman must be. I have pacman enabled via sudo, but, because the script itself is run as root, this then causes other issues. Is anyone else building packages during image builds? How do you handle it?

phunni avatar Dec 20 '19 17:12 phunni

Ah, yes, the makepkg issue. They added that after Darch was built, which annoys the shit out of me.

When I was doing Arch builds, I had to run a makepkg.patch file against /usr/bin/makepkg to just remove the check for root. It's harmless.

Check this: https://github.com/pauldotknopf/darch-recipes/commit/2945b2d61c797fd86b9b14c786c0067943fa369c#diff-844c94b0e5d70e755e1d75768823c931

pauldotknopf avatar Dec 20 '19 17:12 pauldotknopf

Also this: https://gist.github.com/pauldotknopf/ff8e986225ab2f264acea1a5bb0c6c5a

pauldotknopf avatar Dec 20 '19 17:12 pauldotknopf

Looks like there's been a quite a few changes to makepkg since this - the patch won'y apply as is. Sigh - this is so much harder/more work than it should be - they really should provide an option to allow running as root...

I did try and get trizen to build the package and then install it via pacman, but that just caused other headaches due to write permissions problems among other things...

phunni avatar Dec 20 '19 19:12 phunni

Might have got it working with a super simple patch that just removes the root check. It's running now and it certainly runs as root, so, unless there are some build implications I'm unaware of, it's looking good.

phunni avatar Dec 20 '19 21:12 phunni

they really should provide an option to allow running as root...

Absolutely. I suggested to make it overridable via environment variables, and the maintainers basically said fuck you.

I really hate the Arch community and their collective attitude.

I recommend Ubuntu! :)

pauldotknopf avatar Dec 20 '19 21:12 pauldotknopf

Ubuntu would certainly be easier, but it makes too many choices for me that I don't like. That's what I love about Arch - I can set up the system pretty much exactly how I want it. Except when it comes to building things as root apparently... :-/

phunni avatar Dec 21 '19 13:12 phunni

It seems that whatever I've did to makepkg (literally just removed the root check - or so I thought...) has now caused damage to my system. To be fair, they did warn me... :-( I'm going to reopen this because, even if I never get past it, it's still likely to affect other users. Really frustrated - just about ready to give up with darch. It's a brilliant tool and I really want to have all my systems based on immutable, stateless images, but it's proving too difficult if I also want arch. Which I do. /me sobs quietly into his drink...

phunni avatar Dec 21 '19 14:12 phunni

Details on what happened?

pauldotknopf avatar Dec 21 '19 14:12 pauldotknopf

I started getting issues with files no longer owned by packages ( which then caused problems with installing/upgrading packages because the files were already there...), or files not being found that should've been. All the problems went away as soon as I booted an image - which you'd expect, but they started to appear again when I ran trizen - which in turn ran my patched makepkg. So, presumably, if I used a vanilla makepkg then I wouldn't have these problems, but then I'd be right back to square one with the issues with makepkg and root...

phunni avatar Dec 21 '19 14:12 phunni

Another option is to create a dummy user to build the packages in Darch, using gosu or something.

pauldotknopf avatar Dec 21 '19 14:12 pauldotknopf

You can see the script I'm using for the commonly used "common"here
Running makepkg as nobody is what the arch wiki recommends - directing you to this page - which is where I got some of my script from. I'm now failing with

==> ERROR: You do not have write permission for the directory $BUILDDIR (/).

which is completely baffling me - why on earth is the BUILDDIR being set to /? nobody definitely has write permissions on /home/build/trizen

I'm sure this is much harder than it needs to be...

phunni avatar Dec 21 '19 20:12 phunni

Lol.

Just use Ubuntu and never have a problem again! ;)

pauldotknopf avatar Dec 21 '19 20:12 pauldotknopf

And never have my system how I like it again either 😜

phunni avatar Dec 21 '19 21:12 phunni

Honestly, out of curiosity, I'd love to see a detailed breakdown of what customizations you can do in arch that you can't do in Ubuntu.

pauldotknopf avatar Dec 21 '19 22:12 pauldotknopf

Ubuntu with Bedrock Linux? 😹

shadowrylander avatar May 15 '20 05:05 shadowrylander

As far as I'm aware Ubuntu won't ever give me a super basic setup after the installation and will always try and install a bunch of packages I don't want.

phunni avatar May 15 '20 14:05 phunni

Ubuntu will only install a bunch of packages when you install ubuntu-desktop.

You can blacklist then though, like I do here: https://github.com/pauldotknopf/darch-recipes/blob/master/recipes/desktop/blacklist-packages

pauldotknopf avatar May 15 '20 14:05 pauldotknopf