Skip to content

Improve FFI behavior for unsupported architectures #886

@aaronbuchwald

Description

@aaronbuchwald

After #868 we push pre-built binaries to https://github.com/ava-labs/firewood-go , so that golang consumers can use the library directly without compiling firewood locally.

However, if you use an architecture that we don't include a pre-built binary for, those programs will get a linking error.

To improve this behavior, we should instead use build constraints to switch between a correctly functioning version of Firewood and a version that returns a special case error if constructing an instance of firewood on an unsupported architecture.

This ensures that if you are for example using Firewood as an optional backend in AvalancheGo/Coreth, you will get an error only when selecting that option and trying to construct an instance of Firewood rather than causing the program to completely fail to compile.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions