ebitengine / purego

Apache License 2.0
1.94k stars 63 forks source link

all: allow running programs that import purego in the playground #220

Closed TotallyGamerJet closed 3 months ago

TotallyGamerJet commented 3 months ago

Currently, if a package imports purego in the playground even if none of the functions are called the run will fail with a complaint about unable to link in libdl.so.2. This commit circumvents this by stubbing out the dynamic linking pragmas for the go playground (//go:build faketime). This allows building and running apps in the playground that import purego but doesn't allow actually calling any of the functions. Currently, it will just die very ungracefully.

Playground: https://go.dev/play/p/t3PK-iTWSl- Remove the replace in the go.mod to see old behavior.