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

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
apz
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
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
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews