Skip to content

Mix wrongly passing flag to dependency tasks #10982

@szymon-jez

Description

@szymon-jez

Precheck

Checked and this looks like a bug.

Environment

Elixir & Erlang/OTP versions (elixir --version):

Erlang/OTP 23 [erts-11.2.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]

Elixir 1.10.4 (compiled with Erlang/OTP 23)

and

Erlang/OTP 23 [erts-11.2.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe]
Elixir 1.11.4 (compiled with Erlang/OTP 23)

Operating system

Linux

Current behavior

Passing the --force flag to mix ecto.load causes it to run the compile task. It wrongly passes that flag to the dependency task.

Reproduction

  1. git clone https://github.com/socialpaymentsbv/mix-flag-bug-example && cd mix-flag-bug-example
  2. mix do deps.get, compile
  3. mix ecto.load --force
  4. observe recompilation
Control run

Control run to make sure that the --force flag is indeed causing this and not something else.

  1. mix ecto.load
  2. Observe no recompilation

Expected behavior

Running mix ecto.load --force should not force recompilation. It should only "not ask for confirmation when loading data" as mix help ecto.load says.

In other (more generic) words: Mix – as it is with Erlang/OTP 22 – should not pass the flags supplied (e.g. --force) to the runned task (e.g. ecto.load) to dependant tasks (e.g. compile).

Workaround

In ecto.load the workaround that can be applied is passing the flag --no-compile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions