Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

G++ library linker issue with Travis CI #285

Closed
TheLoneRonin opened this issue Jan 3, 2021 · 1 comment · May be fixed by #284
Closed

G++ library linker issue with Travis CI #285

TheLoneRonin opened this issue Jan 3, 2021 · 1 comment · May be fixed by #284

Comments

@TheLoneRonin
Copy link

Problem

I've been tinkering with Travis CI for a fair bit. And, quite frankly, I'm a bit confused as to why it refuses to compile on a Travis VM.

The following is the build script I used to compile the project with Travis:

os: linux
dist: focal
language: erlang

otp_release:
    - 23.0

jobs:
    include:
        - name: arweave-docker
          services:
              - docker
          script:
              - sudo apt-get update
              - sudo apt-get install apt-utils build-essential g++ clang gcc -y
              - docker build -t arweave .

        - name: arweave-source
          script:
              - sudo apt-get update
              - sudo apt-get install apt-utils build-essential g++ clang gcc -y 
              - sudo apt-get install erlang-dev -y
              - sudo apt-get cmake make -y
              - sudo apt-get libsqlite3-dev -y
              - git submodule init
              - git submodule update
              - ./rebar3 as prod tar

You can review the logs for the failed compilation here: https://travis-ci.org/github/TheLoneRonin/arweave/jobs/752327803

The error that is provided is not reproducible on a local machine running Ubuntu Focal (20.04). If you installed erlang with apt on a fresh VPS. Specifically check lines 1064 to 1072 in the Travis job.

make: Entering directory '/home/travis/build/TheLoneRonin/arweave/_build/default/lib/prometheus_process_collector/c_src'

g++ -O3 -finline-functions -fPIC -I /home/travis/otp/23.0/erts-11.0/include/ -I /home/travis/otp/23.0/lib/erl_interface-4.0/include -std=c++11 -Wall  -c -o prometheus_process_collector_nif.o prometheus_process_collector_nif.cc

g++ -O3 -finline-functions -fPIC -I /home/travis/otp/23.0/erts-11.0/include/ -I /home/travis/otp/23.0/lib/erl_interface-4.0/include -std=c++11 -Wall  -c -o prometheus_process_info_linux.o prometheus_process_info_linux.cc

cc prometheus_process_collector_nif.o prometheus_process_info_linux.o -shared -L /home/travis/otp/23.0/lib/erl_interface-4.0/lib -lerl_interface -lei -lstdc++ -o /home/travis/build/TheLoneRonin/arweave/_build/default/lib/prometheus_process_collector/c_src/../priv/prometheus_process_collector.so

/usr/bin/ld: cannot find -lerl_interface

collect2: error: ld returned 1 exit status

make: *** [Makefile:66: /home/travis/build/TheLoneRonin/arweave/_build/default/lib/prometheus_process_collector/c_src/../priv/prometheus_process_collector.so] Error 1

make: Leaving directory '/home/travis/build/TheLoneRonin/arweave/_build/default/lib/prometheus_process_collector/c_src'

Linking the erl_interface is not an issue on any Debian or Darwin OS. If others could confirm, that would be great so we can debug this problem further.

Solution

For the time being, I've outright removed Travis CI from the project in the PR: #284

1. Build Kite

In the future we may want to look into an alternative. Build Kite may be a good solution as we get to setup and deploy our own machine to run CI tests.

https://buildkite.com/

2. Post an issue in the Travis CI forums

In order to actually get this resolved, we would most definitely have to post an issue in the Travis CI forums as this type library linking issue can only be resolved by debugging and fixing their VM setup.

@ldmberman
Copy link
Member

Closing as the issue was related to Erlang OTP 23.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants