anz-bank / sysl

Sysl (pronounced "sizzle") is a system specification language
https://sysl.io
Apache License 2.0
122 stars 42 forks source link

The generated project could not run on Apple M1 #1064

Closed weixu365 closed 3 years ago

weixu365 commented 3 years ago

Please do not post any internal, closed source snippets on this public issue tracker!

Description

The generated project could not start on Apple M1

Steps to Reproduce

After following https://sysl.io/docs/tutorial-codegen to create a new project, it fails when I run go run cmd/Petdemo/main.go config/config.yaml with the following command:

% go run cmd/Petdemo/main.go config/config.yaml

Expected behavior

Start server

Actual behavior

Showing the following errors then stopped

% go run -v cmd/Petdemo/main.go
# command-line-arguments
github.com/arr-ai/hash.aeshash: relocation target aeshashbody not defined
github.com/arr-ai/hash.aeshashstr: relocation target aeshashbody not defined

Your Environment

% sysl info
Build:
  Version      : v0.372.0
  Git Commit   : 387a32c5f691ad4f19bc0dc19ace14c18a9909ff
  Date         : 2021-05-10T22:49:22Z
  Go Version   : go1.16.3 darwin/arm64
  OS           : darwin/arm64

My Temp Solution

The error is caused by the old version of arr-ai/hash, it works after using the latest version

% go get github.com/arr-ai/hash                   
go get: upgraded github.com/arr-ai/hash v0.5.0 => v0.8.0

% cat go.mod 
module github.com/anz-bank/sysl-go-demo

go 1.16

require (
        github.com/anz-bank/sysl-go v0.192.0
        github.com/arr-ai/hash v0.8.0 // indirect
        github.com/go-chi/chi v4.1.2+incompatible
)

% go run -v cmd/Petdemo/main.go config/config.yaml     
2021-05-11T12:49:36.174036+10:00 INFO no AdminServerConfig for REST was found 
2021-05-11T12:49:36.174054+10:00 INFO found PublicServerConfig for REST 
2021-05-11T12:49:36.174095+10:00 INFO configured listener for address: :6060/ 
2021-05-11T12:49:36.174101+10:00 INFO no GrpcPublicServerConfig for gRPC was found 
2021-05-11T12:49:36.17422+10:00 INFO starting sub-server 1 of 1 (REST Public Server) 
2021-05-11T12:49:36.174225+10:00 INFO no TLS configuration present. Preparing to serve HTTP for address: :6060/ 
andrewemeryanz commented 3 years ago

Fixed in https://github.com/anz-bank/sysl-go-demo/commit/d194f2216b1f034fd75b538f87900de13852fad9.