Skip to content

Experiment with loading modules lazily during compilation #14451

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

Closed
wants to merge 3 commits into from

Conversation

josevalim
Copy link
Member

No description provided.

@josevalim
Copy link
Member Author

Unfortunately this may break packages in rare cases (so far when NIFs are involved, see akash-akya/vix#198), so this will be v1.19 only.

@josevalim
Copy link
Member Author

See #14453 for this branch applied to v1.19. This branch will be kept around for a bit for those who want to try it on v1.18.

@josevalim josevalim closed this Apr 26, 2025
zachdaniel added a commit to zachdaniel/absinthe that referenced this pull request Apr 28, 2025
While investigating the changes in this PR:
elixir-lang/elixir#14451

I encountered an error about not being able to load a module at
this line, implying this is called at compile time.

@josevalim pointed out that `Code.ensure_loaded!/1` will have no effect
at compile time, and so this was really just relying on compile order
and would be non-deterministic. `Code.ensure_compiled!/1` is a superset
of `Code.ensure_loaded!/1` and will work at compile time to ensure the depended
on module is compiled.

This would appear to solve absinthe-graphql#1351.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant