patchBison - Patches: patch #9716, Fail to build by rpmbuild duo...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #9716: Fail to build by rpmbuild duo rename of file failing

Submitter:  Andre da Costa Barros <andrecbarros>
Submitted:  Wed 07 Nov 2018 02:38:34 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  akim Open/Closed:  Closed

Jump to the original submission

Thu 08 Nov 2018 12:46:12 PM UTC, comment #8: 

Great, thanks!

Akim Demaille <akim>
Group administrator
Thu 08 Nov 2018 09:41:09 AM UTC, comment #7: 

Fixed!

Indeed, concurrent building and testing triggers surprising results sometimes when generating binary packages. Not the first time I read something about it, definitively.

Many thanks and best regards.

Andre da Costa Barros <andrecbarros>
Thu 08 Nov 2018 07:36:41 AM UTC, comment #6: 

Hi Andre,

I think I have understood, and fixed, your problem.  See the following patch.  It's on master, and there's a tarball here:

https://www.lrde.epita.fr/~akim/private/bison/bison-3.2.19-05e7.tar.gz
https://www.lrde.epita.fr/~akim/private/bison/bison-3.2.19-05e7.tar.xz

commit d99b0944ad3e66c063ca0d087bb5dd90bc6db043
Author: Akim Demaille <akim.demaille@gmail.com>
Date:   Thu Nov 8 06:49:57 2018 +0100

    build: fix issues in the generated tarball
   
    Reported by Andre da Costa Barros.
    https://savannah.gnu.org/patch/?9716
   
    * examples/calc++/local.mk: We no longer generate position.hh and
    stack.hh.  Leaving them here triggers their concurrent generation,
    which fails.
    (%C%_calc___CPPFLAGS): Fix the extracted headers in the source tree.
    * examples/mfcalc/local.mk (%C%_mfcalc_CPPFLAGS): Ditto.

diff --git a/examples/calc++/local.mk b/examples/calc++/local.mk
index 4b31283f..059f2b05 100644
--- a/examples/calc++/local.mk
+++ b/examples/calc++/local.mk
@@ -57,9 +57,7 @@ extracted += $(calcxx_extracted)
 calcxx_sources_generated =                      \
   %D%/parser.cc                                 \
   %D%/parser.hh                                 \
-  %D%/location.hh                               \
-  %D%/position.hh                               \
-  %D%/stack.hh
+  %D%/location.hh
 calcxx_sources =                                \
   $(calcxx_sources_extracted)                   \
   $(calcxx_sources_generated)
@@ -69,7 +67,7 @@ if  ENABLE_CXX
   check_PROGRAMS += %D%/calc++
   nodist_%C%_calc___SOURCES = $(calcxx_sources)
   # Don't use gnulib's system headers.
-  %C%_calc___CPPFLAGS = -I$(top_builddir)/%D%
+  %C%_calc___CPPFLAGS = -I$(top_srcdir)/%D% -I$(top_builddir)/%D%
   %C%_calc___CXXFLAGS = $(AM_CXXFLAGS) $(FLEX_SCANNER_CXXFLAGS)
   TESTS += %D%/calc++.test
 endif  ENABLE_CXX
diff --git a/examples/mfcalc/local.mk b/examples/mfcalc/local.mk
index 9df3b05e..62923b37 100644
--- a/examples/mfcalc/local.mk
+++ b/examples/mfcalc/local.mk
@@ -29,7 +29,7 @@ extracted += $(mfcalc_extracted)
 check_PROGRAMS += %D%/mfcalc
 nodist_%C%_mfcalc_SOURCES = $(mfcalc_sources)
 # Don't use gnulib's system headers.
-%C%_mfcalc_CPPFLAGS = -I$(top_builddir)/%D%
+%C%_mfcalc_CPPFLAGS = -I$(top_srcdir)/%D% -I$(top_builddir)/%D%
 %C%_mfcalc_LDADD = -lm
 
 dist_TESTS += %D%/mfcalc.test

Akim Demaille <akim>
Group administrator
Thu 08 Nov 2018 12:44:55 AM UTC, comment #5: 

