ugexe / zef

Raku Module Management
Artistic License 2.0
206 stars 44 forks source link

Add `--precomp` flag to zef #547

Closed ugexe closed 5 months ago

ugexe commented 5 months ago

Context

CURI.install(...) receieved a :$precompile option at some point. Zef could provide a command line flag to allow using that option to disable installation precompilation.

Expected Behavior

# Default: precompilation is enabled
zef install . --install-precompile

# Precompilation is disabled
zef install . --/install-precompile

Implementation Notes

  1. Add a Bool :$install-precompile = True flag to the install MAIN multi here.
  2. Add a Bool :$install-precompile is rw = True attribute to Zef::Client
  3. Pass the new :$install-precompile through to create the new install client here

at this point the staging workflow is handled, but we have to handle the legacy workflow still

  1. Add :precompile($!install-precompile) to this .install call
  2. Add a Bool :$precompile = True to this method signature
  3. Pass :$precompile through this call to .install(...)
  4. Add a Bool :$precompile = True to this method signature
  5. Pass :$precompile to this method call
  6. Go over any of the files edited and update any existing pod6 referencing updated method signatures
  7. Update USAGE to show the new flag, something like --/install-precompile Do not precompile module during installation
  8. I'm not really sure how to test this. We could probably just update this to run with --/install-precompile (don't forget to update the comment) to ensure the flag itself doesn't break anything when used.
ugexe commented 5 months ago

I chose the name :$install-precompile for two reasons. First is this only disables precompilation on install - when doing zef test . it wouldn't be disabled, as that does not use a staging workflow like the testing that happens with zef install .. In the future maybe we will want a way to do --/test-precompile. Second is that we already have a pattern for flags that affect specific phases such as --/test-depends and --install-timeout.

edit: I changed my mind and went with :$precompile-install 😄