From d217e893dbc7f2a2232b74d85d9f7266e61d0b6d Mon Sep 17 00:00:00 2001 From: Oleg Zaytsev Date: Thu, 4 Jul 2024 09:46:57 +0200 Subject: [PATCH] Extract simd source to a submodule Avo documentation requires version to be pinned in order to be used in production, however there was no reference to avo in the modules here, so it's not possible to reproduce the build. This extracts avo source to a submodule, in order to prevent it from being downloaded as a transitive dependency when dolthub/swiss is required, and adds a go:generate directive to simplify the build process. Signed-off-by: Oleg Zaytsev --- simd/match.s | 2 +- simd/match_amd64.go | 2 +- simd/{ => src}/asm.go | 4 +--- simd/src/go.mod | 10 ++++++++++ simd/src/go.sum | 8 ++++++++ 5 files changed, 21 insertions(+), 5 deletions(-) rename simd/{ => src}/asm.go (93%) create mode 100644 simd/src/go.mod create mode 100644 simd/src/go.sum diff --git a/simd/match.s b/simd/match.s index 4ae29e7..0e95b87 100644 --- a/simd/match.s +++ b/simd/match.s @@ -1,4 +1,4 @@ -// Code generated by command: go run asm.go -out match.s -stubs match_amd64.go. DO NOT EDIT. +// Code generated by command: go run asm.go -pkg simd -out ../match.s -stubs ../match_amd64.go. DO NOT EDIT. //go:build amd64 diff --git a/simd/match_amd64.go b/simd/match_amd64.go index 538c8e1..6667d93 100644 --- a/simd/match_amd64.go +++ b/simd/match_amd64.go @@ -1,4 +1,4 @@ -// Code generated by command: go run asm.go -out match.s -stubs match_amd64.go. DO NOT EDIT. +// Code generated by command: go run asm.go -pkg simd -out ../match.s -stubs ../match_amd64.go. DO NOT EDIT. //go:build amd64 diff --git a/simd/asm.go b/simd/src/asm.go similarity index 93% rename from simd/asm.go rename to simd/src/asm.go index 6e775ee..784b184 100644 --- a/simd/asm.go +++ b/simd/src/asm.go @@ -1,3 +1,4 @@ +//go:generate go run asm.go -pkg simd -out ../match.s -stubs ../match_amd64.go // Copyright 2023 Dolthub, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,9 +13,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build ignore -// +build ignore - package main import ( diff --git a/simd/src/go.mod b/simd/src/go.mod new file mode 100644 index 0000000..2b58947 --- /dev/null +++ b/simd/src/go.mod @@ -0,0 +1,10 @@ +module github.com/dolthub/swiss/simd/src + +go 1.22.4 + +require github.com/mmcloughlin/avo v0.6.0 + +require ( + golang.org/x/mod v0.14.0 // indirect + golang.org/x/tools v0.16.1 // indirect +) diff --git a/simd/src/go.sum b/simd/src/go.sum new file mode 100644 index 0000000..483bba8 --- /dev/null +++ b/simd/src/go.sum @@ -0,0 +1,8 @@ +github.com/mmcloughlin/avo v0.6.0 h1:QH6FU8SKoTLaVs80GA8TJuLNkUYl4VokHKlPhVDg4YY= +github.com/mmcloughlin/avo v0.6.0/go.mod h1:8CoAGaCSYXtCPR+8y18Y9aB/kxb8JSS6FRI7mSkvD+8= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= +golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0=