public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Fix gbp patching after configuration change
@ 2021-09-11 17:51 Uladzimir Bely
  2021-09-11 17:51 ` [PATCH v2 1/3] meta-isar: reformat isar.patch for cowsay to properly work with git Uladzimir Bely
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Uladzimir Bely @ 2021-09-11 17:51 UTC (permalink / raw)
  To: isar-users

Changes since v1:
 - rebased on latest `next`
 - changed dat from RFC to PATCH

Attempt to rebuild ISAR after some changes in local.conf was leading
to failure on `cowsay` package because of an attempt to apply
custom patch while it was already applied at first build.

The problem was in isar.patch format - it used `git` as PATCHTOOL
but was not in format compatible with `git am`. So the fallback way
of patching was used.

The series fixes isar.patch format, adds CI test for this condition
and adds an appropriate section to the documentation

Uladzimir Bely (3):
  meta-isar: reformat isar.patch for cowsay to properly work with git
  ci: Test for rebuild with no cleanup after configuration change
  doc: Add a section on gbp-compatible packages

 doc/user_manual.md                            | 15 +++++++++
 meta-isar/recipes-app/cowsay/files/isar.patch | 32 +++++++++++++++----
 scripts/ci_build.sh                           | 11 ++++---
 3 files changed, 47 insertions(+), 11 deletions(-)

-- 
2.20.1


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

* [PATCH v2 1/3] meta-isar: reformat isar.patch for cowsay to properly work with git
  2021-09-11 17:51 [PATCH v2 0/3] Fix gbp patching after configuration change Uladzimir Bely
@ 2021-09-11 17:51 ` Uladzimir Bely
  2021-09-11 17:51 ` [PATCH v2 2/3] ci: Test for rebuild with no cleanup after configuration change Uladzimir Bely
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Uladzimir Bely @ 2021-09-11 17:51 UTC (permalink / raw)
  To: isar-users

When PATCHTOOL is set to git, GitApplyTree class in oe/patch.py
can't properly handle non-git patches and fallbacks to PatchTree
class.

This makes impossible to reapply the same patch if it was already
done during previous build, with `Patch format detection failed`

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 meta-isar/recipes-app/cowsay/files/isar.patch | 32 +++++++++++++++----
 1 file changed, 25 insertions(+), 7 deletions(-)

diff --git a/meta-isar/recipes-app/cowsay/files/isar.patch b/meta-isar/recipes-app/cowsay/files/isar.patch
index 4333d4d..529a93c 100644
--- a/meta-isar/recipes-app/cowsay/files/isar.patch
+++ b/meta-isar/recipes-app/cowsay/files/isar.patch
@@ -1,6 +1,20 @@
-diff -Nru git.old/debian/patches/isar.patch git/debian/patches/isar.patch
---- git.old/debian/patches/isar.patch	1970-01-01 01:00:00.000000000 +0100
-+++ git/debian/patches/isar.patch	2021-01-21 14:21:26.439040449 +0100
+From 8b7944ca60d4bba3644463d39c865de71e9eba05 Mon Sep 17 00:00:00 2001
+From: Henning Schild <henning.schild@siemens.com>
+Date: Fri, 22 Jan 2021 09:42:40 +0100
+Subject: [PATCH] %% original patch: isar.patch
+
+%% original patch: isar.patch
+---
+ debian/patches/isar.patch | 12 ++++++++++++
+ debian/patches/series     |  1 +
+ 2 files changed, 13 insertions(+)
+ create mode 100644 debian/patches/isar.patch
+
+diff --git a/debian/patches/isar.patch b/debian/patches/isar.patch
+new file mode 100644
+index 0000000..00dae53
+--- /dev/null
++++ b/debian/patches/isar.patch
 @@ -0,0 +1,12 @@
 +Index: git/cows/elephant.cow
 +===================================================================
@@ -14,11 +28,15 @@ diff -Nru git.old/debian/patches/isar.patch git/debian/patches/isar.patch
 + $the_cow = <<EOC;
 +  $thoughts     /\\  ___  /\\
 +   $thoughts   // \\/   \\/ \\\\
-diff -Nru git.old/debian/patches/series git/debian/patches/series
---- git.old/debian/patches/series	2021-01-21 14:20:59.404038258 +0100
-+++ git/debian/patches/series	2021-01-21 14:21:26.440040449 +0100
-@@ -18,3 +18,4 @@
+diff --git a/debian/patches/series b/debian/patches/series
+index 0206ace..dfa29f9 100644
+--- a/debian/patches/series
++++ b/debian/patches/series
+@@ -18,3 +18,4 @@ suse_cow
  utf8_width
  moofasa-tabs
  03-ansi_code_width_color_widechar.patch
 +isar.patch
+-- 
+2.31.1
+
-- 
2.20.1


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

* [PATCH v2 2/3] ci: Test for rebuild with no cleanup after configuration change
  2021-09-11 17:51 [PATCH v2 0/3] Fix gbp patching after configuration change Uladzimir Bely
  2021-09-11 17:51 ` [PATCH v2 1/3] meta-isar: reformat isar.patch for cowsay to properly work with git Uladzimir Bely
