From 593e65dcfa8f5dd08f9f18e827f146819bf4a0fe Mon Sep 17 00:00:00 2001 From: Michael Dockter Date: Fri, 1 Nov 2024 11:24:00 -0400 Subject: [PATCH] #143 Update template (#171) * #143 Update go version * #143 Add enablement for macOS/Windows * #143 Added CGO_LDFLAGS * #143 Update FROM * #143 Update dependencies * #143 Update docker * #143 Update * #143 Update template * #143 Update dependencies --- .dockerignore | 2 +- .github/workflows/go-test-darwin.yaml | 3 ++- .github/workflows/go-test-windows.yaml | 4 +++- .github/workflows/golangci-lint.yaml | 20 ++++++++++---------- Dockerfile | 4 ++-- go.mod | 10 +++++----- go.sum | 19 ++++++++++--------- makefiles/darwin.mk | 4 ++-- package.Dockerfile | 4 ++-- 9 files changed, 37 insertions(+), 33 deletions(-) diff --git a/.dockerignore b/.dockerignore index 253d5ef..5a6443c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -7,6 +7,6 @@ docs/ CHANGELOG.md CODE_OF_CONDUCT.md CONTRIBUTING.md -docker-compose.test.yml +docker-compose.test.yaml LICENSE README.md diff --git a/.github/workflows/go-test-darwin.yaml b/.github/workflows/go-test-darwin.yaml index d6f58ef..7403b8d 100644 --- a/.github/workflows/go-test-darwin.yaml +++ b/.github/workflows/go-test-darwin.yaml @@ -3,6 +3,7 @@ name: Go test darwin on: [pull_request, workflow_dispatch] env: + CGO_LDFLAGS: "-Wl,-no_warn_duplicate_libraries" DYLD_LIBRARY_PATH: /opt/senzing/er/lib:/opt/senzing/er/lib/macos LD_LIBRARY_PATH: /opt/senzing/er/lib:/opt/senzing/er/lib/macos SENZING_LOG_LEVEL: TRACE @@ -18,7 +19,7 @@ jobs: strategy: matrix: go: ["1.21"] - os: [macos-13] + os: [macos-latest] senzingapi-version: [staging-v4] steps: diff --git a/.github/workflows/go-test-windows.yaml b/.github/workflows/go-test-windows.yaml index d45e1bf..dcef682 100644 --- a/.github/workflows/go-test-windows.yaml +++ b/.github/workflows/go-test-windows.yaml @@ -41,7 +41,9 @@ jobs: senzingapi-version: ${{ matrix.senzingapi-version }} - name: Add to "Path" environment variable - run: printf "C:\Program Files\Senzing\er\lib" | Out-File -FilePath "$env:GITHUB_PATH" -Encoding utf8 -Append + run: | + # shellcheck disable=SC2028 + echo "C:\Program Files\Senzing\er\lib" >> "$env:GITHUB_PATH" - name: Copy /etc files run: copy testdata/senzing-license/g2.lic "C:\Program Files\Senzing\er\etc\g2.lic" diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml index 7caf1dc..0d38b8c 100644 --- a/.github/workflows/golangci-lint.yaml +++ b/.github/workflows/golangci-lint.yaml @@ -30,21 +30,21 @@ jobs: - name: Copy Senzing headers run: | - mkdir --parents ./szconfig/gohelpers + mkdir --parents ./szconfig/szhelpers cp /opt/senzing/er/sdk/c/*.h ./szconfig/ - cp /opt/senzing/er/sdk/c/gohelpers/*.h ./szconfig/gohelpers - mkdir --parents ./szconfigmanager/gohelpers + cp /opt/senzing/er/sdk/c/szhelpers/*.h ./szconfig/szhelpers + mkdir --parents ./szconfigmanager/szhelpers cp /opt/senzing/er/sdk/c/*.h ./szconfigmanager/ - cp /opt/senzing/er/sdk/c/gohelpers/*.h ./szconfigmanager/gohelpers - mkdir --parents ./szdiagnostic/gohelpers + cp /opt/senzing/er/sdk/c/szhelpers/*.h ./szconfigmanager/szhelpers + mkdir --parents ./szdiagnostic/szhelpers cp /opt/senzing/er/sdk/c/*.h ./szdiagnostic/ - cp /opt/senzing/er/sdk/c/gohelpers/*.h ./szdiagnostic/gohelpers - mkdir --parents ./szengine/gohelpers + cp /opt/senzing/er/sdk/c/szhelpers/*.h ./szdiagnostic/szhelpers + mkdir --parents ./szengine/szhelpers cp /opt/senzing/er/sdk/c/*.h ./szengine/ - cp /opt/senzing/er/sdk/c/gohelpers/*.h ./szengine/gohelpers - mkdir --parents ./szproduct/gohelpers + cp /opt/senzing/er/sdk/c/szhelpers/*.h ./szengine/szhelpers + mkdir --parents ./szproduct/szhelpers cp /opt/senzing/er/sdk/c/*.h ./szproduct/ - cp /opt/senzing/er/sdk/c/gohelpers/*.h ./szproduct/gohelpers + cp /opt/senzing/er/sdk/c/szhelpers/*.h ./szproduct/szhelpers - name: Setup go uses: actions/setup-go@v5 diff --git a/Dockerfile b/Dockerfile index 24a6b52..f907b60 100755 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,8 @@ # Stages # ----------------------------------------------------------------------------- -ARG IMAGE_BUILDER=golang:1.22.3-bullseye -ARG IMAGE_FINAL=senzing/senzingapi-runtime-staging:latest +ARG IMAGE_BUILDER=golang:1.23.2-bullseye +ARG IMAGE_FINAL=senzing/senzingapi-runtime-beta:latest # ----------------------------------------------------------------------------- # Stage: senzingapi_runtime diff --git a/go.mod b/go.mod index b06ac0c..c43e11f 100644 --- a/go.mod +++ b/go.mod @@ -12,9 +12,9 @@ require ( ) require ( - github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/magiconair/properties v1.8.7 // indirect @@ -30,9 +30,9 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.6.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect - golang.org/x/sys v0.25.0 // indirect - golang.org/x/text v0.18.0 // indirect + golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/text v0.19.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index a3200d1..3a0ec86 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,13 @@ -github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc= +github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= @@ -53,12 +54,12 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8 github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk= -golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= -golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c h1:7dEasQXItcW1xKJ2+gg5VOiBnqWrJc+rq0DPKyvvdbY= +golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/makefiles/darwin.mk b/makefiles/darwin.mk index 81249fd..525cf8e 100644 --- a/makefiles/darwin.mk +++ b/makefiles/darwin.mk @@ -6,11 +6,11 @@ SENZING_DIR ?= /opt/senzing/er SENZING_TOOLS_SENZING_DIRECTORY ?= $(SENZING_DIR) - LD_LIBRARY_PATH ?= $(SENZING_TOOLS_SENZING_DIRECTORY)/lib:$(SENZING_TOOLS_SENZING_DIRECTORY)/lib/macos DYLD_LIBRARY_PATH := $(LD_LIBRARY_PATH) -SENZING_TOOLS_DATABASE_URL ?= sqlite3://na:na@nowhere/tmp/sqlite/G2C.db +CGO_LDFLAGS := "-Wl,-no_warn_duplicate_libraries" PATH := $(MAKEFILE_DIRECTORY)/bin:/$(HOME)/go/bin:$(PATH) +SENZING_TOOLS_DATABASE_URL ?= sqlite3://na:na@nowhere/tmp/sqlite/G2C.db # ----------------------------------------------------------------------------- # OS specific targets diff --git a/package.Dockerfile b/package.Dockerfile index 2f3bbe4..bf07714 100755 --- a/package.Dockerfile +++ b/package.Dockerfile @@ -2,8 +2,8 @@ # Stages # ----------------------------------------------------------------------------- -ARG IMAGE_SENZINGAPI_RUNTIME=senzing/senzingapi-runtime-staging:latest -ARG IMAGE_BUILDER=golang:1.22.3-bullseye +ARG IMAGE_SENZINGAPI_RUNTIME=senzing/senzingapi-runtime-beta:latest +ARG IMAGE_BUILDER=golang:1.22.4-bullseye ARG IMAGE_FPM=dockter/fpm:latest ARG IMAGE_FINAL=alpine