You are not logged in.
I have a build process that uses the arch iso to install a new system. I have just tried to use it after a few months of not using it. I had the usual expected task of bringing things up to date however there is one remaining issue I am unsure of that I'd appreciate some commentary on.
My build script runs on a clean Arch ISO live environment. It begins with a pacman -Syu to ensure it is bang up to date.
It then installs make gcc fakeroot into the live environment and proceeds to build AUR packages, however this now fails with an error
==> ERROR: Cannot find the debugedit binary required for including source files in debug packages.
I believe this has started to happen because debug has been enabled in /etc/makepkg.conf options. This happened in a change that was merged on Feb 6th. I can fix the problem by changing this value back to !debug like it was before the merge. Or I can install debugedit.
This is easily reproducible: netboot a live Arch env and then
$ mount -o remount,size=100% /run/archiso/cowspace
$ pacman -Syu
$ pacman -S make gcc fakeroot
$ cd /tmp
$ curl -s https://aur.archlinux.org/cgit/aur.git/snapshot/mkinitcpio-sd-zfs.tar.gz | tar zx
$ chown -R nobody: mkinitcpio-sd-zfs
$ cd mkinitcpio-sd-zfs
$ sudo -u nobody makepkg
This will fail with the error. However, if you do this:
$ sed -i -e '/^OPTIONS=/s/debug/!debug/' /etc/makepkg.conf
$ sudo -u nobody makepkg
Then it works. Alternatively pacman -S debugedit.
My question is really about what this change brings to the party. Do I want debugedit or not? If so, why?
Or is this a change that slipped into that merge but isn't really required?
Offline
Arch devs decided that the makepkg.conf that they use to build system packages should be the same as the one they install on your system. This is the result.
Offline
I was about to argue how stupid this change was not because I don't like the config setting, that's subjective and defaults are just defaults. But I was going to argue that it's stupid to have a default setting that will not work on a default system: either the debug option should not be enabled by default, or the necessary package debugedit should be a dependency of base-devel.
Of course before I posted such a rant I checked: debugedit is required by base-devel. If you are using makepkg and you do not have base-devel installed, you are doing it wrong. I may still subjectively dislike this being the default, but it is an internally consistent setup. You would not get this error if you were using makepkg properly (by installing base-devel).
EDIT: side-note, I do not have debugedit installed as I do not have base-devel installed. I've made my own slimmed down "aur-devel" package. But I'm aware of the fact that I'm using the AUR in an unsupported way. If / when stuff breaks as a result, that's on me. I diverged from using base-devel due to 'sudo' being included: PKGBUILDs should never use sudo, ever. So there's no reason for this to be in base-devel.
Last edited by Trilby (2024-05-15 13:14:42)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
OK yes that makes sense. I was trying to install (into the live env) the barest minimum so as not to run out of space and that is why I had previously worked out what dependencies were required to build the packages I was using and I had it work successfully. The change to the debug setting broke that and led me to where we are. I could just install base-devel or change the makepkg config to remove debug. I guess that's my call and, as you say, on me if it breaks.
But seeing as we're here... what's the need for debug being enabled (other than convenience for the devs)? Am I losing something by disabling it (in makepkg config) that I don't know I need? I guess not given you've disabled it also.
I have noticed my images have bloated by around 20% since a few months ago. May be down to everything being built debug or may be just natural growth, I don't know.
Offline
Am I losing something by disabling it (in makepkg config) that I don't know I need? I guess not given you've disabled it also.
My two cents on this may not be worth that much - but yes, I do not have debugging disabled, nor do I have base-devel installed. And this has been working very well for me. It'd be great if some of the devs using could present the case for the debug flag and what value it provides.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
"Backtraces" - the flag certainly makes sense for centrally mass-distributed packages because when users run into obscure issues signals, they can provide a backtrace that often makes it rather easy to debug the error and is typically requested upstream for that reason.
For local, private builds? Rather pointless default action.
Ifff you should indeed run into issues w/ a package you think a more detailed backtrace might be useful for you can enable it for that package you're building (and apparently debugging) yourself anyway - otherwise it's just bloat.
Just like with the default compression, context matters and some of the settings that are extremely reasonable in one context are not very smart in a another one.
Offline
EDIT: side-note, I do not have debugedit installed as I do not have base-devel installed. I've made my own slimmed down "aur-devel" package. But I'm aware of the fact that I'm using the AUR in an unsupported way. If / when stuff breaks as a result, that's on me. I diverged from using base-devel due to 'sudo' being included: PKGBUILDs should never use sudo, ever. So there's no reason for this to be in base-devel.
More side note: As always, base-devel is packaged in the way the Arch Packagers need it to be. The Arch packaging buildsystem relies on sudo for setting up chroots etc. The fact that people decided this was a standard for the AUR is irrelevant in decision making at the packaging level. (I do not even have the "base" package installed - noone ever needs bzip2...)
Offline
For building packages using PKGBUILD from AUR (or created myself), I use following command which prevents makepkg to create and install debug package.
No need to modify any config file:
makepkg -si OPTIONS=-debug
The minus (-) sign at start of "debug" means "do NOT create and install debug package.
This is simple and easy.
EDIT:
Above solution does not build a debug package, but includes the debug symbol in the main package itself..
Another solution, which does NOT build debug package, as well as does NOT includes the debug symbol in the main package itself is given below:
Edit file PKGBUILD and add following line:
options=('!debug')
Then issue command:
makepkg -si
.
Last edited by abcd567 (Today 04:14:28)
Offline
For building packages using PKGBUILD from AUR (or created myself), I use following command which prevents makepkg to create and install debug package.
No need to modify any config file:
makepkg -si OPTIONS=-debug
The minus (-) sign at start of "debug" means "do NOT create and install debug package.
This is simple and easy.
EDIT:
Nice! I've always relied on setting (prepending debug with !)ie: '!debug' in 'makepkg.conf' 'OPTIONS' array for this.
Did I overlook your solution 'OPTIONS=-debug' in the related man pages (makepkg, makepkg.conf, PKGBUILD) documentation?
Where did you find this?
Last edited by NuSkool (Today 02:35:07)
Scripts I use: https://github.com/Cody-Learner
Offline
You did not overlook it because it is a really bad "solution".
Offline
You did not overlook it because it is a really bad "solution".
Although I didn't see the following skimming through the documentation, I did just verify that it works.ie: eliminated the debug package being built when the makepkg.conf is set to build it.
makepkg OPTIONS='!debug' -sr
This makes more sense to me due to it being the method used in 'makepkg.conf'. Thoughts or opinion on using this?
The difference:
OPTIONS=-debug
OPTIONS='!debug'
Maybe abcd567 had a typo, but even then I found I had to single quote the option I used for it to work.
EDIT: Thinking out loud.... would this be added to or replace the 'OPTIONS' array in 'makepkg.conf'?
Last edited by NuSkool (Today 00:37:44)
Scripts I use: https://github.com/Cody-Learner
Offline
EDIT: Thinking out loud.... would this be added to or replace the 'OPTIONS' array in 'makepkg.conf'?
Replaces - and as such the debug symbols are now included in the package and not stripped.
Offline
NuSkool wrote:EDIT: Thinking out loud.... would this be added to or replace the 'OPTIONS' array in 'makepkg.conf'?
Replaces - and as such the debug symbols are now included in the package and not stripped.
Thanks for clearing this up Allan. I don't think anyone would want to use either of these then.
I'll add for anyone not understanding the details, stick to the documented methods if you just want to eliminate debug packages being built.
Change it it /etc/makepkg.conf, after reading man makepkg.conf , 'OPTIONS=' info on the array.
Unintentionally replacing the entire 'OPTIONS' array in '/etc/makepkg.conf' using an undocumented method with 'makepkg' is as Allan said:
a really bad "solution".
EDIT: YMMY depending on AUR helpers. They could use it's own equivalent for 'makepkg.conf' and possibly another yet, depending if clean chroot building.
Last edited by NuSkool (Today 02:44:38)
Scripts I use: https://github.com/Cody-Learner
Offline
EDIT:
Nice! I've always relied on setting (prepending debug with !)ie: '!debug' in 'makepkg.conf' 'OPTIONS' array for this.Did I overlook your solution 'OPTIONS=-debug' in the related man pages (makepkg, makepkg.conf, PKGBUILD) documentation?
Where did you find this?
I found this solution only today by trial-and-error, and decided to post it in forum for benefit of the community.
The man pages do not give any idea about options to be used as flag with the makepkg command. I tried options=!debug, but it failed. Then I recalled that some place in man pages, it was mentioned that putting a minus (-) sign with flag results in stopping the option. So I tried options=-debug, and it worked.
I have edited my post and added info about adding options=('!debug') in PKGBUILD. The options=-debug does NOT work in the PKGBUILD. This one also I found by trial-and-error
Offline
Unintentionally replacing the entire 'OPTIONS' array in '/etc/makepkg.conf' using an undocumented method with 'makepkg' is as Allan said:
a really bad "solution".
Instead of using OPTIONS flag with makepkg command, add OPTIONS line in file PKGBUILD.
NOTE: Using += sign instead of = sign in PKBUILD wont replace the whole OPTIONS array, it will add !debug to the array.
OPTIONS=( !debug ) ## In PKGBUILD, do NOT use this one as it will replace whole OPTIONS array
OPTIONS+=( !debug ) ## In PKGBUILD, use this one as it will not replace array, but will add !debug to array. Leave empty space on both sides of !debug
Offline
Why are you not editing the configuration file (/etc/makepkg.conf)? Surprisingly, the configuration file is for configuring your system.
Offline