Feature flags for shards (like features in Rust crates)

At some point we envision the idea of having some sort of configuration for crystal programs at build time. That concept I think it belongs more to a “project file” rather than “the dependency file”. And we currently don’t have a “project file”, we kind of overlap the two concepts in shards.

Leaving that aside for a moment, Crystal does not build each dependency. So it does not seem accurate to put configs in the dependency declaration.

I’m not sure what the post_install you want to configure does. But from the outside I would say that maybe the solution is not using post_install to build something. It might be enough to use it to scaffold some scripts or base code for your project that could be configurable by some mean.

I’m happy to follow a bit more of the details of a “project file” vs “the dependency file”, but maybe we can focus on the use case you have right now and how to find a solution with the current tools.

2 Likes