axelson

axelson

Scenic Core Team

So I’m trying to get automated testing running for elixir_sense but I’m running an issue. The tests only pass (currently) if Elixir is installed from source. So I want to see if I can install Elixir from source on Travis. Having not used Travis very much I’m not sure how to go about it. I know that you can add elixir: '1.7.0 to your .travis.yml to install elixir from a binary release, but I’m not sure about installing from source.

Of course I may also opt to get the test suite running without requiring a source-installation but I wanted to get everything setup on CI before that if possible.

Showing Posts 1 to 7

LostKobrakai

LostKobrakai

Installing elixir from source is actually quite simple if you have make and erlang. It’s basically cloneing the git repo and tell make to compile it.

https://github.com/elixir-lang/elixir#compiling-from-source

NobbZ

NobbZ

As @LostKobrakai suggest, just compile elixir in the before_script/install section of an erlang based image.

axelson

axelson OP

Scenic Core Team

Hmmm, no luck so far. Here is my current .travis.yml with some additional debug commands in it:

language: erlang

otp_release: 
  - '21.2'

before_script:
  - git clone https://github.com/elixir-lang/elixir.git
  - cd elixir
  - git checkout v1.7.1
  - make compile
  - rm -rf .git
  - make
  - sudo make install
  - cd ..

script:
  - ls
  - pwd
  - mix test

But mix test is failing with an error starting the logger:

=SUPERVISOR REPORT==== 17-Jan-2019::16:36:39.404684 ===
    supervisor: {local,'Elixir.Logger.Supervisor'}
    errorContext: start_error
    reason: noproc
    offender: [{pid,undefined},
               {id,'Elixir.Logger.ErrorHandler'},
               {mfargs,
                   {'Elixir.Logger.Watcher',watcher,
                       [error_logger,'Elixir.Logger.ErrorHandler',
                        {true,false,500},
                        link]}},
               {restart_type,permanent},
               {shutdown,5000},
               {child_type,worker}]
Full Output of mix test
$ mix test
=SUPERVISOR REPORT==== 17-Jan-2019::16:36:39.404684 ===
    supervisor: {local,'Elixir.Logger.Supervisor'}
    errorContext: start_error
    reason: noproc
    offender: [{pid,undefined},
               {id,'Elixir.Logger.ErrorHandler'},
               {mfargs,
                   {'Elixir.Logger.Watcher',watcher,
                       [error_logger,'Elixir.Logger.ErrorHandler',
                        {true,false,500},
                        link]}},
               {restart_type,permanent},
               {shutdown,5000},
               {child_type,worker}]
=CRASH REPORT==== 17-Jan-2019::16:36:39.404631 ===
  crasher:
    initial call: Elixir.Logger.Watcher:init/1
    pid: <0.90.0>
    registered_name: []
    exception exit: noproc
      in function  gen:do_for_proc/2 (gen.erl, line 228)
      in call from gen_event:rpc/2 (gen_event.erl, line 239)
      in call from 'Elixir.Logger.Watcher':init/1 (lib/logger/watcher.ex, line 66)
      in call from gen_server:init_it/2 (gen_server.erl, line 374)
      in call from gen_server:init_it/6 (gen_server.erl, line 342)
    ancestors: ['Elixir.Logger.Supervisor',<0.84.0>]
    message_queue_len: 0
    messages: []
    links: [<0.85.0>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 376
    stack_size: 27
    reductions: 253
  neighbours:
=CRASH REPORT==== 17-Jan-2019::16:36:39.416703 ===
  crasher:
    initial call: application_master:init/4
    pid: <0.83.0>
    registered_name: []
    exception exit: {{shutdown,
                         {failed_to_start_child,'Elixir.Logger.ErrorHandler',
                             noproc}},
                     {'Elixir.Logger.App',start,[normal,[]]}}
      in function  application_master:init/4 (application_master.erl, line 138)
    ancestors: [<0.82.0>]
    message_queue_len: 1
    messages: [{'EXIT',<0.84.0>,normal}]
    links: [<0.82.0>,<0.43.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 376
    stack_size: 27
    reductions: 193
  neighbours:
=INFO REPORT==== 17-Jan-2019::16:36:39.417765 ===
    application: logger
    exited: {{shutdown,
                 {failed_to_start_child,'Elixir.Logger.ErrorHandler',noproc}},
             {'Elixir.Logger.App',start,[normal,[]]}}
    type: temporary
** (Mix) Invalid Elixir version requirement ~> 1.5 in mix.exs file
The command "mix test" exited with 1.

The full travis run can be viewed here: https://travis-ci.com/axelson/elixir_sense/builds/97716464

Also puzzling is the last line of output:

** (Mix) Invalid Elixir version requirement ~> 1.5 in mix.exs file

But it isn’t an invalid requirement… I would expect something more like what I get if I set the requirement to ~> 1.8:

** (Mix) You're trying to run :elixir_sense on Elixir v1.7.1 but it has declared in its mix.exs file it supports only Elixir ~> 1.8
NobbZ

NobbZ

I’ll take a closer look from home.

NobbZ

NobbZ

Okay, solved it.

It seems as if due to restriction of how travis CI works, elixir isn’t really installed after running make install.

After I changed the script to use the elixir directly from the source folder, it worked. Also I prepared the git checkout already in a way, that you should be able to create a build matrix easily.

Latest build log: https://travis-ci.com/axelson/elixir_sense/builds/97754187
PR: Fix installation and usage of elixir in travis builds by NobbZ · Pull Request #1 · axelson/elixir_sense · GitHub

axelson

axelson OP

Scenic Core Team

Wow, thanks for seeing that through. I’ll get it merged down soon (hopefully later today).

axelson

axelson OP

Scenic Core Team

Here’s an updated example for anyone coming to this later (I had to remove any environment variables that depend on another environment variable):

language: erlang

otp_release:
  - '21.2'

env:
  EX_HOME: ${TRAVIS_BUILD_DIR}/elixir
  EX_BIN: ${TRAVIS_BUILD_DIR}/elixir/bin
  EX_VSN: 1.7.1

before_script:
  - git clone https://github.com/elixir-lang/elixir.git ${EX_HOME}
  - pushd ${EX_HOME}
  - git checkout v${EX_VSN}
  - make
  - popd
  - ${EX_BIN}/elixir ${EX_BIN}/mix local.hex --force
  - ${EX_BIN}/elixir ${EX_BIN}/mix local.rebar --force

script:
  - ${EX_BIN}/elixir ${EX_BIN}/mix deps.get
  - MIX_ENV=test ${EX_BIN}/elixir ${EX_BIN}/mix deps.compile
  - ${EX_BIN}/elixir ${EX_BIN}/mix test

— All posts loaded —

Where Next? Top

Trending in Questions Top

katta
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
achenet
Hello, I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind. However, when I launch mix phx.server, I get an error...
New
peck
Hi everyone. My team and I have been working on a fairly modest app based around video streaming and chat, but we’ve landed a customer t...
New
bradley
I really like the adapter patterns that ecto, nebulex, waffle, etc. use and would love find something similar for a key management servic...
New
unaware8150
Hello folks! So at work, we are seeing some situations where we have to define some “fixed” strings that are used across the codebase in...
New
Cxx-mlr
I’m working on a small exercise involving update_in/3, and I came up with this solution: data = %{ name: "Periodic Table", category:...
New
Alvinkariuki
How Can I Optimise Compile Time Dependencies I have been building an elixir application for about 2 years now. Many modules and files ha...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews