Skip to content
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

Test on Go1.24rc3 #982

Closed
wants to merge 4 commits into from
Closed
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
51 changes: 51 additions & 0 deletions .github/actions/setup-go/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "Setup Go"
description: "Setup Go environment by downloading and extracting from go.dev"
inputs:
go-version:
description: "The Go version to download and use"
required: true
runs:
using: "composite"
steps:
- name: Download and setup Go
shell: bash
run: |
set -e
GO_VERSION="${{ inputs.go-version }}"
GO_VERSION="${GO_VERSION#go}" # Remove 'go' prefix if present

# Determine OS and architecture
if [[ "$RUNNER_OS" == "macOS" ]]; then
OS="darwin"
ARCH="arm64"
else
OS="linux"
ARCH="amd64"
fi

DOWNLOAD_URL="https://go.dev/dl/go${GO_VERSION}.${OS}-${ARCH}.tar.gz"
echo "Downloading Go from: ${DOWNLOAD_URL}"

# Create temporary directory for download
TMP_DIR=$(mktemp -d)
curl -L "${DOWNLOAD_URL}" -o "${TMP_DIR}/go.tar.gz"

# Remove existing Go installation if any
sudo rm -rf /usr/local/go

# Extract to /usr/local
sudo tar -C /usr/local -xzf "${TMP_DIR}/go.tar.gz"

# Clean up
rm -rf "${TMP_DIR}"

# Add to PATH
echo "/usr/local/go/bin" >> $GITHUB_PATH
echo "$HOME/go/bin" >> $GITHUB_PATH

- name: Verify Go installation
shell: bash
run: |
# Verify installation
echo "Verifying Go installation..."
go version
11 changes: 4 additions & 7 deletions .github/actions/test-helloworld/action.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
name: 'Test Hello World'
description: 'Test Hello World with specific Go and module versions'
name: "Test Hello World"
description: "Test Hello World with specific Go module versions"
inputs:
go-version:
description: 'Go version being tested'
required: true
mod-version:
description: 'Go module version to use'
description: "Go module version to use"
required: true
runs:
using: "composite"
steps:
- name: Test Hello World
shell: bash
run: |
echo "Testing with Go ${{ inputs.go-version }} and go.mod ${{ inputs.mod-version }}"
echo "Testing with go.mod ${{ inputs.mod-version }}"
mkdir -p _test/helloworld && cd _test/helloworld
cat > go.mod << 'EOL'
module hello
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

jobs:
doc_verify:
continue-on-error: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -30,6 +31,7 @@ jobs:
args: README.md

doc_test:
continue-on-error: true
strategy:
matrix:
os:
Expand All @@ -40,9 +42,9 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
uses: ./.github/actions/setup-go
with:
go-version: '1.23'
go-version: '1.24rc3'

- name: Install dependencies on macOS
if: startsWith(matrix.os, 'macos')
Expand Down Expand Up @@ -78,4 +80,3 @@ jobs:
set -e
set -x
source doc/_readme/scripts/run.sh

5 changes: 3 additions & 2 deletions .github/workflows/fmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ on:

jobs:
fmt:
continue-on-error: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
uses: ./.github/actions/setup-go
with:
go-version: '1.23'
go-version: '1.24rc3'

- name: Check formatting
run: |
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:

jobs:
test:
continue-on-error: true
strategy:
matrix:
os:
Expand All @@ -35,9 +36,9 @@ jobs:
clang --version

- name: Set up Go
uses: actions/setup-go@v5
uses: ./.github/actions/setup-go
with:
go-version: '1.23'
go-version: '1.24rc3'

- name: Build
run: go build -v ./...
Expand Down
44 changes: 25 additions & 19 deletions .github/workflows/llgo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ on:

jobs:
llgo-test:
continue-on-error: true
strategy:
matrix:
os:
- macos-latest
- ubuntu-24.04
llvm: [18]
go: ['1.20', '1.21', '1.22', '1.23']
go: ['1.20.14', '1.21.13', '1.22.12', '1.23.6', '1.24rc3']
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
Expand All @@ -35,9 +36,9 @@ jobs:
pip3.12 install --break-system-packages "${py_deps[@]}"

- name: Set up Go for build
uses: actions/setup-go@v5
uses: ./.github/actions/setup-go
with:
go-version: '1.23'
go-version: '1.24rc3'

- name: Install
working-directory: compiler
Expand All @@ -46,7 +47,7 @@ jobs:
echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV

- name: Set up Go for testing
uses: actions/setup-go@v5
uses: ./.github/actions/setup-go
with:
go-version: ${{matrix.go}}

Expand Down Expand Up @@ -94,11 +95,12 @@ jobs:
bash _lldb/runtest.sh -v

helloworld-test:
continue-on-error: true
strategy:
matrix:
os: [ubuntu-24.04, macos-latest]
llvm: [18]
go: ['1.20', '1.21', '1.22', '1.23']
go: ['1.20', '1.21', '1.22', '1.23', '1.24']
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
Expand All @@ -107,39 +109,43 @@ jobs:
with:
llvm-version: ${{matrix.llvm}}

