diff --git a/.cirrus.yml b/.cirrus.yml index c7d5293..6be2c35 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,22 +1,23 @@ env: CIRRUS_CLONE_DEPTH: 1 + GO_VERSION: go1.19.1 freebsd_12_task: freebsd_instance: image_family: freebsd-12-3 install_script: | - pkg install -y git go - GOBIN=$PWD/bin go install golang.org/dl/go1.17.7@latest - bin/go1.17.7 download - build_script: bin/go1.17.7 build -v ./... - test_script: bin/go1.17.7 test -race ./... + pkg install -y go + GOBIN=$PWD/bin go install golang.org/dl/${GO_VERSION}@latest + bin/${GO_VERSION} download + build_script: bin/${GO_VERSION} build -v ./... + test_script: bin/${GO_VERSION} test -race ./... freebsd_13_task: freebsd_instance: image_family: freebsd-13-0 install_script: | - pkg install -y git go - GOBIN=$PWD/bin go install golang.org/dl/go1.17.7@latest - bin/go1.17.7 download - build_script: bin/go1.17.7 build -v ./... - test_script: bin/go1.17.7 test -race ./... + pkg install -y go + GOBIN=$PWD/bin go install golang.org/dl/${GO_VERSION}@latest + bin/${GO_VERSION} download + build_script: bin/${GO_VERSION} build -v ./... + test_script: bin/${GO_VERSION} test -race ./... diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..5f4b87a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,19 @@ +version: 2 +updates: + - package-ecosystem: gomod + directory: / + schedule: + interval: daily + commit-message: + prefix: "go.mod:" + open-pull-requests-limit: 1 + rebase-strategy: disabled + + - package-ecosystem: github-actions + directory: / + schedule: + interval: daily + commit-message: + prefix: ".github:" + open-pull-requests-limit: 1 + rebase-strategy: disabled diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 84bf91f..8699fe4 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -14,12 +14,12 @@ jobs: steps: - name: Install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f with: - go-version: '1.17' + go-version: '1.19' - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - name: Install staticcheck run: go install honnef.co/go/tools/cmd/staticcheck@latest diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5443f61..8770d0f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,32 +12,31 @@ jobs: build-and-test: strategy: matrix: - go-version: [ '1.15' , '1.16', '1.17', '1.18.0-rc1' ] - os: [ubuntu-18.04, ubuntu-20.04, macos-10.15, macos-11] + go-version: [1.17, 1.18, 1.19] + os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12] runs-on: ${{ matrix.os }} steps: - name: Install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f with: go-version: ${{ matrix.go-version }} - stable: false - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - name: Check formatting - if: ${{ matrix.go-version == '1.17' && matrix.os == 'ubuntu-20.04' }} + if: ${{ matrix.go-version == '1.19' && matrix.os == 'ubuntu-22.04' }} run: diff -u <(echo -n) <(gofmt -d .) - name: Check Go modules - if: ${{ matrix.go-version == '1.17' && matrix.os == 'ubuntu-20.04' }} + if: ${{ matrix.go-version == '1.19' && matrix.os == 'ubuntu-22.04' }} run: | go mod tidy git diff --exit-code - name: Build (cross-compile) - if: matrix.os == 'ubuntu-20.04' + if: matrix.os == 'ubuntu-22.04' run: | GOOS=darwin go build ./... GOOS=dragonfly go build ./... diff --git a/LICENSE b/LICENSE index cf198de..73c6b89 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2018-2021, Tobias Klauser +Copyright (c) 2018-2022, Tobias Klauser All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/cgotest/sysconf_cgotest_darwin.go b/cgotest/sysconf_cgotest_darwin.go index 8148f7f..5ddcfa7 100644 --- a/cgotest/sysconf_cgotest_darwin.go +++ b/cgotest/sysconf_cgotest_darwin.go @@ -170,10 +170,9 @@ func testMacOSVersionDeps(t *testing.T) { maj, _ := strconv.Atoi(ver[0]) // _POSIX_V6_ILP32_OFFBIG was fixed in macOS 10.15 (Catalina) - if maj >= 19 { - v6Ilp32Offbig := testCase{sysconf.SC_V6_ILP32_OFFBIG, C._SC_V6_ILP32_OFFBIG, "_POSIX_V6_ILP32_OFFBIG"} - testSysconfGoCgo(t, v6Ilp32Offbig) - } else { + if maj < 19 { t.Skip("skipping _POSIX_V6_ILP32_OFFBIG on macOS < 10.15") } + v6Ilp32Offbig := testCase{sysconf.SC_V6_ILP32_OFFBIG, C._SC_V6_ILP32_OFFBIG, "_POSIX_V6_ILP32_OFFBIG"} + testSysconfGoCgo(t, v6Ilp32Offbig) } diff --git a/go.mod b/go.mod index 3d35730..923b3d3 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,6 @@ module github.com/tklauser/go-sysconf go 1.13 require ( - github.com/tklauser/numcpus v0.4.0 - golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 + github.com/tklauser/numcpus v0.6.0 + golang.org/x/sys v0.2.0 ) diff --git a/go.sum b/go.sum index c1d2835..6eb6d4a 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,4 @@ -github.com/tklauser/numcpus v0.4.0 h1:E53Dm1HjH1/R2/aoCtXtPgzmElmn51aOkhCFSuZq//o= -github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 h1:XDXtA5hveEEV8JB2l7nhMTp3t3cHp9ZpwcdjqyEWLlo= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYms= +github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4= +golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/zsysconf_values_freebsd_riscv64.go b/zsysconf_values_freebsd_riscv64.go new file mode 100644 index 0000000..b7cff76 --- /dev/null +++ b/zsysconf_values_freebsd_riscv64.go @@ -0,0 +1,12 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs sysconf_values_freebsd.go + +//go:build freebsd && riscv64 +// +build freebsd,riscv64 + +package sysconf + +const ( + _LONG_MAX = 0x7fffffffffffffff + _SHRT_MAX = 0x7fff +)