From a7f8ca53db94bdf57ce9307eedd08bcef5dc07a3 Mon Sep 17 00:00:00 2001 From: error2215 Date: Tue, 6 Jun 2023 12:37:45 +0300 Subject: [PATCH] Use ed448 gocore library instead of go-golidlocks on mobile devices +version typo fix (#451) * Use ed448 gocore library instead of go-golidlocks on mobile devices + version typo fix (#450) * new build constraints * fix version typo * Fixed CI CD build (#452) --- crypto/crypto_cgo.go | 2 +- crypto/crypto_nocgo.go | 3 +-- crypto/signature_cgo.go | 2 +- crypto/signature_nocgo.go | 3 +-- internal/build/env.go | 5 +++-- node/config.go | 2 +- p2p/peer.go | 4 ++-- 7 files changed, 10 insertions(+), 11 deletions(-) diff --git a/crypto/crypto_cgo.go b/crypto/crypto_cgo.go index f70390df2..8da0f87ea 100644 --- a/crypto/crypto_cgo.go +++ b/crypto/crypto_cgo.go @@ -14,7 +14,7 @@ // You should have received a copy of the GNU Lesser General Public License // along with the go-core library. If not, see . -//go:build !nacl && !js && cgo +//go:build !nacl && !js && cgo && !android && !ios && !mobile package crypto diff --git a/crypto/crypto_nocgo.go b/crypto/crypto_nocgo.go index 1256913ea..22088b828 100644 --- a/crypto/crypto_nocgo.go +++ b/crypto/crypto_nocgo.go @@ -14,8 +14,7 @@ // You should have received a copy of the GNU Lesser General Public License // along with the go-core library. If not, see . -//go:build nacl || js || !cgo -// +build nacl js !cgo +//go:build nacl || js || !cgo || android || ios || mobile package crypto diff --git a/crypto/signature_cgo.go b/crypto/signature_cgo.go index c58140b98..9cb8439f6 100644 --- a/crypto/signature_cgo.go +++ b/crypto/signature_cgo.go @@ -14,7 +14,7 @@ // You should have received a copy of the GNU Lesser General Public License // along with the go-core library. If not, see . -//go:build !nacl && !js && cgo +//go:build !nacl && !js && cgo && !android && !ios && !mobile package crypto diff --git a/crypto/signature_nocgo.go b/crypto/signature_nocgo.go index 648aa394d..ada3ace7b 100644 --- a/crypto/signature_nocgo.go +++ b/crypto/signature_nocgo.go @@ -14,8 +14,7 @@ // You should have received a copy of the GNU Lesser General Public License // along with the go-core library. If not, see . -//go:build nacl || js || !cgo -// +build nacl js !cgo +//go:build nacl || js || !cgo || android || ios || mobile package crypto diff --git a/internal/build/env.go b/internal/build/env.go index 3777bdd5d..003a79967 100644 --- a/internal/build/env.go +++ b/internal/build/env.go @@ -89,20 +89,21 @@ func LocalEnv() Environment { if commit := commitRe.FindString(head); commit != "" && env.Commit == "" { env.Commit = commit } - return env } if env.Commit == "" { env.Commit = readGitFile(head) } env.Date = getDate(env.Commit) + if env.Branch == "" { if head != "HEAD" { env.Branch = strings.TrimPrefix(head, "refs/heads/") } } if info, err := os.Stat(".git/objects"); err == nil && info.IsDir() && env.Tag == "" { - env.Tag = firstLine(RunGit("describe", "--tags", "--abbrev=0")) + env.Tag = firstLine(RunGit("tag", "-l", "--points-at", "HEAD")) } + return env } diff --git a/node/config.go b/node/config.go index 6e84d7ca4..a5fda8f87 100644 --- a/node/config.go +++ b/node/config.go @@ -277,7 +277,7 @@ func (c *Config) NodeName() string { name += "/" + c.UserIdent } if c.Version != "" { - name += "/v" + c.Version + name += "/" + c.Version } name += "/" + runtime.GOOS + "-" + runtime.GOARCH name += "/" + runtime.Version() diff --git a/p2p/peer.go b/p2p/peer.go index 8b4491cdb..0b7818ffa 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -141,8 +141,8 @@ func (p *Peer) Node() *enode.Node { // Name returns an abbreviated form of the name func (p *Peer) Name() string { s := p.rw.name - if len(s) > 20 { - return s[:20] + "..." + if len(s) > 50 { + return s[:50] + "..." } return s }