CasaOS icon indicating copy to clipboard operation
CasaOS copied to clipboard

[Bug] I want to compile the code for local deployment myself, but there is a serious error message

Open fengyikang88 opened this issue 2 years ago • 6 comments

go run main.go common/message.go:4:2: no required module provides package github.com/IceWhaleTech/CasaOS/codegen/message_bus; to add it: go get github.com/IceWhaleTech/CasaOS/codegen/message_bus route/v2.go:13:2: no required module provides package github.com/IceWhaleTech/CasaOS/codegen; to add it: go get github.com/IceWhaleTech/CasaOS/codegen

go get github.com/IceWhaleTech/CasaOS/codegen
go: github.com/IceWhaleTech/CasaOS/codegen: no matching versions for query "upgrade"

How to solve this problem? I have been unable to find this package???

fengyikang88 avatar May 26 '24 07:05 fengyikang88

I am also faced on this problem. I think, codegen folder is missed by gitignore. anybody to take care about this? thank you.

codexandr avatar May 26 '24 11:05 codexandr

Need go generate to generate the codegen. Or goreleaser is recommanded to develop, like goreleaser build --clean --snapshot --id casaos-amd64.

Ns2Kracy avatar May 27 '24 05:05 Ns2Kracy

需要go generate生成codegen。或者建议用goreleaser来开发,如goreleaser build --clean --snapshot --id casaos-amd64。

Need go generate to generate the codegen. Or goreleaser is recommanded to develop, like goreleaser build --clean --snapshot --id casaos-amd64. But I am currently using the M1 version of MAC, which keeps prompting me:

github.com/IceWhaleTech/CasaOS/service

service/connections.go:65:8: undefined: unix.MS_NOATIME service/connections.go:65:24: undefined: unix.MS_NODEV service/connections.go:65:38: undefined: unix.MS_NOSUID service/connections.go:66:3: too many arguments in call to unix.Mount have (string, string, string, unknown type, string) want (string, string, int, unsafe.Pointer) service/connections.go:73:15: undefined: mount.Unmount Can only be recompiled and developed on Linux systems on the X86 platform??

fengyikang88 avatar May 27 '24 06:05 fengyikang88

需要go generate生成codegen。或者建议用goreleaser来开发,如goreleaser build --clean --snapshot --id casaos-amd64。

Need go generate to generate the codegen. Or goreleaser is recommanded to develop, like goreleaser build --clean --snapshot --id casaos-amd64. But I am currently using the M1 version of MAC, which keeps prompting me:

github.com/IceWhaleTech/CasaOS/service

service/connections.go:65:8: undefined: unix.MS_NOATIME service/connections.go:65:24: undefined: unix.MS_NODEV service/connections.go:65:38: undefined: unix.MS_NOSUID service/connections.go:66:3: too many arguments in call to unix.Mount have (string, string, string, unknown type, string) want (string, string, int, unsafe.Pointer) service/connections.go:73:15: undefined: mount.Unmount Can only be recompiled and developed on Linux systems on the X86 platform??

You can check the .goreleaser.yaml file, and choose the id you need like casaos-amd64 or casaos-arm64.

Ns2Kracy avatar May 27 '24 08:05 Ns2Kracy

需要go generate生成codegen。或者建议用goreleaser来开发,如goreleaser build --clean --snapshot --id casaos-amd64。

Need go generate to generate the codegen. Or goreleaser is recommanded to develop, like goreleaser build --clean --snapshot --id casaos-amd64. But I am currently using the M1 version of MAC, which keeps prompting me:

github.com/IceWhaleTech/CasaOS/service

service/connections.go:65:8: undefined: unix.MS_NOATIME service/connections.go:65:24: undefined: unix.MS_NODEV service/connections.go:65:38: undefined: unix.MS_NOSUID service/connections.go:66:3: too many arguments in call to unix.Mount have (string, string, string, unknown type, string) want (string, string, int, unsafe.Pointer) service/connections.go:73:15: undefined: mount.Unmount Can only be recompiled and developed on Linux systems on the X86 platform??

You can check the .goreleaser.yaml file, and choose the id you need like casaos-amd64 or casaos-arm64.

Solved. Thank you!

fengyikang88 avatar May 31 '24 02:05 fengyikang88

This is still an issue.

OS: MacOS Sequoia 15.2 (24C101) GOARCH='arm64' go version=1.23.4

According to goreleaser output, go generate is executed before go test. Still, unix.MS_NOATIME and others are not defined.

~/g/CasaOS►goreleaser build --clean --snapshot --id casaos-arm64 -f .goreleaser.debug.yaml
  • starting build...
  • loading                                          path=.goreleaser.debug.yaml
  • skipping validate...
  • loading environment variables
  • getting and validating git state
    • git state                                      commit=ba285cb8bddb85fbd93060b3a8b944f35dd7a7ad branch=main current_tag=v0.4.15 previous_tag=v0.4.14 dirty=false
    • pipe skipped                                   reason=disabled during snapshot mode
  • parsing tag
  • setting defaults
  • snapshotting
    • building snapshot...                           version=0.4.16
  • running before hooks
    • running                                        hook=go generate
    • running                                        hook=go run github.com/google/go-licenses@latest check . --disallowed_types=restricted
    • running                                        hook=go mod tidy
    • running                                        hook=go test -race -v ./...
    • took: 9s
  ⨯ build failed after 9s                    error=hook failed: shell: 'go test -race -v ./...': exit status 1: # github.com/IceWhaleTech/CasaOS/service
