You are not logged in.

#1 2017-11-06 07:22:17

Gnew Stemdee
Member
Registered: 2017-06-11
Posts: 7

Building source: "clean chroot?" "script or manually?"

As an exercise, I went through the process of building a core repo package, ed the editor, from source. Used asp and svn to fetch PKGBUILD and files needed per wiki https://wiki.archlinux.org/index.php/Arch_Build_System. Used a clean chroot "Convenience Way" https://wiki.archlinux.org/index.php/De … ean_Chroot, installed devtools and used the extra-x86_64-build script.

The extra-x86_64-build script curiously promped for my sudo password right away. After dealing with the pgp key, the build proceeded normally.
I also noticed the script actually installed ed in the chroot /var/lib/archbuild/extra-x86_64/uzer/bin/ after building the package.

I understand for system safety, AUR packages built with makepkg as user and not root. I also understand the repo packages are on an entirely different level of trust compared to AUR.

So some reading after: chroot requires root privilege https://wiki.archlinux.org/index.php/ch … quirements
Also a section for alternatives without root privileges. https://wiki.archlinux.org/index.php/ch … privileges


A few questions.  Why the script installs ed in chroot?

Do you all use clean chroot (with script or manually) on your everyday or dedicated build systems.

Does it depend if package used on build system or other systems?

Thanks

Offline

#2 2017-11-06 09:28:55

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,846
Website

Re: Building source: "clean chroot?" "script or manually?"

Why the script installs ed in chroot?

Presumably so that devs can test that the package installs correctly and the install scriptlet (if any) runs successfully before they push it out to a repository.

Do you all use clean chroot (with script or manually) on your everyday or dedicated build systems.

Yes. All my foreign packages are built with a clean chroot. Some end up in my personal repository which is used to distribute my built packages to all of my machines (laptop, work, home desktop)

Does it depend if package used on build system or other systems?

If you start with a well written PKGBUILD and build it in a clean chroot, then the resulting package should install and work properly on any Arch install*. If you use makepkg directly, then you end up with a package which, depending on the build system, may have undeclared dependencies. A lot of build systems are greedy -- if they can build with feature X when package X is available, they will, even if the PKGBUILD writer did not write the PKGBUILD with this in mind.


* assuming you built the package for the architecture of the destination PC. i.e. You can't install a x86_64 package on an i686 arch install and expect it to work just because it was built in a clean chroot.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#3 2017-11-06 10:29:06

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Building source: "clean chroot?" "script or manually?"

Gnew Stemdee wrote:

Do you all use clean chroot (with script or manually) on your everyday or dedicated build systems.

Yep. I use clean-chroot-manager on my build machine and push the packages to a custom repo.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#4 2017-11-06 11:32:27

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: Building source: "clean chroot?" "script or manually?"

Gnew Stemdee wrote:

Do you all use clean chroot (with script or manually) on your everyday... systems.

No.  I never have.

Very much like I don't read the front page arch linux news before updating my system.  At the first sign of trouble without an obvious solution, though, I do read the news.  Just the same, any trouble building a package with just `makepkg -si` I first assume may be due to peculiarities of my system and if I don't find evidence to the contrary I'd try a clean chroot before assuming there was a problem in the package.

But note that I quoted what I was responding to: this is for my everyday system(s) for personal use, not a build server to distribute built packages.  I'd say anyone doing the latter must use a clean chroot.

Last edited by Trilby (2017-11-06 11:32:50)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2017-11-06 12:40:04

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: Building source: "clean chroot?" "script or manually?"

For packages of high familiarty, I just build with makepkg.  Most others I use a clean chroot for a personal repo shared on my lan and amoung friends...That’s most of why I wrote clean-chroot-manager linked by slithery above.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#6 2017-11-10 01:02:24

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: Building source: "clean chroot?" "script or manually?"

Gnew Stemdee wrote:

Do you all use clean chroot (with script or manually) on your everyday or dedicated build systems.

Never. But I would do this if I was going to share the built package or if I was testing a PKGBUILD which I planned to share.

I build almost all packages as a dedicated user, however i.e. not as my usual user. I only build as me if the package won't build otherwise, I understand why it won't build otherwise and I'm more-than-usually confident about the PKGBUILD. This applies to very few packages, though. Almost everything builds fine as my other user.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB