bitwalker / bitwalker/distillery

Running bat script fails with " eq was unexpected at this time. "

Open
#576 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Elixir
Stars
3k
Forks
398
PR merge metrics
No merged PRs in 30d

Description

### Steps to reproduce

Just a brief list of the steps required to produce the issue.

Not a code related so:

- Add `{:gun, "~> 1.3"}`
- Add `{:distillery, "~> 2.0"}`

### Verbose Logs

Paste the output of the release command you ran with the `--verbose` flag
below in the summary tags (this helps keep the issue easy to navigate):

```

==> Loading configuration..
==> Assembling release..
==> Building release engag:0.1.0 using environment prod
==> Discovered applications:
> cowlib-2.6.0
|
| from: _build/prod/lib/cowlib
| applications:
| :kernel
| :stdlib
| :crypto
| includes: none
|_____

> asn1-5.0.7
|
| from: c:/Program Files/erl10.1/lib/asn1-5.0.7
| applications:
| :kernel
| :stdlib
| includes: none
|_____

> public_key-1.6.2
|
| from: c:/Program Files/erl10.1/lib/public_key-1.6.2
| applications:
| :asn1
| :crypto
| :kernel
| :stdlib
| includes: none
|_____

> crypto-4.3.3
|
| from: c:/Program Files/erl10.1/lib/crypto-4.3.3
| applications:
| :kernel
| :stdlib
| includes: none
|_____

> ssl-9.0.2
|
| from: c:/Program Files/erl10.1/lib/ssl-9.0.2
| applications:
| :crypto
| :public_key
| :kernel
| :stdlib
| includes: none
|_____

> gun-1.3.0
|
| from: _build/prod/lib/gun
| applications:
| :kernel
| :stdlib
| :ssl
| :cowlib
| includes: none
|_____

> kernel-6.1
|
| from: c:/Program Files/erl10.1/lib/kernel-6.1
| applications: none
| includes: none
|_____

> artificery-0.2.6
|
| from: _build/prod/lib/artificery
| applications:
| :kernel
| :stdlib
| :elixir
| includes: none
|_____

> distillery-2.0.10
|
| from: _build/prod/lib/distillery
| applications:
| :kernel
| :stdlib
| :elixir
| :runtime_tools
| :artificery
| includes: none
|_____

> logger-1.7.3
|
| from: c:/Program Files (x86)/Elixir/lib/logger
| applications:
| :kernel
| :stdlib
| :elixir
| includes: none
|_____

> engag-0.1.0
|
| from: _build/prod/lib/engag
| applications:
| :kernel
| :stdlib
| :elixir
| :logger
| :distillery
| :gun
| includes: none
|_____

> runtime_tools-1.13.1
|
| from: c:/Program Files/erl10.1/lib/runtime_tools-1.13.1
| applications:
| :kernel
| :stdlib
| includes: none
|_____

> stdlib-3.6
|
| from: c:/Program Files/erl10.1/lib/stdlib-3.6
| applications:
| :kernel
| includes: none
|_____

> compiler-7.2.5
|
| from: c:/Program Files/erl10.1/lib/compiler-7.2.5
| applications:
| :kernel
| :stdlib
| includes: none
|_____

> sasl-3.2.1
|
| from: c:/Program Files/erl10.1/lib/sasl-3.2.1
| applications:
| :kernel
| :stdlib
| includes: none
|_____

> iex-1.7.3
|
| from: c:/Program Files (x86)/Elixir/lib/iex
| applications:
| :kernel
| :stdlib
| :elixir
| includes: none
|_____

> mix-1.7.3
|
| from: c:/Program Files (x86)/Elixir/lib/mix
| applications:
| :kernel
| :stdlib
| :elixir
| includes: none
|_____

> elixir-1.7.3
|
| from: c:/Program Files (x86)/Elixir/lib/elixir
| applications:
| :kernel
| :stdlib
| :compiler
| includes: none
|_____

==> Running validation checks..
> Mix.Releases.Checks.Erts * PASS
> Mix.Releases.Checks.Cookie * PASS
> Mix.Releases.Checks.LoadedOrphanedApps * PASS
==> Generated overlay vars:
release_name=:engag
release_version="0.1.0"
is_upgrade=false
upgrade_from=:latest
dev_mode=false
include_erts=true
include_src=false
include_system_libs=true
erl_opts=""
run_erl_env=""
erts_vsn="10.1"
output_dir="_build/prod/rel/engag"
==> Copying applications to _build/prod/rel/engag
==> Generating start_erl.data
==> Generating vm.args
==> Generating sys.config from config/config.exs
==> Including ERTS 10.1 from c:/Program Files/erl10.1/erts-10.1
==> Generating boot scripts
==> Generating RELEASES
==> Applying overlays
==> Applying mkdir overlay
dst: releases/0.1.0/hooks
==> Applying mkdir overlay
dst: releases/0.1.0/hooks/pre_configure.d
==> Applying mkdir overlay
dst: releases/0.1.0/hooks/post_configure.d
==> Applying mkdir overlay
dst: releases/0.1.0/hooks/pre_start.d
==> Applying mkdir overlay
dst: releases/0.1.0/hooks/post_start.d
==> Applying mkdir overlay
dst: releases/0.1.0/hooks/pre_stop.d
==> Applying mkdir overlay
dst: releases/0.1.0/hooks/post_stop.d
==> Applying mkdir overlay
dst: releases/0.1.0/hooks/pre_upgrade.d
==> Applying mkdir overlay
dst: releases/0.1.0/hooks/post_upgrade.d
==> Applying copy overlay
src: _build/prod/lib/distillery/priv/libexec
dst: releases/0.1.0/libexec
==> Applying mkdir overlay
dst: releases/0.1.0/commands
==> Packaging release..
==> Archiving engag-0.1.0
==> Writing archive to c:/Users/evang/code/engag/_build/prod/rel/engag/releases/0.1.0/engag.tar.gz
==> Updating archive..
==> Including system libs from current Erlang installation
==> Saving archive..
==> Archive saved!
Release successfully built!
To start the release you have built, you can use one of the following tasks:

# start a shell, like 'iex -S mix'
> _build/prod/rel/engag/bin/engag.bat console

# start in the foreground, like 'mix run --no-halt'
> _build/prod/rel/engag/bin/engag.bat foreground

# start in the background, must be stopped with the 'stop' command
> _build/prod/rel/engag/bin/engag.bat start

If you started a release elsewhere, and wish to connect to it:

# connects a local shell to the running node
> _build/prod/rel/engag/bin/engag.bat remote_console

# connects directly to the running node's console
> _build/prod/rel/engag/bin/engag.bat attach

For a complete listing of commands and their use:

> _build/prod/rel/engag/bin/engag.bat help
```

