Bug#976914: git-buildpackage: FTBFS on ppc64el (arch:all-only src pkg): AssertionError: GitRepositoryError not raised

2020-12-21 Thread Guido Günther
Hi,
On Mon, Dec 21, 2020 at 12:00:01AM +0100, nicoo wrote:
> Control: tag -1 + patch
> Control: retitle -1 git-buildpackage FTBFS when /etc/lsb-release does not 
> exist
> 
> Hi,
> 
> On Wed, Dec 09, 2020 at 09:59:23AM +0100, Lucas Nussbaum wrote:
> > During a rebuild of all packages in sid, your package failed to build
> > on ppc64el. At the same time, it did not fail on amd64.
> > [...]
> > >  >> begin captured logging << 
> > > gbp: info: Failed to read OS release file /etc/lsb-release: [Errno 2] No 
> > > such file or directory: '/etc/lsb-release'
> > > gbp: debug: ['git', 'rev-parse', '--show-cdup']
> > > - >> end captured logging << -
> > > SKIP: Skipping 'tests.component', since this is not a git checkout.
> > >  >> begin captured logging << 
> 
> I was able to reproduce the issue on amd64, so you might want to remove
> the ftbfs-ppc64 usertag?  It is sufficient for /etc/lsb-release not to exist.
> 
> Please find enclosed 2 patches that solve the issue, at least in my 
> environment.
> You might want to check those on Ubuntu, but I believe it should work
> fine there.

Thanks! I've tweaked the first patch slightly since according to

https://packages.ubuntu.com/groovy/amd64/base-files

Ubuntu has /etc/os-release as well now. Pushed to master.
Cheers,
 -- Guido

> 
> 
> Best,
> 
>   nicoo

