Skip to content

Conversation

wxpppp
Copy link

@wxpppp wxpppp commented Jan 24, 2024

What this PR does / why we need it:
The LoongArch architecture (LoongArch) is an Instruction Set Architecture (ISA) that has a RISC style, that is being used by more and more users.
Which issue(s) this PR fixes:
This patch supports building Grafana plugins on machines with the loong64/loongarch64 architecture.

Fixes #

Special notes for your reviewer:

Signed-off-by: Weijie Wang <wangweijie@loongson.cn>
@wxpppp wxpppp requested a review from a team as a code owner January 24, 2024 10:10
@wxpppp wxpppp requested review from marefr, wbrowne and xnyo and removed request for a team January 24, 2024 10:10
@CLAassistant
Copy link

CLAassistant commented Jan 24, 2024

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@xnyo
Copy link
Contributor

xnyo commented Jan 24, 2024

Hello and thank you for contributing to Grafana!

In order to add support for plugins on loong64 architecture, Grafana itself also needs to be compiled for loong64. We currently only offer amd64 and arm64 binaries for Linux.

We encourage you to open an issue at https://github.com/grafana/grafana to request and discuss adding support for loong64 to Grafana.

In the meantime, if you are building Grafana for loong64 from source, you can still build plugins for such architecture by adding a custom target in your plugin's Magefile, like so:

//go:build mage
// +build mage

package main

import (
	"github.com/magefile/mage/mg"

	// mage:import
	build "github.com/grafana/grafana-plugin-sdk-go/build"
)

func BuildAll() error {
	mg.Deps(build.BuildAll)

	var b build.Build
	if err := build.SetBeforeBuildCallback(func(cfg build.Config) (build.Config, error) {
		cfg.OS = "linux"
		cfg.Arch = "loong64"
		return cfg, nil
	}); err != nil {
		return err
	}
	return b.Backend()
}

// Default configures the default target.
var Default = BuildAll

@wxpppp
Copy link
Author

wxpppp commented Feb 26, 2024

Thank you for your detailed reply. I will submit a new PR after Grafana supports loongarch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants