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

Implement loading of prebuilt macros #1768

Open
mkaput opened this issue Nov 25, 2024 · 0 comments
Open

Implement loading of prebuilt macros #1768

mkaput opened this issue Nov 25, 2024 · 0 comments
Assignees

Comments

@mkaput
Copy link
Member

mkaput commented Nov 25, 2024

Allow macro developers to cross-compile their macros for all relevant platforms and include generated binaries in package tarballs during scarb package. The goal of this task is to teach Scarb to look for such binaries in package sources and prefer it over compiling macros locally.

Platform support

Binaries should be produced for all platforms supported by Scarb, and Scarb should attempt to load them on all of these:

  • aarch64-apple-darwin
  • aarch64-unknown-linux-gnu
  • x86_64-apple-darwin
  • x86_64-pc-windows-msvc
  • x86_64-unknown-linux-gnu

What determines whether package contains prebuilt binaries?

Any Scarb package that contains a target/scarb/cairo-plugin directory in tarball is considered as one containing prebuilt binaries. This name was chosen because it nicely hides inside Scarb’s/Cargo’s standard build file directory, which is very likely to already be avoided in source repositories and thus shouldn’t conflict with package sources.
Within this directory, binaries for all platforms will follow the following naming pattern: ${PACKAGE_NAME}_v${PACKAGE_VERSION}_${TARGET}.${so|dylib|dll}

Loading

When loading procmacro package that is present in the allowlist (#1769), Scarb will look for the /target/scarb/cairo-plugin directory and will attempt to load a matching binary if present. In any case this loading process fails, Scarb will always fall back to source-code compilation. This will happen silently without any warnings.

@mkaput mkaput added this to the Proc Macro AOT Compilation milestone Nov 25, 2024
@github-project-automation github-project-automation bot moved this to Triage in Scarb Nov 25, 2024
@maciektr maciektr moved this from Triage to Todo in Scarb Nov 26, 2024
@DelevoXDG DelevoXDG moved this from Todo to In Progress in Scarb Nov 28, 2024
@maciektr maciektr moved this from In Progress to Done in Scarb Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants