Re: [Rpm-maint] [rpm-software-management/rpm] error: Missing build-id in /builddir/build/BUILDROOT/... (#177)

2017-03-15 Thread Mark Wielaard
On Wed, 2017-03-15 at 20:50 +0100, Mark Wielaard wrote:
> I couldn't replicate this with the current fedora guile-2.0.14-1
> package. There the .go files are not actual ELF files. So rpm will not
> complain about them not having a build-id. If that has changed in with
> guile 2.1.8 and the .go files are ELF binaries now and it is intended
> that they don't have a build-id then you could work around it by
> undefining %_missing_build_ids_terminate_build.
> 
> I'll try with the src.rpm you provided.

And indeed it seems guile switched to producing ELF files.
But note the following from
https://wingolog.org/archives/2014/01/19/elf-in-guile

Note that although Guile uses ELF on all platforms, we do not
use platform support for ELF. Guile implements its own linker
and loader. The advantage of using ELF is not sharing code, but
sharing ideas. ELF is simply a well-designed object file format.

So rpm is correct to warn that the ELF images don't contain build-ids.
As long as guile doesn't produce them you will need to add something
like the following to your spec file:

# Guile produces ELF images that are just containers for guile and don't
# include build-ids. 
https://wingolog.org/archives/2014/01/19/elf-in-guile
%undefine _missing_build_ids_terminate_build

That lets me rebuild your new guile srpm.
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] error: Missing build-id in /builddir/build/BUILDROOT/... (#177)

2017-03-15 Thread Mark Wielaard
On Wed, 2017-03-15 at 10:10 -0700, John Dulaney wrote:
> When scratch building a source rpm (0) in koji (1), I receive the following 
> error in the build log:
> 
> error: Missing build-id in 
> /builddir/build/BUILDROOT/guile-2.1.8-1.fc27.x86_64/usr/lib64/guile/2.2/ccache/language/elisp/spec.go
> error: Missing build-id in 
> /builddir/build/BUILDROOT/guile-2.1.8-1.fc27.x86_64/usr/lib64/guile/2.2/ccache/language/elisp/falias.go
> error: Missing build-id in 
> /builddir/build/BUILDROOT/guile-2.1.8-1.fc27.x86_64/usr/lib64/guile/2.2/ccache/language/elisp/runtime/function-slot.go
> 
> I will attempt to reproduce by rebuilding the same srpm (2).
> 
> (0)  https://st.jdulaney.com/guile-2.1.8-1.fc25.src.rpm
> (1)  https://kojipkgs.fedoraproject.org//work/tasks/1877/18391877/build.log
> (2)  https://koji.fedoraproject.org/koji/taskinfo?taskID=18400786

Thanks for the report.
I couldn't replicate this with the current fedora guile-2.0.14-1
package. There the .go files are not actual ELF files. So rpm will not
complain about them not having a build-id. If that has changed in with
guile 2.1.8 and the .go files are ELF binaries now and it is intended
that they don't have a build-id then you could work around it by
undefining %_missing_build_ids_terminate_build.

I'll try with the src.rpm you provided.
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [PATCH] Make sure to reset file attributes for generated build-id directories.

2017-03-15 Thread Mark Wielaard
From: Mark Wielaard 

[Note this patch is currently being tested in Fedora. See bug below.]

When creating the build-id directories we should reset the file attributes
to the defaults. Otherwise if the file list contained an %attr or %defattr
the directories would come out with the wrong mode.

Includes a testcase based on a spec by Igor Gnatenko that fails before
and Check that build-id directories are created with the right permissions
even if the spec file sets attrs explicitly.

https://bugzilla.redhat.com/show_bug.cgi?id=1432372

Signed-off-by: Mark Wielaard 
---
 build/files.c| 21 +++
 tests/Makefile.am|  2 ++
 tests/data/SOURCES/hello.c   |  8 +++
 tests/data/SPECS/hello-attr-buildid.spec | 27 
 tests/rpmbuildid.at  | 36 
 5 files changed, 94 insertions(+)
 create mode 100644 tests/data/SOURCES/hello.c
 create mode 100644 tests/data/SPECS/hello-attr-buildid.spec

diff --git a/build/files.c b/build/files.c
index 6021643..9479e6e 100644
--- a/build/files.c
+++ b/build/files.c
@@ -1797,6 +1797,7 @@ static int generateBuildIDs(FileList fl)
char *mainiddir = NULL;
char *debugiddir = NULL;
if (rc == 0) {
+   char *attrstr;
/* Add .build-id directories to hold the subdirs/symlinks.  */
 #define BUILD_ID_DIR "/usr/lib/.build-id"
 #define DEBUG_ID_DIR "/usr/lib/debug/.build-id"
@@ -1804,6 +1805,18 @@ static int generateBuildIDs(FileList fl)
mainiddir = rpmGetPath(fl->buildRoot, BUILD_ID_DIR, NULL);
debugiddir = rpmGetPath(fl->buildRoot, DEBUG_ID_DIR, NULL);
 
+   /* Make sure to reset all file flags to defaults.
+  Uses parseForAttr to reset ar, arFlags, and specdFlags.
+  Note that parseForAttr pokes at the attrstr, so we cannot
+  just pass a static string. */
+   fl->def.verifyFlags = RPMVERIFY_ALL;
+   fl->cur.verifyFlags = RPMVERIFY_ALL;
+   fl->def.specdFlags |= SPECD_VERIFY;
+   fl->cur.specdFlags |= SPECD_VERIFY;
+   attrstr = xstrdup ("%defattr(-,root,root)");
+   parseForAttr(fl->pool, attrstr, 1, >def);
+   free (attrstr);
+
/* Supported, but questionable.  */
if (needMain && needDbg)
rpmlog(RPMLOG_WARNING,
@@ -1813,8 +1826,12 @@ static int generateBuildIDs(FileList fl)
if ((rc = rpmioMkpath(mainiddir, 0755, -1, -1)) != 0) {
rpmlog(RPMLOG_ERR, "%s %s: %m\n", errdir, mainiddir);
} else {
+   rasprintf (, "%s %s", "%attr(-,root,root) ",
+  mainiddir);
+   parseForAttr(fl->pool, attrstr, 0, >cur);
fl->cur.isDir = 1;
rc = addFile(fl, mainiddir, NULL);
+   free (attrstr);
}
}
 
@@ -1822,8 +1839,12 @@ static int generateBuildIDs(FileList fl)
if ((rc = rpmioMkpath(debugiddir, 0755, -1, -1)) != 0) {
rpmlog(RPMLOG_ERR, "%s %s: %m\n", errdir, debugiddir);
} else {
+   rasprintf (, "%s %s", "%attr(-,root,root) ",
+  debugiddir);
+   parseForAttr(fl->pool, attrstr, 0, >cur);
fl->cur.isDir = 1;
rc = addFile(fl, debugiddir, NULL);
+   free (attrstr);
}
}
}
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 815a390..ad41957 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -69,6 +69,8 @@ EXTRA_DIST += data/RPMS/hello-2.0-1.i686.rpm
 EXTRA_DIST += data/RPMS/hello-2.0-1.x86_64.rpm
 EXTRA_DIST += data/SRPMS/foo-1.0-1.src.rpm
 EXTRA_DIST += data/SRPMS/hello-1.0-1.src.rpm