### Description of issue
On **Windows** I can not run any script that starts the release, I tried on Git Bash, built-in Powershell, and cmd. All of them fail with :

```
$ _build/prod/rel/engag/bin/engag.bat console
eq was unexpected at this time.
```

I noticied that this bat script searches for a powershell script under releases folder, running that script directly works.

- What are the expected results?

Should be able to run a release on Windows

- What version of Distillery?

`2.0.10`

- What OS, Erlang/Elixir versions are you seeing this issue on?

- OS: Windows 10 Build 17134.345
- Elixir: 1.7.3
- Erlang: 21.1
- ERTS: 10.1

- If possible, also provide your `rel/config.exs`, as it is often
my first troubleshooting question, and you'll save us both time :)

It's the default one, but pasted below

```
# Import all plugins from `rel/plugins`
# They can then be used by adding `plugin MyPlugin` to
# either an environment, or release definition, where
# `MyPlugin` is the name of the plugin module.
~w(rel plugins *.exs)
|> Path.join()
|> Path.wildcard()
|> Enum.map(&Code.eval_file(&1))

use Mix.Releases.Config,
# This sets the default release built by `mix release`
default_release: :default,
# This sets the default environment used by `mix release`
default_environment: Mix.env()

# For a full list of config options for both releases
# and environments, visit https://hexdocs.pm/distillery/config/distillery.html

# You may define one or more environments in this file,
# an environment's settings will override those of a release
# when building in that environment, this combination of release
# and environment configuration is called a profile

environment :dev do
# If you are running Phoenix, you should make sure that
# server: true is set and the code reloader is disabled,
# even in dev mode.
# It is recommended that you build with MIX_ENV=prod and pass
# the --env flag to Distillery explicitly if you want to use
# dev mode.
set dev_mode: true
set include_erts: false
set cookie: :"50{oz]wt15vsp|&myNR>L;qVb%4w.5}|Vl`sgKk$XP`)SAd9^aS3_BF3?6h4fhvU"
end

environment :prod do
set include_erts: true
set include_src: false
set cookie: :"{2nm_PXyOjt9`U9{Z:zo@YIH&^m3k17wCs1RM[%)~]E7_Uo6C4)>FE.@4q5@^!|G"
end

# You may define one or more releases in this file.
# If you have not set a default release, or selected one
# when running `mix release`, the first release in the file
# will be used by default

release :engag do
set version: current_version(:engag)
set applications: [
:runtime_tools
]
end

```

- Is there documentation that says one thing, but Distillery does
another? If so, please link the doc here so it can be updated if
it's a documentation issue, or so that the fix can be based around
what's documented.
- If this is a runtime configuration issue, please also provide your config file
(with any sensitive information stripped of course). This is almost
always necessary to understand why some configuration may not be working.

If you do not provide the above information and I need it to help troubleshoot, it may delay things significantly,
as I will have to ask you for all of these things anyway. Help me help you!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.