ALT Linux Team development discussions
 help / color / mirror / Atom feed
* [devel] I: perl.req vs BEGIN
@ 2008-08-15 12:00 Alexey Gladkov
  2008-08-15 12:12 ` Alexey Tourbin
  2008-08-18  7:01 ` Stanislav Ievlev
  0 siblings, 2 replies; 10+ messages in thread
From: Alexey Gladkov @ 2008-08-15 12:00 UTC (permalink / raw)
  To: ALT Devel discussion list

Приветствую!

Пишу сюда, чтобы разметить возможную граблю. Нарвался тут при сборке
пакета с такой ошибкой:

/usr/lib/groff/groffer is not an existing directory; at /tmp/groff-buildroot/usr/bin/groffer line 145.
BEGIN failed--compilation aborted at /tmp/groff-buildroot/usr/bin/groffer line 167.
# perl(func.pl) at line 157 (depth 5) not loaded at BEGIN SKIP
# perl(man.pl) at line 158 (depth 5) not loaded at BEGIN SKIP
/tmp/groff-buildroot/usr/bin/groffer: deparse failed. isPerl=0.0409154403404476.
find-requires: ERROR: /usr/lib/rpm/perl.req failed

Ошибка несколько интересная. Смотрим в код утилиты groffer:

BEGIN {
...
    die "$groffer_libdir is not an existing directory;"
      unless -d $groffer_libdir;

    unshift(@INC, $groffer_libdir);
...
    require 'func.pl';
    require 'man.pl';
...
}

Как видно во время проверки зависимостей реально отработал код скрипта и
разумеется вышел с ошибкой, и этим завалил сборку пакета.

После консультаций с at@, выяснилось, что блок BEGIN отрабатывает в perl
*всегда*... даже при syntax check.

Таким образом, хочу предостеречь всех кто пакует перловые скрипты: если 
у вас в скрипте есть блок BEGIN, то будьте готовы, что он выполнится нашим 
rpm во время сборки.

Как варианты обхода:
1) Заменить BEGIN на обычный блок (если в нём есть проверки, как
   в моём случае).
2) Отключить поиск зависимостей в перл скриптах :)

-- 
Rgrds, legion



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-08-18  7:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-15 12:00 [devel] I: perl.req vs BEGIN Alexey Gladkov
2008-08-15 12:12 ` Alexey Tourbin
2008-08-15 12:26   ` Alexey Gladkov
2008-08-15 12:32     ` Alexey Tourbin
2008-08-15 13:08     ` Alexey I. Froloff
2008-08-15 13:17       ` Alexey Gladkov
2008-08-15 13:33         ` Led
2008-08-15 13:42           ` Alexey Gladkov
2008-08-15 13:51             ` Led
2008-08-18  7:01 ` Stanislav Ievlev

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git