@ 2021-09-11 17:51 ` Uladzimir Bely
  2021-09-11 17:51 ` [PATCH v2 3/3] doc: Add a section on gbp-compatible packages Uladzimir Bely
  2021-09-17  8:51 ` [PATCH v2 0/3] Fix gbp patching after configuration change Anton Mikanovich
  3 siblings, 0 replies; 5+ messages in thread
From: Uladzimir Bely @ 2021-09-11 17:51 UTC (permalink / raw)
  To: isar-users

This patch checks case when some packages are rebuilt after
some global vars in local.conf is changed, but build/tmp is
not cleaned.

The test allows to find such problems as wrong adjust_git
behfviour or attempts to apply patch when it was applied
at previous build

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 scripts/ci_build.sh | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh
index 837cd67..a63b078 100755
--- a/scripts/ci_build.sh
+++ b/scripts/ci_build.sh
@@ -194,19 +194,22 @@ if [ -n "$REPRO_BUILD" ]; then
     sed -i -e 's/ISAR_USE_CACHED_BASE_REPO ?= "1"/#ISAR_USE_CACHED_BASE_REPO ?= "1"/g' conf/local.conf
     sed -i -e 's/^BB_NO_NETWORK/#BB_NO_NETWORK/g' conf/local.conf
     sed -i -e 's/^BASE_REPO_KEY/#BASE_REPO_KEY/g' conf/local.conf
-
-    # Enable use of unsigned cached base repository
     bitbake $BB_ARGS $REPRO_TARGETS_SET
     while [ -e bitbake.sock ]; do sleep 1; done
+    # Enable use of unsigned cached base repository
     sudo rm -rf tmp
     sed -i -e 's/#ISAR_USE_CACHED_BASE_REPO ?= "1"/ISAR_USE_CACHED_BASE_REPO ?= "1"/g' conf/local.conf
     sed -i -e 's/^#BB_NO_NETWORK/BB_NO_NETWORK/g' conf/local.conf
     bitbake $BB_ARGS $REPRO_TARGETS_SET
     while [ -e bitbake.sock ]; do sleep 1; done
-    # Cleanup and disable use of unsigned cached base repository
-    sudo rm -rf tmp
+    # Disable use of unsigned cached base repository
     sed -i -e 's/ISAR_USE_CACHED_BASE_REPO ?= "1"/#ISAR_USE_CACHED_BASE_REPO ?= "1"/g' conf/local.conf
     sed -i -e 's/^BB_NO_NETWORK/#BB_NO_NETWORK/g' conf/local.conf
+    # Try to build with changed configuration with no cleanup
+    bitbake $BB_ARGS $REPRO_TARGETS_SET
+    while [ -e bitbake.sock ]; do sleep 1; done
+    # Cleanup
+    sudo rm -rf tmp
 fi
 
 sed -i -e 's/^#BASE_REPO_FEATURES ?= "cache-deb-src"/BASE_REPO_FEATURES ?= "cache-deb-src"/g' conf/local.conf
-- 
2.20.1


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

* [PATCH v2 3/3] doc: Add a section on gbp-compatible packages
  2021-09-11 17:51 [PATCH v2 0/3] Fix gbp patching after configuration change Uladzimir Bely
  2021-09-11 17:51 ` [PATCH v2 1/3] meta-isar: reformat isar.patch for cowsay to properly work with git Uladzimir Bely
  2021-09-11 17:51 ` [PATCH v2 2/3] ci: Test for rebuild with no cleanup after configuration change Uladzimir Bely
@ 2021-09-11 17:51 ` Uladzimir Bely
  2021-09-17  8:51 ` [PATCH v2 0/3] Fix gbp patching after configuration change Anton Mikanovich
  3 siblings, 0 replies; 5+ messages in thread
From: Uladzimir Bely @ 2021-09-11 17:51 UTC (permalink / raw)
  To: isar-users

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 doc/user_manual.md | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/doc/user_manual.md b/doc/user_manual.md
index 1da0e9d..c58d8c8 100644
--- a/doc/user_manual.md
+++ b/doc/user_manual.md
@@ -786,6 +786,21 @@ This approach prevents duplication of the license files in different packages.
 
 The last line in the example above adds recipe to the Isar work chain.
 
+### Compilation of sources from gbp-compatible repository
+
+gbp or git-buildpackage is a utility that supports maintaining a Debian/Ubuntu package in git. Such kind of repositories can be found on salsa. They might be useful for building unreleased or older packages and patching them. The bbclass for this approach is called `dpkg-gbp`.
+
+#### Example
+```
+inherit dpkg-gbp
+
+SRC_URI = "git://salsa.debian.org/debian/cowsay.git;protocol=https"
+SRC_URI += "file://isar.patch"
+SRCREV = "756f0c41fbf582093c0c1dff9ff77734716cb26f"
+```
+
+For these packages `git` is used as a PATCHTOOL. This means that custom patches should be in format that allows to apply them by `git am` command.
+
 ### Compilation of sources missing the debian/-directory
 
 The `debian` directory contains meta information on how to build a package from source. This is roughly speaking "configure", "compile", "install" all described in a Debian-specific way.
-- 
2.20.1


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

* Re: [PATCH v2 0/3] Fix gbp patching after configuration change
  2021-09-11 17:51 [PATCH v2 0/3] Fix gbp patching after configuration change Uladzimir Bely
                   ` (2 preceding siblings ...)
  2021-09-11 17:51 ` [PATCH v2 3/3] doc: Add a section on gbp-compatible packages Uladzimir Bely
@ 2021-09-17  8:51 ` Anton Mikanovich
  3 siblings, 0 replies; 5+ messages in thread