- name: Set up Go 1.23 for building llgo
uses: actions/setup-go@v5
- name: Set up Go for building llgo
uses: ./.github/actions/setup-go
with:
go-version: '1.23'
go-version: '1.24rc3'

- name: Install llgo
working-directory: compiler
run: |
go install ./...
echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV

- name: Set up Go for testing
uses: actions/setup-go@v5
with:
go-version: ${{matrix.go}}

- name: Test Hello World with go.mod 1.20
if: matrix.go == '1.20' || matrix.go == '1.21' || matrix.go == '1.22' || matrix.go == '1.23'
if: matrix.go == '1.20' || matrix.go == '1.21' || matrix.go == '1.22' || matrix.go == '1.23' || matrix.go == '1.24'
uses: ./.github/actions/test-helloworld
with:
go-version: ${{matrix.go}}
mod-version: '1.20'

- name: Test Hello World with go.mod 1.21
if: matrix.go == '1.21' || matrix.go == '1.22' || matrix.go == '1.23'
if: matrix.go == '1.21' || matrix.go == '1.22' || matrix.go == '1.23' || matrix.go == '1.24'
uses: ./.github/actions/test-helloworld
with:
go-version: ${{matrix.go}}
mod-version: '1.21'

- name: Test Hello World with go.mod 1.22
if: matrix.go == '1.22' || matrix.go == '1.23'
if: matrix.go == '1.22' || matrix.go == '1.23' || matrix.go == '1.24'
uses: ./.github/actions/test-helloworld
with:
go-version: ${{matrix.go}}
mod-version: '1.22'

- name: Test Hello World with go.mod 1.23
if: matrix.go == '1.23' || matrix.go == '1.24'
uses: ./.github/actions/test-helloworld
with:
mod-version: '1.23'

- name: Test Hello World with go.mod 1.24
if: matrix.go == '1.24'
uses: ./.github/actions/test-helloworld
with:
mod-version: '1.24'
6 changes: 4 additions & 2 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

jobs:
populate-darwin-sysroot:
continue-on-error: true
runs-on: macos-latest
steps:
- name: Check out code
Expand All @@ -31,6 +32,7 @@ jobs:
path: .sysroot/darwin.tar.gz
compression-level: 0
build:
continue-on-error: true
runs-on: ubuntu-latest
needs: populate-darwin-sysroot
steps:
Expand All @@ -39,9 +41,9 @@ jobs:
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
uses: ./.github/actions/setup-go
with:
go-version: 1.23.x
go-version: '1.24rc3'
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Download Darwin sysroot tarball
Expand Down
10 changes: 5 additions & 5 deletions compiler/cl/_testdata/print/out.ll
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ source_filename = "main"
@_llgo_int16 = linkonce global ptr null, align 8
@_llgo_int64 = linkonce global ptr null, align 8
@_llgo_int = linkonce global ptr null, align 8
@_llgo_byte = linkonce global ptr null, align 8
@_llgo_uint8 = linkonce global ptr null, align 8
@_llgo_uint16 = linkonce global ptr null, align 8
@_llgo_uint32 = linkonce global ptr null, align 8
@_llgo_uint64 = linkonce global ptr null, align 8
Expand Down Expand Up @@ -243,7 +243,7 @@ _llgo_2: ; preds = %_llgo_1, %_llgo_3,
%78 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %77, ptr inttoptr (i64 5 to ptr), 1
store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %78, ptr %75, align 8
%79 = getelementptr inbounds %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %38, i64 10
%80 = load ptr, ptr @_llgo_byte, align 8
%80 = load ptr, ptr @_llgo_uint8, align 8
%81 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %80, 0
%82 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %81, ptr inttoptr (i64 1 to ptr), 1
store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %82, ptr %79, align 8
Expand Down Expand Up @@ -389,7 +389,7 @@ _llgo_14: ; preds = %_llgo_55

_llgo_15: ; preds = %_llgo_55
%25 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %0, 0
%26 = load ptr, ptr @_llgo_byte, align 8
%26 = load ptr, ptr @_llgo_uint8, align 8
%27 = icmp eq ptr %25, %26
br i1 %27, label %_llgo_56, label %_llgo_57

Expand Down Expand Up @@ -1273,13 +1273,13 @@ _llgo_17: ; preds = %_llgo_16
br label %_llgo_18

_llgo_18: ; preds = %_llgo_17, %_llgo_16
%27 = load ptr, ptr @_llgo_byte, align 8
%27 = load ptr, ptr @_llgo_uint8, align 8
%28 = icmp eq ptr %27, null
br i1 %28, label %_llgo_19, label %_llgo_20

_llgo_19: ; preds = %_llgo_18
%29 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 40)
store ptr %29, ptr @_llgo_byte, align 8
store ptr %29, ptr @_llgo_uint8, align 8
br label %_llgo_20

_llgo_20: ; preds = %_llgo_19, %_llgo_18
Expand Down
Loading
Loading