Build binaries for LoongArch64 (linux/loong64) #1144

Open
MingcongBai wants to merge 3 commits from MingcongBai/runner:upstream/loong64-support into main
First-time contributor

This pull request adds support to build binaries for linux/loong64 (LoongArch64 in runner.arch).

Apart from adding runner.arch definition for this architecture, this pull request only changes the Makefile and the release workflows. All changes are build and smoke tested:

(ssh)root@YuanBao [ runner@upstream/loong64-support ] # make
/usr/lib/go/bin/go build -v -tags 'netgo osusergo ' -ldflags '-extldflags "-static" -s -w -X "code.forgejo.org/forgejo/runner/v11/internal/pkg/ver.version=v11.3.1+13-g3282f732"' -o forgejo-runner
(ssh)root@YuanBao [ runner@upstream/loong64-support ] # file ./forgejo-runner 
./forgejo-runner: ELF 64-bit LSB executable, LoongArch, version 1 (SYSV), statically linked, BuildID[sha1]=54a2e72a560fc17eba511140feb88073f5e4c8c1, stripped
(ssh)root@YuanBao [ runner@upstream/loong64-support ] # ./forgejo-runner --version
forgejo-runner version v11.3.1+13-g3282f732
(ssh)root@YuanBao [ runner@upstream/loong64-support ] # ./forgejo-runner --help
Run Forgejo Actions locally by specifying the event name (e.g. `push`) or an action name directly.

Usage:
  forgejo-runner [command]

Available Commands:
  cache-server       Start a cache server for the cache action
  create-runner-file Create a runner file using a shared secret used to pre-register the runner on the Forgejo instance
  daemon             Run as a runner daemon
  exec               Run workflow locally.
  generate-config    Generate an example config file
  help               Help about any command
  one-job            Run only one job
  register           Register a runner to the server
  validate           Validate workflows or actions with a schema

Flags:
  -c, --config string   Config file path
  -h, --help            help for forgejo-runner
  -v, --version         version for forgejo-runner

Use "forgejo-runner [command] --help" for more information about a command.

Once this pull request is ready to go, I will open another pull request for test/container changes, as it involves refactoring the "other architecture" assumption made on AArch64 versus x86-64.

  • other
    • PR: Build binaries for LoongArch64 (linux/loong64)
This pull request adds support to build binaries for linux/loong64 (LoongArch64 in runner.arch). Apart from adding `runner.arch` definition for this architecture, this pull request only changes the Makefile and the release workflows. All changes are build and smoke tested: ``` (ssh)root@YuanBao [ runner@upstream/loong64-support ] # make /usr/lib/go/bin/go build -v -tags 'netgo osusergo ' -ldflags '-extldflags "-static" -s -w -X "code.forgejo.org/forgejo/runner/v11/internal/pkg/ver.version=v11.3.1+13-g3282f732"' -o forgejo-runner (ssh)root@YuanBao [ runner@upstream/loong64-support ] # file ./forgejo-runner ./forgejo-runner: ELF 64-bit LSB executable, LoongArch, version 1 (SYSV), statically linked, BuildID[sha1]=54a2e72a560fc17eba511140feb88073f5e4c8c1, stripped (ssh)root@YuanBao [ runner@upstream/loong64-support ] # ./forgejo-runner --version forgejo-runner version v11.3.1+13-g3282f732 (ssh)root@YuanBao [ runner@upstream/loong64-support ] # ./forgejo-runner --help Run Forgejo Actions locally by specifying the event name (e.g. `push`) or an action name directly. Usage: forgejo-runner [command] Available Commands: cache-server Start a cache server for the cache action create-runner-file Create a runner file using a shared secret used to pre-register the runner on the Forgejo instance daemon Run as a runner daemon exec Run workflow locally. generate-config Generate an example config file help Help about any command one-job Run only one job register Register a runner to the server validate Validate workflows or actions with a schema Flags: -c, --config string Config file path -h, --help help for forgejo-runner -v, --version version for forgejo-runner Use "forgejo-runner [command] --help" for more information about a command. ``` Once this pull request is ready to go, I will open another pull request for test/container changes, as it involves refactoring the "other architecture" assumption made on AArch64 versus x86-64. <!--start release-notes-assistant--> <!--URL:https://code.forgejo.org/forgejo/runner--> - other - [PR](https://code.forgejo.org/forgejo/runner/pulls/1144): <!--number 1144 --><!--line 0 --><!--description QnVpbGQgYmluYXJpZXMgZm9yIExvb25nQXJjaDY0IChsaW51eC9sb29uZzY0KQ==-->Build binaries for LoongArch64 (linux/loong64)<!--description--> <!--end release-notes-assistant-->
The combination loong64 => LoongArch64 is taken from the WIP GitHub
Actions runner pull request.

Link: https://github.com/actions/runner/pull/3928
ci: build binaries for linux/loong64
Some checks failed
issue-labels / release-notes (pull_request_target) Successful in 4s
checks / validate mocks (pull_request) Successful in 53s
checks / validate pre-commit-hooks file (pull_request) Successful in 31s
checks / build and test (pull_request) Successful in 2m41s
checks / runner exec tests (pull_request) Successful in 24s
checks / runner integration tests (pull_request) Successful in 5m7s
checks / integration tests (pull_request) Successful in 10m10s
Integration tests for the release process / release-simulation (pull_request) Has been cancelled
3282f73263
viceice left a comment
Owner

looks good, but can you please open a feature request first

https://code.forgejo.org/forgejo/forgejo-actions-feature-requests/issues/new/choose

looks good, but can you please open a feature request first https://code.forgejo.org/forgejo/forgejo-actions-feature-requests/issues/new/choose
Author
First-time contributor

@viceice wrote in #1144 (comment):

looks good, but can you please open a feature request first

https://code.forgejo.org/forgejo/forgejo-actions-feature-requests/issues/new/choose

Thanks for your review!

Done here - forgejo/forgejo-actions-feature-requests#73.

@viceice wrote in https://code.forgejo.org/forgejo/runner/pulls/1144#issuecomment-66263: > looks good, but can you please open a feature request first > > https://code.forgejo.org/forgejo/forgejo-actions-feature-requests/issues/new/choose Thanks for your review! Done here - https://code.forgejo.org/forgejo/forgejo-actions-feature-requests/issues/73.
Some checks are pending
issue-labels / release-notes (pull_request_target) Successful in 4s
checks / validate mocks (pull_request) Successful in 53s
Required
Details
checks / validate pre-commit-hooks file (pull_request) Successful in 31s
checks / build and test (pull_request) Successful in 2m41s
checks / runner exec tests (pull_request) Successful in 24s
Required
Details
checks / runner integration tests (pull_request) Successful in 5m7s
checks / integration tests (pull_request) Successful in 10m10s
Integration tests for the release process / release-simulation (pull_request) Has been cancelled
checks / Build Forgejo Runner *
Required
checks / Run integration tests with *
Required
cascade / *
Required
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u upstream/loong64-support:MingcongBai-upstream/loong64-support
git switch MingcongBai-upstream/loong64-support
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo/runner!1144
No description provided.