AzureAD / microsoft-authentication-extensions-for-go

Secure cross-platform token cache for MSAL public client apps
MIT License
1 stars 1 forks source link

Building on Linux doesn't work #27

Open mjnovice opened 2 months ago

mjnovice commented 2 months ago

If I try to build my client on linux it breaks

env GOOS=linux GOARCH=amd64 go build -o cliamd64
# github.com/UiPath/Tetris/cmd/cli/client
client/create.go:81:33: undefined: msalAccessor.New

while it works on macOS. Any reasons why ?

chlowell commented 2 months ago

The Linux build (also) requires cgo and a platform specific toolchain: https://github.com/AzureAD/microsoft-authentication-extensions-for-go/blob/118813276aa9e603b389a54322408fc5cf59f7eb/cache/accessor/linux.go#L10-L12

That error suggests you're building with CGO_ENABLED=0 but setting it to 1 isn't necessarily enough to build--you need the toolchain in any case.