-
Notifications
You must be signed in to change notification settings - Fork 0
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
Support crystal 0.36.1+ #5
Conversation
Looks to be a fun new compatibility issue in |
Well this is supremely inconvenient. As macro's must be defined prior to usage, and in this case usage is part of the prelude libs, I cannot see a workable resolution. Considered options (none are good):
Very open to other ideas or approaches. |
they've already re-introduced |
Support for defining operator macros is back, however there is also now a call to Macro’s must be defined before they are called as that stage of compilation is single pass. As this call happens before anything here is parsed, this breaks the compiler. |
can't hurt making a pull request, fewer macros used before user code the better I would think |
It only becomes a macro when introduced via this library. The default implementation for |
maybe we use a different namespace? Then we use that for all our projects |
I don't think that's a good approach. The original purpose of this lib was to transparently insert the ability to pull from either the environment or a secret store, with no API changes. Tracking of what is accessed was introduced as a secondary feature purely to support auto-generation of CLI output. The runtime tracking is solid (and arguably provides value for auditing purposes of accessed secrets), it's the hackery for the compile time resolution that introduces the fragility. For that use case, a secondary module namespace may be used ( |
@xxkb would overriding the default crystal lang prelude to inject the old behaviour before kernel is loaded work? Tiny bit more work on our end, but would then provide the original behaviour - which was super handy |
I don't think you can do it via a IMHO it seems to be an excessively convoluted workaround for just explicitly specifying what env vars are tweakable. Unless there is another use case that I'm missing? |
it's just super useful as a bunch of ENV vars are hidden in different shards, so for any project it's reasonably difficult to work out what's available / being able to put anything into secrets I think it's worth doing via the build command for our projects / adding support for a custom prelude in this project |
Yep cool, the cross shard tracking is a good one. From what I can see usage is limited to SG services only. What about rolling this functionality into the base app template. This way it can host the pre-prelude macro injection and ensure it's used in the compile step in the Dockerfile. |
that's exactly what I was thinking! |
to clarify, thinking this app hosts the prelude file and the base app template can ensure it's included |
Narrows special case behaviour introduced in #4 to crystal 0.36.0 only.
Support for operator based macro's re-introduced to compiler.