Closed thorsten-de closed 5 years ago
After using the proper path for CONSOLIDATED_DIR,
I logged Protocol.consolidated?(String.Chars)
inside my app. The results are confusing:
foreground
command uses consolidated protocols.console
doesn't use consolidated protocols at all. I don't know if thats for some reason or a bug. After appending @("-pa", $Env:CONSOLIDATED_DIR)
to the console command args, protocol consoldation works.install
gets the correct dir for erlsrv add and installs the args correctly. But, as logs show, the started service don't use consolidated protocols. Very confusing.This should be fixed in master/2.0.x branches:
console
wasn't properly setting up the arguments to werl
like foreground
wasinstall
needed a similar treatment as console
, but slightly different
Steps to reproduce
Build a windows release, start a console and check if protocols are consolidated.
Description of issue
Solution
The generated powershell script sets CONSOLIDATED_DIR incorrectly:
$Env:CONSOLIDATED_DIR = (join-path $release_root_dir (join-path ("{0}-{1}" -f $rel_name,$rel_vsn) "consolidated")
That results in a path like:
_build\prod\rel\tc\tc-1.0.0\consolidated\
, where the "lib" subdir is missing.So, it should be joined to release_lib_dir, not to release_root. See https://hexdocs.pm/mix/Mix.Tasks.Compile.Protocols.html for more information.
Btw, the corresponding bash script sets it properly:
CONSOLIDATED_DIR="${RELEASE_ROOT_DIR}/lib/${REL_NAME}-${REL_VSN}/consolidated"
I'll try to patch that during this weekend.