+EXTRA_DIST += data/SOURCES/hello.c
+EXTRA_DIST += data/SPECS/hello-attr-buildid.spec
 
 # testsuite voodoo
 AUTOTEST = $(AUTOM4TE) --language=autotest
diff --git a/tests/data/SOURCES/hello.c b/tests/data/SOURCES/hello.c
new file mode 100644
index 000..020484e
--- /dev/null
+++ b/tests/data/SOURCES/hello.c
@@ -0,0 +1,8 @@
+#include 
+
+int
+main (void)
+{
+  printf ("Hello, world!\n");
+  return 0;
+}
diff --git a/tests/data/SPECS/hello-attr-buildid.spec 
b/tests/data/SPECS/hello-attr-buildid.spec
new file mode 100644
index 000..cdab95f
--- /dev/null
+++ b/tests/data/SPECS/hello-attr-buildid.spec
@@ -0,0 +1,27 @@
+Name:   test
+Version:1.0
+Release:1
+Summary:Test
+
+License:Public Domain
+URL:https://fedoraproject.org
+Source: hello.c
+
+%description
+%{summary}.
+
+%prep
+%autosetup -c -D -T
+cp -a %{S:0} .
+
+%build
+gcc -g hello.c -o hello
+
+%install
+mkdir -p %{buildroot}%{_bindir}
+install -D -p -m 0755 -t %{buildroot}%{_bindir} hello
+
+%files

[Rpm-maint] [rpm-software-management/rpm] error: Missing build-id in /builddir/build/BUILDROOT/... (#177)

2017-03-15 Thread John Dulaney
When scratch building a source rpm (0) in koji (1), I receive the following 
error in the build log:

error: Missing build-id in 
/builddir/build/BUILDROOT/guile-2.1.8-1.fc27.x86_64/usr/lib64/guile/2.2/ccache/language/elisp/spec.go
error: Missing build-id in 
/builddir/build/BUILDROOT/guile-2.1.8-1.fc27.x86_64/usr/lib64/guile/2.2/ccache/language/elisp/falias.go
error: Missing build-id in 
/builddir/build/BUILDROOT/guile-2.1.8-1.fc27.x86_64/usr/lib64/guile/2.2/ccache/language/elisp/runtime/function-slot.go

I will attempt to reproduce by rebuilding the same srpm (2).

(0)  https://st.jdulaney.com/guile-2.1.8-1.fc25.src.rpm
(1)  https://kojipkgs.fedoraproject.org//work/tasks/1877/18391877/build.log
(2)  https://koji.fedoraproject.org/koji/taskinfo?taskID=18400786

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/177___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [PATCH] parseSpec: use getline instead of fgetc

2017-03-15 Thread Florian Festi
Thanks for the patch!

Pushed.

Florian

-- 

Red Hat GmbH, http://www.de.redhat.com/, Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Paul Argiry, Charles Cachera, Michael Cunningham,
Michael O'Neill
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] build: error: line 73: unclosed macro or bad line continuation (broken spectool) (#175)

2017-03-15 Thread Florian Festi
Closed #175 via aeb58f654a6e8ea433e8d63fae28ab57a871d05d.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/175#event-1000445704___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint