Skip to content

all: upgrade to Go 1.24 #2533

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ linters:
disable-all: true
enable:
- dupl
- errorlint
- errcheck
- errorlint
- gofmt
- goimports
- gosimple
Expand All @@ -16,12 +16,12 @@ linters:
- revive
- staticcheck
- stylecheck
- tenv
- typecheck
- unconvert
- unparam
- unused
- usestdlibvars
- usetesting
- varnamelen
# - wrapcheck If we're going to use github.com/pkg/errors we should probably turn this on?
# We'd like to have the following linter enabled, but it's broken for Go
Expand Down
23 changes: 12 additions & 11 deletions devbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"name": "devbox",
"description": "Instant, easy, and predictable development environments",
"packages": {
"go": "latest",
"runx:golangci/golangci-lint": "latest",
"runx:mvdan/gofumpt": "latest",
"fd": "latest",
"git": "latest",
"go": "latest"
},
"env": {
"GOENV": "off",
"PATH": "$PATH:$PWD/dist",
"PATH": "$PWD/dist/tools:$PATH:$PWD/dist"
},
"shell": {
"init_hook": [
Expand All @@ -17,6 +17,7 @@
"test -z $FISH_VERSION && \\",
"unset CGO_ENABLED GO111MODULE GOARCH GOFLAGS GOMOD GOOS GOROOT GOTOOLCHAIN GOWORK || \\",
"set --erase CGO_ENABLED GO111MODULE GOARCH GOFLAGS GOMOD GOOS GOROOT GOTOOLCHAIN GOWORK",
"GOBIN=$PWD/dist/tools go install tool"
],
"scripts": {
// Build devbox for the current platform
Expand All @@ -29,11 +30,11 @@
"devbox run build-darwin-amd64",
"devbox run build-darwin-arm64",
"devbox run build-linux-amd64",
"devbox run build-linux-arm64",
"devbox run build-linux-arm64"
],
// Open VSCode
"code": "code .",
"lint": "golangci-lint run --timeout 5m && scripts/gofumpt.sh",
"lint": "go tool golangci-lint run --timeout 5m && scripts/gofumpt.sh",
"fmt": "scripts/gofumpt.sh",
"test": "go test -race -cover ./...",
"test-projects-only": "DEVBOX_RUN_PROJECT_TESTS=1 go test -v -timeout ${DEVBOX_GOLANG_TEST_TIMEOUT:-30m} ./... -run \"TestExamples|TestScriptsWithProjects\"",
Expand All @@ -47,7 +48,7 @@
"vendor=$(realpath $(mktemp -d))",
"trap \"rm -rf $vendor\" EXIT",
"go mod vendor -o $vendor",
"nix hash path $vendor >vendor-hash",
"nix hash path $vendor >vendor-hash"
],
"tidy": ["go mod tidy", "devbox run update-hash"],
// docker-testscripts runs the testscripts with Docker to exercise
Expand All @@ -68,8 +69,8 @@
"GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go test -c -o testscripts-linux-amd64",
"GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go test -c -o testscripts-linux-arm64",
"image=$(docker build --quiet --tag devbox-testscripts-ubuntu:noble --platform linux/amd64 .)",
"docker run --rm --mount type=volume,src=devbox-testscripts-amd64,dst=/nix --platform linux/amd64 -e DEVBOX_RUN_FAILING_TESTS -e DEVBOX_RUN_PROJECT_TESTS -e DEVBOX_DEBUG $image \"$@\"",
],
},
},
"docker run --rm --mount type=volume,src=devbox-testscripts-amd64,dst=/nix --platform linux/amd64 -e DEVBOX_RUN_FAILING_TESTS -e DEVBOX_RUN_PROJECT_TESTS -e DEVBOX_DEBUG $image \"$@\""
]
}
}
}
151 changes: 133 additions & 18 deletions devbox.lock
Original file line number Diff line number Diff line change
@@ -1,61 +1,176 @@
{
"lockfile_version": "1",
"packages": {
"go@latest": {
"last_modified": "2024-08-14T11:41:26Z",
"resolved": "github:NixOS/nixpkgs/0cb2fd7c59fed0cd82ef858cbcbdb552b9a33465#go_1_23",
"fd@latest": {
"last_modified": "2025-02-07T11:26:36Z",
"resolved": "github:NixOS/nixpkgs/d98abf5cf5914e5e4e9d57205e3af55ca90ffc1d#fd",
"source": "devbox-search",
"version": "1.23.0",
"version": "10.2.0",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/x097y3rdlvw6ax1id52xx2didgzxjg34-go-1.23.0",
"path": "/nix/store/ad5m54pfn9k39v80lpyhrnsh336nqrp5-fd-10.2.0",
"default": true
}
],
"store_path": "/nix/store/x097y3rdlvw6ax1id52xx2didgzxjg34-go-1.23.0"
"store_path": "/nix/store/ad5m54pfn9k39v80lpyhrnsh336nqrp5-fd-10.2.0"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/znns5qk7fbhjb89bqhabxjxpgiq2ag1a-go-1.23.0",
"path": "/nix/store/vn3mny38qmf3lm809rpcvahxqwhkqb7m-fd-10.2.0",
"default": true
}
],
"store_path": "/nix/store/znns5qk7fbhjb89bqhabxjxpgiq2ag1a-go-1.23.0"
"store_path": "/nix/store/vn3mny38qmf3lm809rpcvahxqwhkqb7m-fd-10.2.0"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/psym5ggdincwihwd81kssc4gbw1k3p3h-go-1.23.0",
"path": "/nix/store/6kdv4iy9j3svncq0vs47wxfvvn7flcr5-fd-10.2.0",
"default": true
}
],
"store_path": "/nix/store/psym5ggdincwihwd81kssc4gbw1k3p3h-go-1.23.0"
"store_path": "/nix/store/6kdv4iy9j3svncq0vs47wxfvvn7flcr5-fd-10.2.0"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/0k144pnsvy0wa3dcl1y3df7d4zskylc4-go-1.23.0",
"path": "/nix/store/x58pg72qw2xv1vvs4pbqw63zhkdkp331-fd-10.2.0",
"default": true
}
],
"store_path": "/nix/store/0k144pnsvy0wa3dcl1y3df7d4zskylc4-go-1.23.0"
"store_path": "/nix/store/x58pg72qw2xv1vvs4pbqw63zhkdkp331-fd-10.2.0"
}
}
},
"runx:golangci/golangci-lint@latest": {
"resolved": "golangci/[email protected]",
"version": "v1.60.2"
"git@latest": {
"last_modified": "2025-02-07T11:26:36Z",
"resolved": "github:NixOS/nixpkgs/d98abf5cf5914e5e4e9d57205e3af55ca90ffc1d#git",
"source": "devbox-search",
"version": "2.47.2",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/9z3jhc0rlj3zaw8nd1zka9vli6w0q11g-git-2.47.2",
"default": true
},
{
"name": "doc",
"path": "/nix/store/rh151iwgy4h8yv8kxd5facw57cyj0bav-git-2.47.2-doc"
}
],
"store_path": "/nix/store/9z3jhc0rlj3zaw8nd1zka9vli6w0q11g-git-2.47.2"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/gx5y37qcfqdvn0h6swjd04dmqjjh3nk7-git-2.47.2",
"default": true
},
{
"name": "debug",
"path": "/nix/store/8vfpmf3vjgzl2psip76p0f9h11sb6y3p-git-2.47.2-debug"
},
{
"name": "doc",
"path": "/nix/store/c25mq3q83dvw3k5pb0qr5333g3cycylq-git-2.47.2-doc"
}
],
"store_path": "/nix/store/gx5y37qcfqdvn0h6swjd04dmqjjh3nk7-git-2.47.2"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/39xx5gx3hxigs1b5ldw5i2jr84vsn3rf-git-2.47.2",
"default": true
},
{
"name": "doc",
"path": "/nix/store/xmh2djjrnbpiqqgpblrcbavnqh0nv4km-git-2.47.2-doc"
}
],
"store_path": "/nix/store/39xx5gx3hxigs1b5ldw5i2jr84vsn3rf-git-2.47.2"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/33g65w5cc9n8fr0hxj84282xmv4l7hyl-git-2.47.2",
"default": true
},
{
"name": "debug",
"path": "/nix/store/jyz4nvcd3bci4vg2sfsmvrq0fp9mzr5a-git-2.47.2-debug"
},
{
"name": "doc",
"path": "/nix/store/lb4nipdhlwrxdavz7gdkcik6lkz3cbdm-git-2.47.2-doc"
}
],
"store_path": "/nix/store/33g65w5cc9n8fr0hxj84282xmv4l7hyl-git-2.47.2"
}
}
},
"github:NixOS/nixpkgs/nixpkgs-unstable": {
"resolved": "github:NixOS/nixpkgs/73cf49b8ad837ade2de76f87eb53fc85ed5d4680?lastModified=1739866667&narHash=sha256-EO1ygNKZlsAC9avfcwHkKGMsmipUk1Uc0TbrEZpkn64%3D"
},
"runx:mvdan/gofumpt@latest": {
"resolved": "mvdan/[email protected]",
"version": "v0.7.0"
"go@latest": {
"last_modified": "2025-02-12T00:10:52Z",
"resolved": "github:NixOS/nixpkgs/83a2581c81ff5b06f7c1a4e7cc736a455dfcf7b4#go_1_24",
"source": "devbox-search",
"version": "1.24.0",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/qldcnifalkvyah0wnv7m4zb854yd9l88-go-1.24.0",
"default": true
}
],
"store_path": "/nix/store/qldcnifalkvyah0wnv7m4zb854yd9l88-go-1.24.0"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/rrxgml7w4pfmibjbspkdvrw8vd2vnarb-go-1.24.0",
"default": true
}
],
"store_path": "/nix/store/rrxgml7w4pfmibjbspkdvrw8vd2vnarb-go-1.24.0"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/7imv22pl4qrjwvi6jzlfb305rc2min45-go-1.24.0",
"default": true
}
],
"store_path": "/nix/store/7imv22pl4qrjwvi6jzlfb305rc2min45-go-1.24.0"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/vh5d5bj1sljdhdypy80x1ydx2jx6rv2q-go-1.24.0",
"default": true
}
],
"store_path": "/nix/store/vh5d5bj1sljdhdypy80x1ydx2jx6rv2q-go-1.24.0"
}
}
}
}
}
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};

lastTag = "0.14.0";

revision =
if (self ? shortRev)
then "${self.shortRev}"
else "${self.dirtyShortRev or "dirty"}";
revision = if (self ? shortRev) then "${self.shortRev}" else "${self.dirtyShortRev or "dirty"}";

# Add the commit to the version string for flake builds
version = "${lastTag}";

# Run `devbox run update-flake` to update the vendor-hash
vendorHash =
if builtins.pathExists ./vendor-hash
then builtins.readFile ./vendor-hash
else "";
vendorHash = if builtins.pathExists ./vendor-hash then builtins.readFile ./vendor-hash else "";

buildGoModule = pkgs.buildGo123Module;
buildGoModule = pkgs.buildGo124Module;

in
{
Expand Down
Loading
Loading