go-python / go-python/gopy

Cannot perform cross-platform builds darwin/arm64->linux/amd64

オープン
#363 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Go
スター
2.3k
フォーク
136
平均マージ
14分
マージ済み PR(30日)
2

説明

I'm trying to build a package for a project which will be deployed to amd64/linux targets.

An example of the command I'm trying to run: `GOOS=linux GOARCH=amd64 gopy pkg -dynamic-link=true --output=httpygo/__pkg/job -vm=python3 ./pkg/job`

That causes the following log output:

```bash
(venv) eixvc@WUST049416 httpy-go % make build
rm -R ./httpygo/__pkg
GOOS=linux GOARCH=amd64 gopy pkg -dynamic-link=true --output=httpygo/__pkg/job -vm=python3 ./pkg/job
go build -v ./pkg/job
stat /Users/~/githubrepos/location360-fld-dev-resources/proof-of-concept/httpy-go/httpygo/__pkg/job/pkg/job: directory not found
2024/09/23 19:53:18 Note: there was an error building [./pkg/job] -- will continue but it may fail later: exit status 1

--- skipping dir with no go files or only doc.go: ./pkg/job -- []

--- building package ---
gopy pkg -dynamic-link=true --output=httpygo/__pkg/job -vm=python3 ./pkg/job
goimports -w job.go
go build -mod=mod -buildmode=c-shared -o job_go.so .
cmd had error: exit status 1 output:
package github.com/bayer-int/location360-fld-dev-resources/proof-of-concept/httpy-go/httpygo/__pkg/job/job: build constraints exclude all Go files in /Users/eixvc/githubrepos/location360-fld-dev-resources/proof-of-concept/httpy-go/httpygo/__pkg/job/job
```

Note that I tried adding the dynamic-linking flag in case it statically linking resulted in linking errors, but it had no effect. I'm not entirely sure I understand what is actually happening.

EDIT: I just noticed that the error mesasge reports that the path is wrong. It looks like, when you specify GOOS and GOARCH, it changes the path it searches for source, appending them together. I adjusted for this by copying the source file contents into the output folder, which works without conflict. Unfortunately, the build still fails as shown here.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。