FS#11179 - [makepkg] Running with -s exit makepkg without build package

Attached to Project: Pacman
Opened by Gerhard Brauer (GerBra) - Monday, 11 August 2008, 08:52 GMT
Last edited by Dan McGee (toofishes) - Wednesday, 20 August 2008, 00:58 GMT
Task Type Bug Report
Category makepkg
Status Closed
Assigned To Xavier (shining)
Allan McRae (Allan)
Architecture All
Severity Medium
Priority Normal
Reported Version 3.2.0
Due in Version 3.2.1
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Summary and Info:
Building a package with automatically installed depends stops makepkg after installing the depends, without building the package itself.


Steps to Reproduce:
Example package fortune-mod from abs:
[gerhard@tux1 fortune-mod]$ LANG=C makepkg -sr
==> Making package: fortune-mod 1.99.1-3 i686 (Mon Aug 11 10:50:13 CEST 2008)
==> Checking Runtime Dependencies...
==> Installing missing dependencies...
resolving dependencies...
looking for inter-conflicts...

Targets (1): recode-3.6-2

Total Download Size: 0.00 MB
Total Installed Size: 2.93 MB

Proceed with installation? [Y/n]
checking package integrity...
(1/1) checking for file conflicts [#####################] 100%
(1/1) installing recode [#####################] 100%
[gerhard@tux1 fortune-mod]$

The build itself is not done, installed depends keep installed.

Looking with strace last message is:
exit_group(1)
This task depends upon

Closed by  Dan McGee (toofishes)
Wednesday, 20 August 2008, 00:58 GMT
Reason for closing:  Fixed
Additional comments about closing:  Commit a23fc08758cbbc7aa861eee2f537d4e1048bb03 9
Comment by Allan McRae (Allan) - Monday, 11 August 2008, 11:09 GMT
I can't replicate this here and can't figure out how this is dying without outputing an error message... To help track this down can you please try running this version of makepkg which has a bunch of extra "debug" messages and posting the output: http://dev.archlinux.org/~allan/makepkg.debug
Comment by Gerhard Brauer (GerBra) - Monday, 11 August 2008, 11:31 GMT
On archlinux.de we have 3 confirmation on this behavior.

Here with your Debug-version:
[gerhard@tux1 fortune-mod]$ LANG=C ../makepkg.debug -sr
==> Making package: fortune-mod 1.99.1-3 i686 (Mon Aug 11 13:27:24 CEST 2008)
==> Checking Runtime Dependencies...
Allan #13
Allan #01
Allan #03
Allan #04
Allan #05
==> Installing missing dependencies...
Allan #06
Allan #07
resolving dependencies...
looking for inter-conflicts...

Targets (1): recode-3.6-2

Total Download Size: 0.00 MB
Total Installed Size: 2.93 MB

Proceed with installation? [Y/n]
checking package integrity...
(1/1) checking for file conflicts [#####################] 100%
(1/1) installing recode [#####################] 100%
Allan #09
Allan #11
[gerhard@tux1 fortune-mod]$

Comment by Allan McRae (Allan) - Monday, 11 August 2008, 11:52 GMT
That seems to limit this to the following line, which is a concern...

# we might need the new system environment
source /etc/profile &>/dev/null

Can you comment that line out in your version of makepkg to see if that fixes the issue? It should not be needed for that package.
Comment by Gerhard Brauer (GerBra) - Monday, 11 August 2008, 12:10 GMT
Yes, that fixes it.
Comment by Allan McRae (Allan) - Monday, 11 August 2008, 12:30 GMT
OK. Further tracking... Have you added anything to /etc/profile? If so, what?

If not, can you comment out this section:

# Load profiles from /etc/profile.d
if test -d /etc/profile.d/; then
for profile in /etc/profile.d/*.sh; do
test -x $profile && . $profile
done
unset profile
fi

and if that fixes it, re-enable that section and do a "chmod -x" on individual files in /etc/profile.d until you trace what is happening.

Otherwise, just comment out sections of /etc/profile until you find the culprit.

Remember to re-enable everything before you reboot...

Thanks.
Comment by Xavier (shining) - Monday, 11 August 2008, 13:06 GMT
I can reproduce this by adding "exit" to /etc/profile or any of the /etc/profile.d/* files, but why would anyone do that?
But well, maybe it is something less obvious which has the same effect?
If you can't figure it out yourself, you could always attach your /etc/profile here, and maybe also a tarball of the /etc/profile.d directory.
Comment by Julia (Mimi) - Monday, 11 August 2008, 13:38 GMT
I can confirm this.
chmod -x /etc/profile.d/bash_completion.sh
fixes the problem.
Comment by Gerhard Brauer (GerBra) - Monday, 11 August 2008, 13:39 GMT
Ok Allan, i've found it.
You were right, disabling the
# Load profiles from /etc/profile.d
in /etc/profile fixes it also.

And the "bad guy" in /etc/profile.d is bash_completion.sh

I've tested with a clean user, no modifications on personal .bash or .profiles. Also i have no modifications
on files in /etc, neither profile or in profile.d. Also complete /etc/bash_completion.d is without own modifications.

Therefor must be something in these package files which leads to the makepkg failure.
Comment by Allan McRae (Allan) - Monday, 11 August 2008, 14:03 GMT
Further investigation shows it is one of the scripts in the /etc/bash_completion.d folder. Not sure what yet...
Comment by Allan McRae (Allan) - Monday, 11 August 2008, 14:10 GMT
And the culprit is /etc/bash_completion.d/modules
Comment by Gerhard Brauer (GerBra) - Monday, 11 August 2008, 14:51 GMT
Ok, i don't see something suspect in /etc/bash_completion.d/modules.
This only occurs with pacman 3.2.0, for myself i have had this completation always enabled.

Do you mean this is a failure in new pacman/makepkg or should we reassign this to bash-completion?
Comment by Allan McRae (Allan) - Monday, 11 August 2008, 15:31 GMT
Here is a work-around patch, although I still don't understand why the is needed now and not with 3.1...
Comment by Gerhard Brauer (GerBra) - Monday, 11 August 2008, 15:37 GMT
Thanks, the patch works fine here.

I love these quick fixing a problem with you devs... ;-)

Loading...