-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
opt: fix compilation errors on *BSD (#593)
- Loading branch information
Showing
46 changed files
with
401 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: Cross-compile for *BSD | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- dev | ||
- 1.x | ||
paths-ignore: | ||
- '**.md' | ||
- '**.yml' | ||
- '**.yaml' | ||
- '!.github/workflows/cross-compile-bsd.yml' | ||
pull_request: | ||
branches: | ||
- master | ||
- dev | ||
- 1.x | ||
paths-ignore: | ||
- '**.md' | ||
- '**.yml' | ||
- '**.yaml' | ||
- '!.github/workflows/cross-compile-bsd.yml' | ||
|
||
env: | ||
GO111MODULE: on | ||
GOPROXY: "https://proxy.golang.org" | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
go: ['1.17', '1.21'] | ||
os: | ||
- ubuntu-latest | ||
name: Go ${{ matrix.go }} @ ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.ref }} | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
|
||
- name: Print Go environment | ||
id: go-env | ||
run: | | ||
printf "Using go at: $(which go)\n" | ||
printf "Go version: $(go version)\n" | ||
printf "\n\nGo environment:\n\n" | ||
go env | ||
printf "\n\nSystem environment:\n\n" | ||
env | ||
# Calculate the short SHA1 hash of the git commit | ||
echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | ||
echo "GO_CACHE=$(go env GOCACHE)" >> $GITHUB_OUTPUT | ||
- name: Cross-compiling for DragonFlyBSD | ||
run: GOOS=dragonfly GOARCH=amd64 go build | ||
|
||
- name: Cross-compiling for DragonFlyBSD -tags=poll_opt,gc_opt | ||
run: GOOS=dragonfly GOARCH=amd64 go build -tags=poll_opt,gc_opt | ||
|
||
- name: Cross-compiling for FreeBSD | ||
run: GOOS=freebsd GOARCH=amd64 go build | ||
|
||
- name: Cross-compiling for FreeBSD -tags=poll_opt,gc_opt | ||
run: GOOS=freebsd GOARCH=amd64 go build -tags=poll_opt,gc_opt | ||
|
||
- name: Cross-compiling for NetBSD | ||
run: GOOS=netbsd GOARCH=amd64 go build | ||
|
||
- name: Cross-compiling for NetBSD -tags=poll_opt,gc_opt | ||
run: GOOS=netbsd GOARCH=amd64 go build -tags=poll_opt,gc_opt | ||
|
||
- name: Cross-compiling for OpenBSD | ||
run: GOOS=openbsd GOARCH=amd64 go build | ||
|
||
- name: Cross-compiling for OpenBSD -tags=poll_opt,gc_opt | ||
run: GOOS=openbsd GOARCH=amd64 go build -tags=poll_opt,gc_opt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (c) 2024 The Gnet Authors. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
//go:build darwin || dragonfly || freebsd || openbsd | ||
// +build darwin dragonfly freebsd openbsd | ||
|
||
package netpoll | ||
|
||
// IOFlags represents the flags of IO events. | ||
type IOFlags = uint16 | ||
|
||
// IOEvent is the integer type of I/O events on BSD's. | ||
type IOEvent = int16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) 2024 The Gnet Authors. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package netpoll | ||
|
||
// IOEvent is the integer type of I/O events on BSD's. | ||
type IOEvent = uint32 | ||
|
||
// IOFlags represents the flags of IO events. | ||
type IOFlags = uint32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.