Patches for aports can be sent to this list

3 2

[alpine-aports] [PATCH 1/2] testing/samurai: remove check()

Michael Forney
Details
Message ID
<20190318070509.21398-1-mforney@mforney.org>
Sender timestamp
1552892708
DKIM signature
missing
Download raw message
Patch: +2 -7
There is no provided test suite. The `build.ninja` is meant to be an
alternative build mechanism and requires modification to set desired
compile and link flags.

So, running `./samu` in check() will rebuild itself before packaging,
but without the CFLAGS and LDFLAGS set by abuild, resulting in an
unoptimized binary.
---
 testing/samurai/APKBUILD | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/testing/samurai/APKBUILD b/testing/samurai/APKBUILD
index fa51ea9a6d..befb1c1772 100644
--- a/testing/samurai/APKBUILD
+++ b/testing/samurai/APKBUILD
@@ -2,11 +2,12 @@
 # Maintainer: Drew DeVault <sir@cmpwn.com>
 pkgname=samurai
 pkgver=0.6
-pkgrel=0
+pkgrel=1
 pkgdesc="ninja-compatible build tool written in C"
 url="https://github.com/michaelforney/samurai"
 arch="all"
 license="Apache-2.0"
+options="!check"  # No test suite.
 subpackages="$pkgname-doc"
 source="$pkgname-$pkgver.tar.gz::https://github.com/michaelforney/$pkgname/archive/$pkgver.tar.gz"
 builddir="$srcdir/$pkgname-$pkgver"
@@ -16,12 +17,6 @@ build() {
 	make
 }
 
-check() {
-	cd "$builddir"
-	rm *.o
-	./samu
-}
-
 package() {
 	cd "$builddir"
 	make install PREFIX="/usr" DESTDIR="$pkgdir"
-- 
2.19.1



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---

[alpine-aports] [PATCH 2/2] testing/samurai: use upstream provided source archive

Michael Forney
Details
Message ID
<20190318070509.21398-2-mforney@mforney.org>
In-Reply-To
<20190318070509.21398-1-mforney@mforney.org> (view parent)
Sender timestamp
1552892709
DKIM signature
missing
Download raw message
Patch: +2 -2
The GitHub tag archives are not necessarily stable, so the upstream
provided one should be preferred.
---
 testing/samurai/APKBUILD | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/testing/samurai/APKBUILD b/testing/samurai/APKBUILD
index befb1c1772..51a9a3239f 100644
--- a/testing/samurai/APKBUILD
+++ b/testing/samurai/APKBUILD
@@ -2,14 +2,14 @@
 # Maintainer: Drew DeVault <sir@cmpwn.com>
 pkgname=samurai
 pkgver=0.6
-pkgrel=1
+pkgrel=2
 pkgdesc="ninja-compatible build tool written in C"
 url="https://github.com/michaelforney/samurai"
 arch="all"
 license="Apache-2.0"
 options="!check"  # No test suite.
 subpackages="$pkgname-doc"
-source="$pkgname-$pkgver.tar.gz::https://github.com/michaelforney/$pkgname/archive/$pkgver.tar.gz"
+source="https://github.com/michaelforney/$pkgname/releases/download/$pkgver/$pkgname-$pkgver.tar.gz"
 builddir="$srcdir/$pkgname-$pkgver"
 
 build() {
-- 
2.19.1



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---

[alpine-aports] Re: [PATCH 1/2] testing/samurai: remove check()

Michael Forney
Details
Message ID
<CAGw6cBuGHiehw-AChxMiSNAUe50REN5HBLb74LHGsT7-LUFekA@mail.gmail.com>
In-Reply-To
<20190325015701.GF1173@homura.localdomain> (view parent)
Sender timestamp
1553482836
DKIM signature
missing
Download raw message
On 2019-03-24, Drew DeVault <sir@cmpwn.com> wrote:
> Sorry I missed this - can you Cc me on future patches?

Sure.

>> There is no provided test suite. The `build.ninja` is meant to be an
>> alternative build mechanism and requires modification to set desired
>> compile and link flags.
>>
>> So, running `./samu` in check() will rebuild itself before packaging,
>> but without the CFLAGS and LDFLAGS set by abuild, resulting in an
>> unoptimized binary.
>
> Hm, I understand the problem, but having samu build itself seems like a
> pretty good test. I'd rather fix the CFLAGS/LDFLAGS than nix the check()
> entirely. Testing a full gcc bootstrap involves a similar process.
>
> Thoughts?

I think it's fine to build itself as a test, but I think that the
binary that gets installed should be the one produced in build(). I
don't know much about the Alpine build system, but I assume check()
does not get run for cross builds, and I think it would be bad to
build the binary two different ways depending on whether we were able
to run check().

So, maybe you could just rename the binary at the end of build(), and
install that version in package()? Or, extract the sources again
somewhere else and run `./samu -C $checkdir`.


---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---

[alpine-aports] Re: [PATCH 1/2] testing/samurai: remove check()

Details
Message ID
<20190325015701.GF1173@homura.localdomain>
In-Reply-To
<20190318070509.21398-1-mforney@mforney.org> (view parent)
Sender timestamp
1553479021
DKIM signature
missing
Download raw message
Sorry I missed this - can you Cc me on future patches?

+1 on patch 2/2

> There is no provided test suite. The `build.ninja` is meant to be an
> alternative build mechanism and requires modification to set desired
> compile and link flags.
> 
> So, running `./samu` in check() will rebuild itself before packaging,
> but without the CFLAGS and LDFLAGS set by abuild, resulting in an
> unoptimized binary.

Hm, I understand the problem, but having samu build itself seems like a
pretty good test. I'd rather fix the CFLAGS/LDFLAGS than nix the check()
entirely. Testing a full gcc bootstrap involves a similar process.

Thoughts?


---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---