Skip to content

Conversation

@dmitrykleymenov
Copy link
Contributor

iex> Code.loaded?(Atom) gave race condition, at least localy.

Code.get_compiler_option(:debug_info)
#=> true
iex> Code.get_compiler_option(:debug_info)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is reading global state and some tests may change this.

Copy link
Contributor Author

@dmitrykleymenov dmitrykleymenov Apr 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I get it, with mix test it could be false. And put into it is even worse. Reverted, will be more careful with changes

Code.put_compiler_option(:debug_info, true)
#=> :ok
iex> Code.put_compiler_option(:debug_info, true)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. May affect global state. We should revert.

iex> Code.loaded?(Atom)
true
Code.loaded?(Atom)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this and use a module that is likely to already be loaded, such as Enum or String. Atom indeed may not be loaded.

@josevalim josevalim merged commit dfb2f1c into elixir-lang:main Apr 28, 2025
11 checks passed
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

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.

2 participants