> From 21e2cf0c2fd66d2781659bc57b8246faf2a147d7 Mon Sep 17 00:00:00 2001
> From: nicoo 
> Date: Sun, 20 Dec 2020 23:35:57 +0100
> Subject: [PATCH 1/2] tests/11_test_dch_main.py: Don't expect /etc/lsb-release
>  on Debian
> 
> ---
>  tests/11_test_dch_main.py | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/11_test_dch_main.py b/tests/11_test_dch_main.py
> index 14cf593..f88959f 100644
> --- a/tests/11_test_dch_main.py
> +++ b/tests/11_test_dch_main.py
> @@ -9,16 +9,16 @@ from .testutils import (DebianGitTestRepo, OsReleaseFile, 
> skip_without_cmd,
>  from gbp.scripts import dch
>  
>  import os
> +import platform
>  import re
>  
>  # Older dch compatibility
>  default_urgency = get_dch_default_urgency()
>  
>  # For Ubuntu compatibility
> -os_release = OsReleaseFile('/etc/lsb-release')
> -
>  # OS release codename and snapshot of version 0.9-2~1
> -if os_release['DISTRIB_ID'] == 'Ubuntu':
> +if 'Ubuntu' in platform.version():
> +os_release = OsReleaseFile('/etc/lsb-release')
>  os_codename = os_release['DISTRIB_CODENAME']
>  snap_header_0_9 = 
> r'^test-package\s\(0.9-1ubuntu1~1\.gbp([0-9a-f]{6})\)\sUNRELEASED;\surgency=%s'
>  % default_urgency
>  new_version_0_9 = '0.9-1ubuntu1'
> -- 
> 2.29.2
> 

> From 971b0a622dcd1bc5ca5f3b4cd97470ff7799c0bc Mon Sep 17 00:00:00 2001
> From: nicoo 
> Date: Sun, 20 Dec 2020 23:43:27 +0100
> Subject: [PATCH 2/2] doctests/test_Changelog: Don't expect /etc/lsb-release
> 
> See #976914
> ---
>  tests/doctests/test_Changelog.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/doctests/test_Changelog.py 
> b/tests/doctests/test_Changelog.py
> index 1fb8a30..a1e4311 100644
> --- a/tests/doctests/test_Changelog.py
> +++ b/tests/doctests/test_Changelog.py
> @@ -262,7 +262,7 @@ def test_add_section():
>  >>> import shutil
>  >>> import gbp.deb.changelog
>  >>> from ..testutils import OsReleaseFile
> ->>> os_release = OsReleaseFile('/etc/lsb-release')
> +>>> os_release = OsReleaseFile()
>  >>> olddir = os.path.abspath(os.path.curdir)
>  >>> testdir = tempfile.mkdtemp(prefix='gbp-test-changelog-')
>  >>> testdebdir = os.path.join(testdir, 'debian')
> @@ -309,7 +309,7 @@ def test_add_entry():
>  >>> import shutil
>  >>> import gbp.deb.changelog
>  >>> from ..testutils import OsReleaseFile
> ->>> os_release = OsReleaseFile('/etc/lsb-release')
> +>>> os_release = OsReleaseFile()
>  >>> olddir = os.path.abspath(os.path.curdir)
>  >>> testdir = tempfile.mkdtemp(prefix='gbp-test-changelog-')
>  >>> testdebdir = os.path.join(testdir, 'debian')
> -- 
> 2.29.2
> 



Bug#976914: git-buildpackage: FTBFS on ppc64el (arch:all-only src pkg): AssertionError: GitRepositoryError not raised

2020-12-20 Thread nicoo
Control: tag -1 + patch
Control: retitle -1 git-buildpackage FTBFS when /etc/lsb-release does not exist

Hi,

On Wed, Dec 09, 2020 at 09:59:23AM +0100, Lucas Nussbaum wrote:
> During a rebuild of all packages in sid, your package failed to build
> on ppc64el. At the same time, it did not fail on amd64.
> [...]
> >  >> begin captured logging << 
> > gbp: info: Failed to read OS release file /etc/lsb-release: [Errno 2] No 
> > such file or directory: '/etc/lsb-release'
> > gbp: debug: ['git', 'rev-parse', '--show-cdup']
> > - >> end captured logging << -
> > SKIP: Skipping 'tests.component', since this is not a git checkout.
> >  >> begin captured logging << 

I was able to reproduce the issue on amd64, so you might want to remove
the ftbfs-ppc64 usertag?  It is sufficient for /etc/lsb-release not to exist.

Please find enclosed 2 patches that solve the issue, at least in my environment.
You might want to check those on Ubuntu, but I believe it should work fine 
there.


Best,

  nicoo
From 21e2cf0c2fd66d2781659bc57b8246faf2a147d7 Mon Sep 17 00:00:00 2001
From: nicoo 
Date: Sun, 20 Dec 2020 23:35:57 +0100
Subject: [PATCH 1/2] tests/11_test_dch_main.py: Don't expect /etc/lsb-release
 on Debian

---
 tests/11_test_dch_main.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/11_test_dch_main.py b/tests/11_test_dch_main.py
index 14cf593..f88959f 100644
--- a/tests/11_test_dch_main.py
+++ b/tests/11_test_dch_main.py
@@ -9,16 +9,16 @@ from .testutils import (DebianGitTestRepo, OsReleaseFile, skip_without_cmd,
 from gbp.scripts import dch
 
 import os
+import platform
 import re
 
 # Older dch compatibility
 default_urgency = get_dch_default_urgency()
 
 # For Ubuntu compatibility
-os_release = OsReleaseFile('/etc/lsb-release')
-
 # OS release codename and snapshot of version 0.9-2~1
-if os_release['DISTRIB_ID'] == 'Ubuntu':
+if 'Ubuntu' in platform.version():
+os_release = OsReleaseFile('/etc/lsb-release')
 os_codename = os_release['DISTRIB_CODENAME']
 snap_header_0_9 = r'^test-package\s\(0.9-1ubuntu1~1\.gbp([0-9a-f]{6})\)\sUNRELEASED;\surgency=%s' % default_urgency
 new_version_0_9 = '0.9-1ubuntu1'
-- 
2.29.2

From 971b0a622dcd1bc5ca5f3b4cd97470ff7799c0bc Mon Sep 17 00:00:00 2001
From: nicoo 
Date: Sun, 20 Dec 2020 23:43:27 +0100
Subject: [PATCH 2/2] doctests/test_Changelog: Don't expect /etc/lsb-release

See #976914
---
 tests/doctests/test_Changelog.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/doctests/test_Changelog.py b/tests/doctests/test_Changelog.py
index 1fb8a30..a1e4311 100644
--- a/tests/doctests/test_Changelog.py
+++ b/tests/doctests/test_Changelog.py
@@ -262,7 +262,7 @@ def test_add_section():
 >>> import shutil
 >>> import gbp.deb.changelog
 >>> from ..testutils import OsReleaseFile
->>> os_release = OsReleaseFile('/etc/lsb-release')
+>>> os_release = OsReleaseFile()
 >>> olddir = os.path.abspath(os.path.curdir)
 >>> testdir = tempfile.mkdtemp(prefix='gbp-test-changelog-')
 >>> testdebdir = os.path.join(testdir, 'debian')
@@ -309,7 +309,7 @@ def test_add_entry():
 >>> import shutil
 >>> import gbp.deb.changelog
 >>> from ..testutils import OsReleaseFile
->>> os_release = OsReleaseFile('/etc/lsb-release')
+>>> os_release = OsReleaseFile()
 >>> olddir = os.path.abspath(os.path.curdir)
 >>> testdir = tempfile.mkdtemp(prefix='gbp-test-changelog-')
 >>> testdebdir = os.path.join(testdir, 'debian')
-- 
2.29.2



signature.asc
Description: PGP signature


Bug#976914: git-buildpackage: FTBFS on ppc64el (arch:all-only src pkg): AssertionError: GitRepositoryError not raised

2020-12-09 Thread Lucas Nussbaum
Source: git-buildpackage
Version: 0.9.20
Severity: serious
Justification: FTBFS on ppc64el
Tags: bullseye sid ftbfs
Usertags: ftbfs-20201209 ftbfs-bullseye ftbfs-ppc64el

Hi,

During a rebuild of all packages in sid, your package failed to build
on ppc64el. At the same time, it did not fail on amd64.

I'm marking this bug as severity:serious since your package has only
Architecture:all binary packages, and should thus, in theory, build
everywhere. Failure to build on ppc64el might indicate a serious issue
in this package or in another package.

But feel free to downgrade or close if you believe that this is only a
build-time issue. (I would personnally prefer a severity:minor bug just to
track that the package can only be built on specific architectures.)

Relevant part (hopefully):
> make[2]: Entering directory '/<>'
> flake8 
> flake8  examples/gbp-add-patch examples/zeitgeist-git.py
> export GIT_AUTHOR_NAME="Gbp Tests";   \
> export GIT_AUTHOR_EMAIL=te...@example.com;\
> export GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME;   \
> export GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL; \
> PYTHONPATH=.  \
> LC_ALL=C.UTF-8 python3 setup.py nosetests --with-xcoverage
> running nosetests
> running egg_info
> writing gbp.egg-info/PKG-INFO
> writing dependency_links to gbp.egg-info/dependency_links.txt
> writing entry points to gbp.egg-info/entry_points.txt
> writing requirements to gbp.egg-info/requires.txt
> writing top-level names to gbp.egg-info/top_level.txt
> reading manifest file 'gbp.egg-info/SOURCES.txt'
> writing manifest file 'gbp.egg-info/SOURCES.txt'
> Coverage.py warning: --include is ignored because --source is set 
> (include-ignored)
> Doctest: gbp.command_wrappers.Command.__call__ ... ok
> Doctest: gbp.command_wrappers.Command._f ... ok
> Doctest: gbp.command_wrappers.Command.call ... ok
> Doctest: gbp.config.GbpOptionParser._listify ... ok
> Doctest: gbp.config.GbpOptionParser._name_to_filename ... ok
> Doctest: gbp.config.GbpOptionParser.get_config_files ... ok
> Doctest: gbp.deb.format.DebianSourceFormat ... ok
> Doctest: gbp.deb.format.DebianSourceFormat.parse_file ... ok
> Doctest: gbp.deb.git.DebianGitRepository._build_legacy_tag ... ok
> Doctest: gbp.deb.git.DebianGitRepository._mangle_version ... ok
> Doctest: gbp.deb.git.DebianGitRepository._sanitize_version ... ok
> Doctest: gbp.deb.git.DebianGitRepository._unsanitize_version ... ok
> Doctest: gbp.deb.git.DebianGitRepository.tag_to_version ... ok
> Doctest: gbp.deb.git.DebianGitRepository.version_to_tag ... ok
> Doctest: gbp.deb.policy.DebianPkgPolicy ... ok
> Doctest: gbp.deb.policy.DebianPkgPolicy.build_tarball_name ... ok
> Doctest: gbp.deb.uscan.Uscan._parse ... ok
> Doctest: gbp.deb.uscan.Uscan._parse_uptodate ... ok
> Doctest: gbp.deb.uscan.Uscan._raise_error ... ok
> Doctest: gbp.format.format_b ... ok
> Doctest: gbp.format.format_str ... ok
> Doctest: gbp.git.args.GitArgs ... ok
> Doctest: gbp.git.commit.GitCommit.is_sha1 ... ok
> Doctest: gbp.git.modifier.GitModifier.get_author_env ... ok
> Doctest: gbp.git.modifier.GitModifier.get_committer_env ... ok
> Doctest: gbp.git.repository.GitRepository.strip_sha1 ... ok
> Doctest: gbp.git.rfc822_date_to_git ... ok
> Doctest: gbp.patch_series.Patch._get_subject_from_filename ... ok
> Doctest: gbp.patch_series.PatchSeries._get_topic ... ok
> Doctest: gbp.patch_series.PatchSeries._parse_line ... ok
> Doctest: gbp.patch_series.PatchSeries._read_series ... ok
> Doctest: gbp.patch_series.PatchSeries._split_strip ... ok
> Doctest: gbp.patch_series.PatchSeries._strip_comment ... ok
> Doctest: gbp.pkg.archive.Archive.parse_filename ... ok
> Doctest: gbp.pkg.compressor.Compressor.__repr__ ... ok
> Doctest: gbp.pkg.compressor.Compressor.cmdline ... ok
> Doctest: gbp.pkg.git.PkgGitRepository.sanitize_prefix ... ok
> Doctest: gbp.pkg.pkgpolicy.PkgPolicy.guess_upstream_src_version ... ok
> Doctest: gbp.pkg.pkgpolicy.PkgPolicy.is_valid_packagename ... ok
> Doctest: gbp.pkg.pkgpolicy.PkgPolicy.is_valid_upstreamversion ... ok
> Doctest: gbp.pkg.pkgpolicy.PkgPolicy.version_subst ... ok
> Doctest: gbp.rpm.git.RpmGitRepository._sanitize_tag ... ok
> Doctest: gbp.rpm.git.RpmGitRepository.version_to_tag ... ok
> Doctest: gbp.rpm.linkedlist.LinkedList.append ... ok
> Doctest: gbp.rpm.linkedlist.LinkedList.delete ... ok
> Doctest: gbp.rpm.linkedlist.LinkedList.insert_after ... ok
> Doctest: gbp.rpm.linkedlist.LinkedList.insert_before ... ok
> Doctest: gbp.rpm.linkedlist.LinkedList.prepend ... ok
> Doctest: gbp.rpm.linkedlist.LinkedListNode.set_data ... ok
> Doctest: gbp.rpm.policy.RpmPkgPolicy.is_valid_orig_archive ... ok
> Doctest: gbp.rpm.compose_version_str ... ok
> Doctest: gbp.rpm.filter_version ... ok
> Doctest: gbp.rpm.split_version_str ... ok
> Doctest: gbp.rpm.string_to_int ... ok
> Doctest: gbp.scripts.buildpackage.changes_file_suffix ... ok
> Doctest: gbp.scripts.clone.repo_to_url ... ok
> Doctest: gbp.scripts.common.pq.is_pq_branch ... ok
> Doctest: