software-mansion / scarb

The Cairo package manager
http://docs.swmansion.com/scarb/
MIT License
174 stars 52 forks source link

Support package experimental features configuration #990

Closed maciektr closed 5 months ago

maciektr commented 7 months ago

Problem

The https://github.com/starkware-libs/cairo/pull/4497 has introduced support for experimental feature flags. The feature flags are defined as a serializable struct ExperimentalFeaturesConfig. This is a per-crate setting that is exposed as of CrateSettings. In Scarb, we set CrateSettings for packages we compile in https://github.com/software-mansion/scarb/blob/9b9acc1fc6f9f0f43810030c6ac5b2c6500cc077/scarb/src/compiler/db.rs#L98 .

The experimental feature flags should be exposed in Scarb package manifest, serialized and passed into the compiler during compilation as of CrateSettings struct (similar to what we do with allow_warnings and edition fields).

Proposed Solution

No response

Notes

No response

maciektr commented 7 months ago

Also, add support in cairo language server https://github.com/starkware-libs/cairo/blob/d4a3f45120d306e5d63a7043e4dfa923e9f02cef/crates/cairo-lang-language-server/src/scarb_service.rs#L103C1-L103C1

maciektr commented 7 months ago

Do not forget to add to snforge collector https://github.com/software-mansion/scarb/blob/d798ec2b3367642bd536f7a423c69bc5aaf27add/extensions/scarb-snforge-test-collector/src/metadata.rs#L96