Skip to content

fix: use rust-embed for DSL files#212

Open
kevaundray wants to merge 1 commit intoleanEthereum:mainfrom
kevaundray:kw/rust-embed-src-code
Open

fix: use rust-embed for DSL files#212
kevaundray wants to merge 1 commit intoleanEthereum:mainfrom
kevaundray:kw/rust-embed-src-code

Conversation

@kevaundray
Copy link
Copy Markdown

@kevaundray kevaundray commented May 5, 2026

Problem

env! is evaluated at build time, so for example if we compile the crate into static libraries, the path to the DSL files will be hardcoded into the binary. This will be something like /user/tom/leanMultiSig/main.py. This is usually okay for local development, however when we want to package this so that we can use it in Python, the path will be fetched at runtime.

Potential solutions

There are two solutions that I know of for solving this:

  • explicitly pass the path to main.py in as a parameter when compiling main
  • ensure that even after compiling, we have a valid path to the main.py file

This PR goes with the second option, by embedding the dsl files into the binary with rust-embed and then creating a path to them at runtime when needed. This means that users of this library will not need to worry about supplying a path to the main.py file.

@kevaundray kevaundray marked this pull request as ready for review May 5, 2026 18:51
@kevaundray kevaundray force-pushed the kw/rust-embed-src-code branch from 7b5b674 to 350e5b0 Compare May 5, 2026 19:14
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.

1 participant