service/connections.go:70:8: undefined: unix.MS_NOATIME
service/connections.go:70:24: undefined: unix.MS_NODEV
service/connections.go:70:38: undefined: unix.MS_NOSUID
service/connections.go:71:3: too many arguments in call to unix.Mount
	have (string, string, string, unknown type, string)
	want (string, string, int, unsafe.Pointer)
service/connections.go:79:15: undefined: mount.Unmount
FAIL	github.com/IceWhaleTech/CasaOS [build failed]
?   	github.com/IceWhaleTech/CasaOS/cmd/message-bus-docgen	[no test files]
FAIL	github.com/IceWhaleTech/CasaOS/cmd/migration-tool [build failed]
?   	github.com/IceWhaleTech/CasaOS/codegen	[no test files]
?   	github.com/IceWhaleTech/CasaOS/codegen/message_bus	[no test files]
?   	github.com/IceWhaleTech/CasaOS/common	[no test files]
?   	github.com/IceWhaleTech/CasaOS/drivers	[no test files]
?   	github.com/IceWhaleTech/CasaOS/drivers/base	[no test files]
?   	github.com/IceWhaleTech/CasaOS/drivers/dropbox	[no test files]
?   	github.com/IceWhaleTech/CasaOS/drivers/google_drive	[no test files]
?   	github.com/IceWhaleTech/CasaOS/drivers/onedrive	[no test files]
?   	github.com/IceWhaleTech/CasaOS/interfaces	[no test files]
?   	github.com/IceWhaleTech/CasaOS/internal/conf	[no test files]
?   	github.com/IceWhaleTech/CasaOS/internal/driver	[no test files]
?   	github.com/IceWhaleTech/CasaOS/internal/op	[no test files]
?   	github.com/IceWhaleTech/CasaOS/internal/sign	[no test files]
?   	github.com/IceWhaleTech/CasaOS/model	[no test files]
?   	github.com/IceWhaleTech/CasaOS/model/notify	[no test files]
?   	github.com/IceWhaleTech/CasaOS/model/system_app	[no test files]
?   	github.com/IceWhaleTech/CasaOS/model/system_model	[no test files]
?   	github.com/IceWhaleTech/CasaOS/pkg/cache	[no test files]
?   	github.com/IceWhaleTech/CasaOS/pkg/config	[no test files]
?   	github.com/IceWhaleTech/CasaOS/pkg/ddns	[no test files]
?   	github.com/IceWhaleTech/CasaOS/pkg/fs	[no test files]
?   	github.com/IceWhaleTech/CasaOS/pkg/generic_sync	[no test files]
?   	github.com/IceWhaleTech/CasaOS/pkg/github	[no test files]
?   	github.com/IceWhaleTech/CasaOS/pkg/gredis	[no test files]
?   	github.com/IceWhaleTech/CasaOS/pkg/samba	[no test files]
?   	github.com/IceWhaleTech/CasaOS/pkg/sign	[no test files]
?   	github.com/IceWhaleTech/CasaOS/pkg/singleflight	[no test files]
?   	github.com/IceWhaleTech/CasaOS/pkg/utils/common_err	[no test files]
?   	github.com/IceWhaleTech/CasaOS/pkg/utils/encryption	[no test files]
=== RUN   TestGetDb
--- PASS: TestGetDb (0.00s)
PASS
ok  	github.com/IceWhaleTech/CasaOS/pkg/sqlite	(cached)
=== RUN   TestGetResultTest
    network_detection_test.go:20: This test is always failing. Skipped to unblock releasing - MUST FIX!
--- SKIP: TestGetResultTest (0.00s)
PASS
ok  	github.com/IceWhaleTech/CasaOS/pkg/utils	(cached)
?   	github.com/IceWhaleTech/CasaOS/pkg/utils/httper	[no test files]
=== RUN   TestNameAccumulation
aaa
/mnt/test_1_1
--- PASS: TestNameAccumulation (0.00s)
PASS
ok  	github.com/IceWhaleTech/CasaOS/pkg/utils/file	(cached)
?   	github.com/IceWhaleTech/CasaOS/pkg/utils/version	[no test files]
FAIL	github.com/IceWhaleTech/CasaOS/route [build failed]
FAIL	github.com/IceWhaleTech/CasaOS/route/v1 [build failed]
FAIL	github.com/IceWhaleTech/CasaOS/route/v2 [build failed]
FAIL	github.com/IceWhaleTech/CasaOS/service [build failed]
?   	github.com/IceWhaleTech/CasaOS/service/model	[no test files]
?   	github.com/IceWhaleTech/CasaOS/types	[no test files]
=== RUN   TestGetExternalIPV4
194.53.114.2
--- PASS: TestGetExternalIPV4 (0.24s)
=== RUN   TestGetExternalIPV6
Get "https://api6.ipify.org": dial tcp [2607:f2d8:1:3c::4]:443: connect: no route to host

--- PASS: TestGetExternalIPV6 (0.20s)
=== RUN   TestGetLoclIp
192.168.68.51
--- PASS: TestGetLoclIp (0.00s)
=== RUN   TestHasLocalIP
dddd
true
--- PASS: TestHasLocalIP (0.00s)
PASS
ok  	github.com/IceWhaleTech/CasaOS/pkg/utils/ip_helper	(cached)
FAIL
~/g/CasaOS►pwd                                                 9.698s (main) 14:24
/Users/rlopezlopez/go/CasaOS

robertolopezlopez avatar Dec 22 '24 13:12 robertolopezlopez