From: Anton Mikanovich @ 2021-09-17  8:51 UTC (permalink / raw)
  To: Uladzimir Bely, isar-users

11.09.2021 20:51, Uladzimir Bely wrote:
> Changes since v1:
>   - rebased on latest `next`
>   - changed dat from RFC to PATCH
>
> Attempt to rebuild ISAR after some changes in local.conf was leading
> to failure on `cowsay` package because of an attempt to apply
> custom patch while it was already applied at first build.
>
> The problem was in isar.patch format - it used `git` as PATCHTOOL
> but was not in format compatible with `git am`. So the fallback way
> of patching was used.
>
> The series fixes isar.patch format, adds CI test for this condition
> and adds an appropriate section to the documentation
>
> Uladzimir Bely (3):
>    meta-isar: reformat isar.patch for cowsay to properly work with git
>    ci: Test for rebuild with no cleanup after configuration change
>    doc: Add a section on gbp-compatible packages
>
>   doc/user_manual.md                            | 15 +++++++++
>   meta-isar/recipes-app/cowsay/files/isar.patch | 32 +++++++++++++++----
>   scripts/ci_build.sh                           | 11 ++++---
>   3 files changed, 47 insertions(+), 11 deletions(-)
>
Applied to next, thanks.

-- 
Anton Mikanovich
Promwad Ltd.
External service provider of ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn, Germany
+49 (89) 122 67 24-0
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov


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

end of thread, other threads:[~2021-09-17  8:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-11 17:51 [PATCH v2 0/3] Fix gbp patching after configuration change Uladzimir Bely
2021-09-11 17:51 ` [PATCH v2 1/3] meta-isar: reformat isar.patch for cowsay to properly work with git Uladzimir Bely
2021-09-11 17:51 ` [PATCH v2 2/3] ci: Test for rebuild with no cleanup after configuration change Uladzimir Bely
2021-09-11 17:51 ` [PATCH v2 3/3] doc: Add a section on gbp-compatible packages Uladzimir Bely
2021-09-17  8:51 ` [PATCH v2 0/3] Fix gbp patching after configuration change Anton Mikanovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox