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

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
roeland
Kia ora, We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
Onor.io
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
jaybe78
Hello, I’m developing a online persistent chat system (what’s app) like using elixir/dynamodb/aws for a mobile app(flutter). The diffic...
New
Trolleger
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New

Other Trending Topics Top

garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
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
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New
aseigo
ICal is a library for interacting with iCalendar data. It parses iCalendars into typed Elixir structs via ICal.from_ics, and can prepare ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews