Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

TotallyGamerJet
Copy link
Collaborator

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.

Copy link
Member

@hajimehoshi hajimehoshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

We can add kinder error messages instead of crash later.

@TotallyGamerJet TotallyGamerJet merged commit 05c9a4c into ebitengine:main Mar 28, 2024
20 checks passed
@TotallyGamerJet TotallyGamerJet deleted the playground branch March 28, 2024 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants