У меня ужасные времена, когда я собираю часть программного обеспечения для компиляции в системе CentOS, и проблема, которую я перечислил ниже, является конкретной, но я надеюсь, что правильный подход, который возникнет из этого, может быть применен к аналогичные проблемы, так как это не похоже на ту, которая характерна только для этого программного обеспечения. Но ближе к делу ...
У меня возникла проблема с компиляцией при создании стандартизированной виртуальной машины на CentOS 5.4, и я здесь в неведении относительно а) почему возникает эта ошибка, и б) как ее исправить, и в надежде, что кто-то еще сталкивается с этой проблемой, я надеюсь, что кто-то может помочь мне найти здесь решение.
Я получаю configure: error: newly created file is older than distributed files!
ошибка при попытке скомпилировать Ruby Enterprise, как показано ниже, когда я пытаюсь запустить установщик, и решения, предлагаемые на форумах (проверка зубца и касание файлов для обновления времени, связанного с ними), похоже, не помогают Вот.
Какие шаги я могу предпринять, чтобы выяснить причину этой проблемы?
[vagrant@vagrant-centos-5 ruby-enterprise-1.8.7-2009.10]$ sudo ./installer
Welcome to the Ruby Enterprise Edition installer
This installer will help you install Ruby Enterprise Edition 1.8.7-2009.10.
Don't worry, none of your system files will be touched if you don't want them
to, so there is no risk that things will screw up.
You can expect this from the installation process:
1. Ruby Enterprise Edition will be compiled and optimized for speed for this
system.
2. Ruby on Rails will be installed for Ruby Enterprise Edition.
3. You will learn how to tell Phusion Passenger to use Ruby Enterprise
Edition instead of regular Ruby.
Press Enter to continue, or Ctrl-C to abort.
Checking for required software...
* C compiler... found at /usr/bin/gcc
* C++ compiler... found at /usr/bin/g++
* The 'make' tool... found at /usr/bin/make
* Zlib development headers... found
* OpenSSL development headers... found
* GNU Readline development headers... found
--------------------------------------------
Target directory
Where would you like to install Ruby Enterprise Edition to?
(All Ruby Enterprise Edition files will be put inside that directory.)
[/opt/ruby-enterprise] :
--------------------------------------------
Compiling and optimizing the memory allocator for Ruby Enterprise Edition
In the mean time, feel free to grab a cup of coffee.
./configure --prefix=/opt/ruby-enterprise --disable-dependency-tracking
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... configure: error: newly created file is older than distributed files!
Check your system clock
Это виртуальная машина, работающая на виртуальном ящике, время хоста и виртуальной машины идентично и актуально. Я также пробовал запустить это после обновления времени с помощью ntp-клиента, так что безрезультатно. Я пробовал это после прочтения этого поста здесь кого-то имея аналогичную проблему
[vagrant@vagrant-centos-5 ruby-enterprise-1.8.7-2009.10]$ date
Tue Apr 27 08:09:05 BST 2010
Другой подход, который я пробовал, - прикоснуться к файлам верхнего уровня в папке сборки. как предложено здесь, но это тоже не сработало (честно говоря, я тоже не уверен, почему это сработало бы)
[vagrant@vagrant-centos-5 ruby-enterprise-1.8.7-2009.10]$ sudo touch ruby-enterprise-1.8.7-2009.10/*
Я не уверен, что я могу сделать здесь дальше - проблема, похоже, заключается в скрипте настройки bash, который возвращает эту ошибку error: newly created file is older than distributed files!
, в строке: 2214
{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5
echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; }
# Just in case
sleep 1
echo timestamp > conftest.file
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
if test "$*" = "X"; then
# -L didn't work.
set X `ls -t $srcdir/configure conftest.file`
fi
rm -f conftest.file
if test "$*" != "X $srcdir/configure conftest.file" \
&& test "$*" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
{ { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
alias in your environment" >&5
echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
alias in your environment" >&2;}
{ (exit 1); exit 1; }; }
fi
### PROBLEM LINE ####
# this line is the problem line - this is returned true, sometimes it isn't and I can't
# see a pattern that that determines when this will test will pass or not.
test "$2" = conftest.file
)
then
# Ok.
:
else
{ { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
Check your system clock" >&5
echo "$as_me: error: newly created file is older than distributed files!
Check your system clock" >&2;}
{ (exit 1); exit 1; }; }
fi
то, что действительно расстраивает, это то, что этот сценарий иногда работает, когда виртуальная машина работает около часа, он работает, но не при загрузке. В crontab я не вижу ничего, что предлагало бы запускать какие-либо ежечасные задачи, которые могли бы изменить состояние системы, чтобы изменить работу этого скрипта.
Я совершенно не понимаю, когда дело касается отладки за пределами этого места. Какой лучший подход здесь?
Спасибо
Мне кажется, что "проверка работоспособности даты" в скрипте configure shell не работает и требует исправления. Посмотри на это:
echo timestamp > conftest.file
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
if test "$*" = "X"; then
# -L didn't work.
set X `ls -t $srcdir/configure conftest.file`
fi
rm -f conftest.file
if test "$*" != "X $srcdir/configure conftest.file" \
&& test "$*" != "X conftest.file $srcdir/configure"; then
Таким образом, он касается файла, а затем пытается выяснить, является ли его mtime новее, чем mtime $srcdir/configure
, и делает это, вызывая ls
а затем сравнение вывода с фиксированной строкой. Авторы пишут
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
но я думаю, что это чушь. Слишком много версий / разновидностей ls
и способы изменить ls
'вывод (они даже называют один), чтобы быть уверенным в ls
' Выходной формат.
Во всяком случае, есть более элегантные способы сделать это. Например. в bash (см. help test
):
if [ $FILE1 -nt $FILE2 ] ; then
echo "$FILE1 is newer than $FILE2"
elif [ $FILE2 -nt $FILE1 ] ; then
echo "$FILE2 is newer than $FILE1"
else
echo "$FILE1 and $FILE2 are equally new"
fi
Или найти Выясните, прямо ли в будущем какое-то время!
find -L $FILE -newermt now -exec echo THE FILE {} IS COMING FROM THE FUTURE \;
или
find -L $FILE -mtime -0 -exec echo THE FILE {} IS COMING FROM THE PRESENT OR THE FUTURE \;
А теперь сами напишите патч :-)
Сегодня я испытал именно эту проблему на только что установленной коробке при установке ree-1.8.7-2011.03.
После настройки ntpd, проверки аппаратных часов и исключения реальных проблем с часами и временем сообщение об ошибке все еще сохранялось. Наконец, я отследил эту ошибку до включенного google-perftools каталог. После прикосновения к этому настроить скрипт проблема решена, и Ruby Enterprise Edition установлен без каких-либо проблем.
[mark@host347 ~]$ cd src/ree-1.8.7-2011.03/source/
[mark@host347 source]$ touch ./distro/google-perftools-1.7/configure
Вы не особо много говорите о производительности вашей системы. Вместо того, чтобы смотреть на проблему компиляции, как насчет тестирования производительности системных часов? NTP может помочь с дрейфом часов, но он не исправит нестабильность. Если аппаратные часы вышли из строя, вам может потребоваться новая материнская плата. Вот тест, который может помочь:
for i in `seq 1 60`
do
date
sleep 60
done
Это должно выводить дату точно каждую минуту. Если результат не выглядит следующим образом:
Tue Apr 27 13:33:28 ADT 2010
Tue Apr 27 13:34:28 ADT 2010
Tue Apr 27 13:35:28 ADT 2010
...
тогда у вас проблема с аппаратными часами. Борьба с этим с помощью таких инструментов, как NTP, может не сработать. Оборудование - лучшее решение, если у вас есть проблема с оборудованием.