Skip to content

Makefile has race conditions (exposed by -j4) #12320

@gdt

Description

@gdt

Elixir and Erlang/OTP versions

Erlang/OTP 25 [erts-13.1.2] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [jit:ns]

Elixir 1.14.2 (compiled with Erlang/OTP 25)

Operating system

NetBSD 9 and 10, amd64

Current behavior

Running gmake -j4 leads to:

==> bootstrap (compile)
==> eex (compile)
==> mix (compile)
{"init terminating in do_boot",{undef,[{'Elixir.Kernel.CLI',main,[["-e","Mix.start(:permanent, [])","-r","mix.exs","-e","Mix.Task.run(\"compile.app\", ~w[--compile-path ebin])"]],[]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}
init terminating in do_boot ({undef,[{Elixir.Kernel.CLI,main,-eMix.start(:permanent, [])-rmix.exs-eMix.Task.run("compile.app", ~w[--compile-path ebin]),[]},{init,start_em,1,[]},{init,do_boot,3,[]}]})

Crash dump is being written to: erl_crash.dump...done

Without -j, the builds are serialized and work as expected and pass tests. Above, note bootstrap/eex/mix are all started at the same time.

I noticed this in pkgsrc, which is often configured for parallel builds to use multiple CPUs.

Expected behavior

I expect the Makefile to express dependencies and not use build outputs from other rules without waiting.

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