Skip to content

Commit aca578b

Browse files
committed
Add a note about native code in mix releases, closes #14386
1 parent a87eb7d commit aca578b

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

lib/elixir/lib/kernel/parallel_compiler.ex

+14-5
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,13 @@ defmodule Kernel.ParallelCompiler do
135135
136136
* `:each_long_compilation` - for each file that takes more than a given
137137
timeout (see the `:long_compilation_threshold` option) to compile, invoke
138-
this callback passing the file as its argument
138+
this callback passing the file as its argument (and optionally the PID
139+
of the process compiling the file)
140+
141+
* `:each_long_verification` (since v1.19.0) - for each file that takes more
142+
than a given timeout (see the `:long_verification_threshold` option) to
143+
compile, invoke this callback passing the module as its argument (and
144+
optionally the PID of the process verifying the module)
139145
140146
* `:each_module` - for each module compiled, invokes the callback passing
141147
the file, module and the module bytecode
@@ -147,11 +153,14 @@ defmodule Kernel.ParallelCompiler do
147153
* `{:runtime, modules, warnings}` - to stop compilation and verify the list
148154
of modules because dependent modules have changed
149155
150-
* `:long_compilation_threshold` - the timeout (in seconds) to check for modules
156+
* `:long_compilation_threshold` - the timeout (in seconds) to check for files
151157
taking too long to compile. For each file that exceeds the threshold, the
152-
`:each_long_compilation` callback is invoked. From Elixir v1.11, only the time
153-
spent compiling the actual module is taken into account by the threshold, the
154-
time spent waiting is not considered. Defaults to `10` seconds.
158+
`:each_long_compilation` callback is invoked. Defaults to `10` seconds.
159+
160+
* `:long_verification_threshold` (since v1.19.0) - the timeout (in seconds) to
161+
check for modules taking too long to compile. For each module that exceeds the
162+
threshold, the `:each_long_verification` callback is invoked. Defaults to
163+
`10` seconds.
155164
156165
* `:profile` - if set to `:time` measure the compilation time of each compilation cycle
157166
and group pass checker

lib/mix/lib/mix/tasks/release.ex

+4-1
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,10 @@ defmodule Mix.Tasks.Release do
682682
You can configure the "tmp" directory by setting the `RELEASE_TMP` environment
683683
variable, either explicitly or inside your `releases/RELEASE_VSN/env.sh`
684684
(or `env.bat` on Windows). Defaults to `true` if using the deprecated
685-
`config/releases.exs`, `false` otherwise.
685+
`config/releases.exs`, `false` otherwise. Be careful of which libraries you
686+
load when setting this option to true, if a library is loaded early during
687+
configuration and it includes native code, it may not actually be able to
688+
restart cleanly.
686689
687690
* `:prune_runtime_sys_config_after_boot` - if `:reboot_system_after_config`
688691
is set, every time your system boots, the release will write a config file

0 commit comments

Comments
 (0)