go-python / go-python/gopy

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

Đang mở
#363 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Go
Star
2.3k
Fork
136
Merge trung bình
14 phút
Pull request đã merge (30 ngày)
2

Mô tả

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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện lệnh đã được báo cáo `GOOS=linux GOARCH=amd64 gopy pkg` cho `./pkg/job` và kiểm tra các đường dẫn `httpygo/__pkg/job` được tạo ra. Truy vết cách entry point `gopy pkg` xử lý đầu ra đa nền tảng và các ràng buộc build; được xem là hoàn thành khi lệnh build package cho linux/amd64 mà không yêu cầu sao chép các tệp nguồn vào thư mục đầu ra.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
go, python
Lĩnh vực
build-system, devtools
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.