mudasobwa
`Code.compile_quoted/2` leaves errors in `spawn_workers/8` errors
Most likely my use-case is not common, but still.
If Code.compile_quoted/2 is called during compile time, it leaves errors in the parallel compiler accumulator, even if rescued. That leads to that when the compilation ends, the compiler itself raises at lib/elixir/lib/kernel/parallel_compiler.ex:458.
defp spawn_workers([], spawned, waiting, files, result, warnings, errors, state)
when map_size(spawned) == 0 and map_size(waiting) == 0 do
[] = errors # bang
[] = files
This was probably not the case at all until Code.with_diagnostics/2 happened to appear. Its sole purpose is to try the code and see how it goes, but if it calls Code.compile_quoted/2 underneath, the whole compilation process fails afterwards, when the compilation has been actually succeeded.
I was unable to figure out how one might un-add the compilation error produced by Code.compile_quoted/2 during compile time, that’s why I would kinda propose an option to Code.with_diagnostics/2 as keep_errors: boolean() to prevent leaking these errors to the main parallel compiler process.
Marked As Solved
josevalim
Please file an issue report with a small way to reproduce it, thank you!
Also Liked
mudasobwa
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









