You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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) called package. While running scarb 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 with PWD 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:
Create directory target/scarb/cairo-plugin in tarball preparation directory.
For each target triplet (see platform support for full list):
call rustup component add $TARGET (avoid doing that if we can cheaply detect if it’s already installed)
call cargo build --target $TARGET to build the plugin (note: ensure cargo shows a clear message if any build tools are missing)
copy generated *.so/*.dll + debug info files to target/scarb/cairo-plugin directory, following this naming pattern: ${PACKAGE_NAME}_v${PACKAGE_VERSION}_${TARGET}.${so|dylib|dll}
Ensure no other garbage is left in tarball directory. We do not want to publish unwanted files!
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:
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: