-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add package
magic script
#1771
Milestone
Comments
Merged
github-merge-queue bot
pushed a commit
that referenced
this issue
Dec 16, 2024
fixes #1771 commit-id:40843cae --- **Stack**: - #1846 - #1836 ⬅⚠️ *Part of a stack created by [spr](https://github.com/ejoffe/spr). Do not merge manually using the UI - doing so may have unexpected results.* Co-authored-by: Mateusz Kowalski <mateusz.kowalski@swmansion.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add a new “magic” script (magic in that sense that Scarb has some logic that makes use of this script, like the test one being also used by
scarb test
command) calledpackage
. While runningscarb package
it will look for this script and, if present, it will execute it after preparing the tarball directory and before making an archive. The script will be run withPWD
set to tarball preparation directory (unlike package directory, this is important and is exceptional!).This script will be used to automate prebuilding macros (as an alternative to forcing devs to do this manually, see #1770). The rough procedure should look like this:
target/scarb/cairo-plugin
in tarball preparation directory.rustup component add $TARGET
(avoid doing that if we can cheaply detect if it’s already installed)cargo build --target $TARGET
to build the plugin (note: ensure cargo shows a clear message if any build tools are missing)*.so/*.dll
+ debug info files totarget/scarb/cairo-plugin
directory, following this naming pattern:${PACKAGE_NAME}_v${PACKAGE_VERSION}_${TARGET}.${so|dylib|dll}
Example: usage by Starknet Foundry
Starknet Foundry will use the script mechanism in their CI for automatic packaging. It will implement the packaging procedure as a bash script that will be committed to the repository and hooked as a package script.
We will ask Dojo people to copy Foundry’s approach.
So, Foundry plugin will change its Scarb.toml to look as follows:
Note
No such task was created in Foundry repo.
The text was updated successfully, but these errors were encountered: