Derive the import namespace from the provider module #786
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the change
Updates the provider to have a custom section named
import_namespace
and has the Javy CLI use that custom section to determine what import namespace to use when creating dynamically linked modules.Why am I making this change?
Part of #768. This change will allow plugins to specify their own import namespaces instead of having to use one set in the Javy CLI. Also arguably, javy-core should be responsible for saying when to bump any version and not the CLI.
I had a little trouble figuring out a logical place to put the
derive_import_namespace_from_provider
function. I'm putting it in thebytecode
module for now. Arguably we could introduce an abstraction around providers with various methods for things like getting a byte slice for writing to disk, performing bytecode compilation, and getting the import namespace. I'll probably need to do that refactoring very shortly to accommodate some changes I want to make to codegen so I'm thinking it makes sense to punt until I'm working on that.Checklist
javy-cli
andjavy-core
do not require updating CHANGELOG files.