summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO10
-rw-r--r--PKGBUILD37
-rw-r--r--golang-crypto.patch131
3 files changed, 164 insertions, 14 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 032a312e7823..6b7c06b514e5 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,6 @@
-# Generated by mksrcinfo v8
-# Sun Sep 16 21:29:07 UTC 2018
pkgbase = nomad
pkgdesc = A Distributed, Highly Available, Datacenter-Aware Scheduler
- pkgver = 0.8.5
+ pkgver = 0.8.6
pkgrel = 1
url = https://www.nomadproject.io/
arch = i686
@@ -17,18 +15,20 @@ pkgbase = nomad
optdepends = java-runtime-headless
backup = etc/nomad/server.conf
backup = etc/nomad/client.conf
- source = https://github.com/hashicorp/nomad/archive/v0.8.5/nomad-0.8.5.tar.gz
+ source = https://github.com/hashicorp/nomad/archive/v0.8.6/nomad-0.8.6.tar.gz
source = nomad-server.service
source = nomad-server.conf
source = nomad-client.service
source = nomad-client.conf
source = lxc-version-check.patch
- sha256sums = 94000da809fd077066c2348591db9ef2f71d070f4e1cb0f8fb4440644dec8d55
+ source = golang-crypto.patch
+ sha256sums = e69b447dcc2caeb3d5ecf904cf3c8f327a5185a84442ee4241a796d89f96e143
sha256sums = 52b0a22c3c0c72c642a8728cb48bd8797f4f6a12990e11bbb2342edcc2a9a206
sha256sums = da475bc4aa3b1493eb62f09e7f99dcc171e8ce6d74df3da30514cfdfe72a5714
sha256sums = 4c8fb7c18c67ca20e3ee07f25cf2f0c82b66c4c173275ae8d643c91cce3c0ceb
sha256sums = ba80943ac42e617627c7e14be402078199ddba8d7e4276d67f0c9f6e6842d4a8
sha256sums = 740cf838f4489b00fab8329c81ba21b1fae02e584d8fac2b5f88eeec76e4e62f
+ sha256sums = 75583a195b43d7345449bbac60359bf54661ccbd699386a6e59bb483c6054338
pkgname = nomad
diff --git a/PKGBUILD b/PKGBUILD
index 36b30b178438..30d9f75373b6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
pkgname=nomad
-pkgver=0.8.5
+pkgver=0.8.6
pkgrel=1
pkgdesc="A Distributed, Highly Available, Datacenter-Aware Scheduler"
arch=('i686' 'x86_64')
@@ -17,22 +17,43 @@ optdepends=(
backup=(etc/nomad/{server,client}.conf)
source=(https://github.com/hashicorp/nomad/archive/v$pkgver/$pkgname-$pkgver.tar.gz
nomad-{server,client}.{service,conf}
- lxc-version-check.patch)
-sha256sums=('94000da809fd077066c2348591db9ef2f71d070f4e1cb0f8fb4440644dec8d55'
+ lxc-version-check.patch
+ golang-crypto.patch)
+sha256sums=('e69b447dcc2caeb3d5ecf904cf3c8f327a5185a84442ee4241a796d89f96e143'
'52b0a22c3c0c72c642a8728cb48bd8797f4f6a12990e11bbb2342edcc2a9a206'
'da475bc4aa3b1493eb62f09e7f99dcc171e8ce6d74df3da30514cfdfe72a5714'
'4c8fb7c18c67ca20e3ee07f25cf2f0c82b66c4c173275ae8d643c91cce3c0ceb'
'ba80943ac42e617627c7e14be402078199ddba8d7e4276d67f0c9f6e6842d4a8'
- '740cf838f4489b00fab8329c81ba21b1fae02e584d8fac2b5f88eeec76e4e62f')
+ '740cf838f4489b00fab8329c81ba21b1fae02e584d8fac2b5f88eeec76e4e62f'
+ '75583a195b43d7345449bbac60359bf54661ccbd699386a6e59bb483c6054338')
prepare() {
mkdir -p src/github.com/hashicorp
cd src/github.com/hashicorp
rm -rf nomad
mv ../../../$pkgname-$pkgver nomad
+ cd nomad
- cd nomad/vendor/gopkg.in/lxc/go-lxc.v2
+ export GOPATH="$srcdir"
+ export PATH="$GOPATH/bin:$PATH"
+
+ if [ $CARCH == "x86_64" ]; then
+ export GOARCH=amd64
+ else
+ export GOARCH=386
+ fi
+
+ go get golang.org/x/sys/cpu
+
+ make bootstrap
+ mkdir -p bin
+
+ pushd vendor/gopkg.in/lxc/go-lxc.v2
patch -p1 -i "$srcdir"/lxc-version-check.patch
+ popd
+
+ pushd vendor/golang.org/x/crypto
+ patch -p1 -i "$srcdir"/golang-crypto.patch
}
build() {
@@ -43,14 +64,12 @@ build() {
if [ $CARCH == "x86_64" ]; then
export GOARCH=amd64
else
- export GPARCH=386
+ export GOARCH=386
fi
- make bootstrap
- mkdir -p bin
CGO_ENABLED=1 \
go build -ldflags '-X main.GitCommit=""' \
- -tags lxc \
+ -tags "ui lxc" \
-o bin/nomad
}
diff --git a/golang-crypto.patch b/golang-crypto.patch
new file mode 100644
index 000000000000..89adda4d81b2
--- /dev/null
+++ b/golang-crypto.patch
@@ -0,0 +1,131 @@
+From ae8bce0030810cf999bb2b9868ae5c7c58e6343b Mon Sep 17 00:00:00 2001
+From: Andreas Auernhammer <aead@mail.de>
+Date: Mon, 30 Apr 2018 19:54:52 +0200
+Subject: [PATCH] crypto/{blake2b,blake2s,argon2,chacha20poly1305}: replace CPU
+ feature detection
+
+This change removes package specific CPU-feature detection code and
+replaces it with x/sys/cpu.
+
+Fixes golang/go#24843
+
+Change-Id: I150dd7b3aeb8eef428c91f9b1df741ceb8a87a24
+Reviewed-on: https://go-review.googlesource.com/110355
+Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
+TryBot-Result: Gobot Gobot <gobot@golang.org>
+Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
+---
+ blake2b/blake2bAVX2_amd64.go | 26 ++++-----
+ blake2b/blake2bAVX2_amd64.s | 12 -----
+ blake2b/blake2b_amd64.go | 7 ++-
+ blake2b/blake2b_amd64.s | 9 ----
+ 11 files changed, 41 insertions(+), 182 deletions(-)
+
+diff --git a/blake2b/blake2bAVX2_amd64.go b/blake2b/blake2bAVX2_amd64.go
+index 8c41cf6c7..4d31dd0fd 100644
+--- a/blake2b/blake2bAVX2_amd64.go
++++ b/blake2b/blake2bAVX2_amd64.go
+@@ -6,21 +6,14 @@
+
+ package blake2b
+
++import "golang.org/x/sys/cpu"
++
+ func init() {
+- useAVX2 = supportsAVX2()
+- useAVX = supportsAVX()
+- useSSE4 = supportsSSE4()
++ useAVX2 = cpu.X86.HasAVX2
++ useAVX = cpu.X86.HasAVX
++ useSSE4 = cpu.X86.HasSSE41
+ }
+
+-//go:noescape
+-func supportsSSE4() bool
+-
+-//go:noescape
+-func supportsAVX() bool
+-
+-//go:noescape
+-func supportsAVX2() bool
+-
+ //go:noescape
+ func hashBlocksAVX2(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte)
+
+@@ -31,13 +24,14 @@ func hashBlocksAVX(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte)
+ func hashBlocksSSE4(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte)
+
+ func hashBlocks(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) {
+- if useAVX2 {
++ switch {
++ case useAVX2:
+ hashBlocksAVX2(h, c, flag, blocks)
+- } else if useAVX {
++ case useAVX:
+ hashBlocksAVX(h, c, flag, blocks)
+- } else if useSSE4 {
++ case useSSE4:
+ hashBlocksSSE4(h, c, flag, blocks)
+- } else {
++ default:
+ hashBlocksGeneric(h, c, flag, blocks)
+ }
+ }
+diff --git a/blake2b/blake2bAVX2_amd64.s b/blake2b/blake2bAVX2_amd64.s
+index 784bce6a9..5593b1b3d 100644
+--- a/blake2b/blake2bAVX2_amd64.s
++++ b/blake2b/blake2bAVX2_amd64.s
+@@ -748,15 +748,3 @@ noinc:
+
+ MOVQ BP, SP
+ RET
+-
+-// func supportsAVX2() bool
+-TEXT ·supportsAVX2(SB), 4, $0-1
+- MOVQ runtime·support_avx2(SB), AX
+- MOVB AX, ret+0(FP)
+- RET
+-
+-// func supportsAVX() bool
+-TEXT ·supportsAVX(SB), 4, $0-1
+- MOVQ runtime·support_avx(SB), AX
+- MOVB AX, ret+0(FP)
+- RET
+diff --git a/blake2b/blake2b_amd64.go b/blake2b/blake2b_amd64.go
+index 2ab7c30fc..30e2fcd58 100644
+--- a/blake2b/blake2b_amd64.go
++++ b/blake2b/blake2b_amd64.go
+@@ -6,13 +6,12 @@
+
+ package blake2b
+
++import "golang.org/x/sys/cpu"
++
+ func init() {
+- useSSE4 = supportsSSE4()
++ useSSE4 = cpu.X86.HasSSE41
+ }
+
+-//go:noescape
+-func supportsSSE4() bool
+-
+ //go:noescape
+ func hashBlocksSSE4(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte)
+
+diff --git a/blake2b/blake2b_amd64.s b/blake2b/blake2b_amd64.s
+index 64530740b..578e947b3 100644
+--- a/blake2b/blake2b_amd64.s
++++ b/blake2b/blake2b_amd64.s
+@@ -279,12 +279,3 @@ noinc:
+
+ MOVQ BP, SP
+ RET
+-
+-// func supportsSSE4() bool
+-TEXT ·supportsSSE4(SB), 4, $0-1
+- MOVL $1, AX
+- CPUID
+- SHRL $19, CX // Bit 19 indicates SSE4 support
+- ANDL $1, CX // CX != 0 if support SSE4
+- MOVB CX, ret+0(FP)
+- RET