go-python / go-python/gopy

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

Ouverte
#363 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Go
Étoiles
2.3k
Forks
136
Merge moyen
14 min
PR mergées (30 j)
2

Description

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.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Commencez par reproduire la commande signalée `GOOS=linux GOARCH=amd64 gopy pkg` pour `./pkg/job` et inspectez les chemins générés de `httpygo/__pkg/job`. Suivez la manière dont le point d’entrée `gopy pkg` gère la sortie multiplateforme et les contraintes de build ; le travail est terminé lorsque la commande construit le package pour linux/amd64 sans nécessiter la copie des fichiers source dans le répertoire de sortie.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
go, python
Domaine
build-system, devtools
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.