I don't know if I was clear enough but the file with the offending command is "examples/calc++/local.mk", as shown inside the rpm .spec I posted early.

Andre da Costa Barros <andrecbarros>
Thu 08 Nov 2018 12:39:27 AM UTC, comment #4: 

Tried the packages you gave a link to and also the latest git naster. Same error.

Best regards,
André

Andre da Costa Barros <andrecbarros>
Wed 07 Nov 2018 09:13:17 PM UTC, comment #3: 

Hi Andre,

Yes, the problem here is concurrency: several jobs are invoking the creation of calc++.stamp concurrently, and that failed.

I have changed all this is the beta I pointed you to, please try it, and tell me if it does not fix your problem.  I plan to release a bug fix 3.2.1 soon, so I need to know if it does address your concern.

Thanks!

Akim Demaille <akim>
Group administrator
Wed 07 Nov 2018 07:16:01 PM UTC, comment #2: 

Compiled the 3.2 version.

In the rpm spec file I just added the line "sed -i.orig examples/calc++/local.mk -e '/\bmv\s\+/ d;'" after the expanding command to be able to build the binaries successfully.

.configure is successful in any case so, if you want I can post it's log but there is no error reported inside it.

The error on building without removing the line is:
<<<
make[4]: Entering directory '/usr/src/packages/BUILD/bison-3.2'
g++-8    -I.  -std=c++11 -O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -c -o examples/c++/simple-simple.o `test -f 'examples/c++/simple.cc' || echo './'`examples/c++/simple.cc
rm -f examples/calc++/parser.stamp
touch examples/calc++/parser.stamp.tmp
./tests/bison -o y.tab.c -d -v -Werror -Wall -Wno-yacc --report=all  -o examples/calc++/parser.cc examples/calc++/parser.yy
updating examples/rpcalc/rpcalc.output
updating examples/rpcalc/rpcalc.h
g++-8    -I.     -O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -c -o examples/c++/variant-variant.o `test -f 'examples/c++/variant.cc' || echo './'`examples/c++/variant.cc
rm -f examples/calc++/parser.stamp
touch examples/calc++/parser.stamp.tmp
./tests/bison -o y.tab.c -d -v -Werror -Wall -Wno-yacc --report=all  -o examples/calc++/parser.cc examples/calc++/parser.yy
mv -f examples/calc++/parser.stamp.tmp examples/calc++/parser.stamp
make[4]: Leaving directory '/usr/src/packages/BUILD/bison-3.2'
g++-8    -I.  -std=c++11 -O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -c -o examples/c++/variant_11-variant-11.o `test -f 'examples/c++/variant-11.cc' || echo './'`examples/c++/variant-11.cc
mv -f examples/calc++/parser.stamp.tmp examples/calc++/parser.stamp
mv: cannot stat 'examples/calc++/parser.stamp.tmp': No such file or directory
Makefile:6209: recipe for target 'examples/calc++/parser.stamp' failed
make[4]: * [examples/calc++/parser.stamp] Error 1
make[4]: Leaving directory '/usr/src/packages/BUILD/bison-3.2'
Makefile:6215: recipe for target 'examples/calc++/stack.hh' failed
make[3]: * [examples/calc++/stack.hh] Error 2
make[3]: * Waiting for unfinished jobs....
make[3]: Leaving directory '/usr/src/packages/BUILD/bison-3.2'
Makefile:5432: recipe for target 'check-am' failed
make[2]: * [check-am] Error 2
make[2]: Leaving directory '/usr/src/packages/BUILD/bison-3.2'
Makefile:4977: recipe for target 'check-recursive' failed
make[1]: * [check-recursive] Error 1
make[1]: Leaving directory '/usr/src/packages/BUILD/bison-3.2'
Makefile:5435: recipe for target 'check' failed
make: * [check] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.hUy7Wo (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.hUy7Wo (%build)

>>>


My modified rpm .spec file is:
<<<
#
# spec file for package bison
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# ...
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           bison
Version:        3.2
Release:        1.0
Summary:        The GNU Parser Generator
License:        GPL-3.0-or-later
Group:          Development/Languages/C and C++
URL:            http://www.gnu.org/software/bison/bison.html
Source0:        ftp://ftp.gnu.org/gnu/bison/bison-%{version}.tar.xz
Source1:        ftp://ftp.gnu.org/gnu/bison/bison-%{version}.tar.xz.sig
Source2:        %{name}.keyring
Source3:        baselibs.conf
BuildRequires:  autoconf
BuildRequires:  flex
BuildRequires:  gcc-c++
BuildRequires:  xz
Requires:       m4
Requires(post): %{install_info_prereq}
Requires(preun): %{install_info_prereq}
Recommends:     %{name}-lang

%description
Bison is a parser generator similar to yacc(1).

%lang_package

%prep
%setup -q
sed -i.orig examples/calc++/local.mk -e '/\bmv\s\+/ d;'

%build
export CC=gcc-8 \
export CXX=g++-8 \
export CPP=cpp-8 \
%configure \
  --disable-silent-rules \
  --disable-rpath \
  --enable-nls \
  --docdir=%{_docdir}/%{name} \
  gl_cv_func_printf_directive_n=yes \
  gl_cv_func_printf_infinite_long_double=yes
%if 0%{?do_profiling}
  make %{?_smp_mflags} CFLAGS="%{optflags} %{cflags_profile_generate}" V=1
  make %{?_smp_mflags} CFLAGS="%{optflags} %{cflags_profile_generate}" check
  make %{?_smp_mflags} clean
  make %{?_smp_mflags} CFLAGS="%{optflags} %{cflags_profile_feedback}" V=1
%else
  make %{?_smp_mflags} CFLAGS="%{optflags}"
%endif

%check
make %{?_smp_mflags} check

%install
%make_install
%find_lang %{name} --all-name

%files
%{_docdir}/%{name}
%dir %{_datadir}/aclocal
%{_bindir}/bison
%{_bindir}/yacc
%{_libdir}/liby.a
%{_datadir}/bison
%dir %{_datadir}/aclocal
%{_datadir}/aclocal/bison-i18n.m4
%{_infodir}/bison.info*.gz
%{_mandir}/man1/bison.1%{?ext_man}
%{_mandir}/man1/yacc.1%{?ext_man}

%files lang -f %{name}.lang

%post
%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz

%preun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz

%changelog

>>>


As I said, all tests and reports gave successful results, after removing the offending command. If you want I can send the results but they will be "<number>: <something> <space> ok".

As you can see from the error report, the code on local.mk deletes 'parser.stamp' a number of times and then creates "parser.stamp.tmp" with "touch examples/calc++/parser.stamp.tmp" except on last round when it just issued "mv -f examples/calc++/parser.stamp.tmp examples/calc++/parser.stamp" and then when it tried it again there were no "parser.stamp.tmp" that time.

Regards,
André

Andre da Costa Barros <andrecbarros>
Wed 07 Nov 2018 04:58:50 PM UTC, comment #1: 

Hi Andre,

What version of Bison have you tried?  Can you give us the exact logs?

Please check the latest nightly, many things have changed recently in this area:

https://www.lrde.epita.fr/~akim/private/bison/bison-3.2.17-351e.tar.gz
https://www.lrde.epita.fr/~akim/private/bison/bison-3.2.17-351e.tar.xz

Cheers.

Akim Demaille <akim>
Group administrator
Wed 07 Nov 2018 02:38:34 PM UTC, original submission:  

It fails to build using rpmbuild on openSUSE 42.3 duo error on renaming 'parser.stamp.tmp' to 'parser.stamp' on examples/calc++ (which reports a error to the builder which then aborts the process).

I just deleted the line with the offending command from 'local.mk' and was able to generated the binaries packages with all reports and tests successfully completed.

Andre da Costa Barros <andrecbarros>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by akim (Posted a comment)
  • -email is unavailable- added by andrecbarros (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-11-08 akim Open/ClosedOpen Closed
    2018-11-08 akim StatusIn Progress Done
    2018-11-07 akim StatusNone In Progress
        Assigned toNone akim

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code