Travis for C++ always ignore script for customize testing - c++

I've been experimenting this and spend more than 25 commit with only small change in .travis.yml but travis always do either:
./configure: if I put the language: cpp in the first line. travis will ignore everything written in .travis.yml and will go straight ./configure && make && make test
language: cpp
addons:
apt:
sources:
- ubuntu-sdk-team
addons:
apt:
packages:
- ubuntu-sdk
before_script: ls
script: qmake demo/QtGoodiesDemo/QtGoodiesDemo.pro && make
sudo: false
rake: if I reorder the placement of language: cpp or remove it. this point, travis succeeded install the dependency (apt addons executed)
addons:
apt:
sources:
- ubuntu-sdk-team
addons:
apt:
packages:
- ubuntu-sdk
before_script: ls
script: qmake demo/QtGoodiesDemo/QtGoodiesDemo.pro && make
language: cpp
sudo: false
I have read the documentation and using what it told just lead me to the point (1) problem.
I've searched but nobody got this problem, I wonder how people do this.
(This is the link)
Attempt 1
using nested apt source still gets me to problem(1) and ignore the custom script (https://travis-ci.org/imakin/QtGoodies/builds/85143452). Note that in problem 2 when rake is called, it succeeded in installing ubuntu-sdk for the Qt dependencies
language: cpp
sudo: false
addons:
apt:
sources:
- ubuntu-sdk-team
packages:
- ubuntu-sdk
before_script: ls
script: qmake demo/QtGoodiesDemo/QtGoodiesDemo.pro && make
Attempt 2
So then I try to play it and added configure file. Having it all rwxrwxrwx permission too. and pushed it. But travis still execute to problem (1) again. No Qt Installing, even failed to run the configure telling it has no permission to execute it. I can't do anything to chmod it in testing process though as before_script is ignored too. This one occurred in https://travis-ci.org/imakin/QtGoodies/builds/85146543

I think your .travis.yml file is invalid and prevents it to be parsed properly, hence you default to the Ruby language.
Can you try merging both addons.apt sections like so:
addons:
apt:
sources:
- ubuntu-sdk-team
packages:
- ubuntu-sdk
Hope this helps!
Update: it turns out the .travis.yml file started with a hidden character that prevented Travis CI from parsing it properly.

Related

GoogleCloudPlatform Buildpacks failed to build

I haven't changed anything recently in my project, but when I tried to deploy it last, I received this error in the logs: ERROR: Could not build wheels for pyarrow, which is required to install pyproject.toml-based projects
See the full log here: log-d20114fe-3eeb-4a8d-8926-3a971882894c.txt
This is my requirements.txt:
requirements.txt
It seems like it is an issue with the dependencies for the snowflake-connector-python package, but I am not really sure what would have caused this. I see in the logs:
-- Running cmake for pyarrow
Step #0 - "Buildpack": cmake -DPYTHON_EXECUTABLE=/layers/google.python.runtime/python/bin/python3 -DPython3_EXECUTABLE=/layers/google.python.runtime/python/bin/python3 "" -DPYARROW_BUILD_CUDA=off -DPYARROW_BUILD_FLIGHT=off -DPYARROW_BUILD_GANDIVA=off -DPYARROW_BUILD_DATASET=off -DPYARROW_BUILD_ORC=off -DPYARROW_BUILD_PARQUET=off -DPYARROW_BUILD_PARQUET_ENCRYPTION=off -DPYARROW_BUILD_PLASMA=off -DPYARROW_BUILD_S3=off -DPYARROW_BUILD_HDFS=off -DPYARROW_USE_TENSORFLOW=off -DPYARROW_BUNDLE_ARROW_CPP=off -DPYARROW_BUNDLE_BOOST=off -DPYARROW_GENERATE_COVERAGE=off -DPYARROW_BOOST_USE_SHARED=on -DPYARROW_PARQUET_USE_SHARED=on -DCMAKE_BUILD_TYPE=release /tmp/pip-install-w1g_50oc/pyarrow_4a54282bee5f4c3c8399d3428e4134e6
Step #0 - "Buildpack": error: command 'cmake' failed: No such file or directory
This makes me think CMake is the problem, but I tried explicitly adding CMake to my requirements file and had the same result.
I also looked at the last successful build, and it looks like I was running python version 3.10.8, and the one that failed first was running 3.11. How can I change what python version cloud build uses? I am using the cloudbuild.yaml file instead of docker.
Figured it out! The issue was with not specifying a version in Cloud Build for Python, so it was defaulting to 3.11, which does not yet have support for pyarrow. I ended up setting the version in the cloud build yaml file to 3.10.8 like so:
steps:
- name: gcr.io/k8s-skaffold/pack
env:
- GOOGLE_ENTRYPOINT=$_ENTRYPOINT
- GOOGLE_RUNTIME_VERSION=$_RUNTIME_VERSION
args:
- build
- '$_GCR_HOSTNAME/$PROJECT_ID/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA'
- '--builder=gcr.io/buildpacks/builder:v1'
- '--network=cloudbuild'
- '--path=.'
- '--env=GOOGLE_ENTRYPOINT'
- '--env=GOOGLE_RUNTIME_VERSION'
For those of you who are using a Procfile
I was able to fix by creating a .python-version file that contains just the version number needed,
i.e. 3.10.4

Using MPI on a Github Action

I'm working on a C++ project which uses MPI and OMP for some parallel stuff. The thing is that I'd like to include a Github Action in the repo which compiles the code and run the tests after each push on master. I have already use Travis CI as a CI tool and it worked perfectly (both compiling and running the tests), but for some reason I cannot configure the action properly. Every time I push to master it appears the following error when the compiling stage reaches a file which uses MPI:
/home/runner//.file.cpp:14:10: fatal error: mpi.h: No such file or directory
14 | #include <mpi.h>
| ^~~~~~~
The action.yml file is as following:
name: CMake
on:
push:
branches:
- master
- develop
pull_request:
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout#v2
- uses: egor-tensin/setup-gcc#v1
with:
version: 10
platform: x64
- uses: mpi4py/setup-mpi#v1
with:
mpi: 'mpich'
- name: Compile
run: |
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
export CC=cc
export CXX=CC
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target all -- -j 14
- name: Run Tests
run:
./${{github.workspace}}/bin/tests
I had tried to change the configuration several times using other MPI versions but the problem always appears.

Appveyor runs tests but OpenCover doesn't show coverage

I am building the project and running test cases in appveyor. After successfully executing test cases the coverage data must be uploaded to coveralls.
But in my case no error is thrown but coverage is being recorded.
The details of my project are
.Net Core 1.1.0
Visual Studio 2017
xunit - 2.2.0
OpenCover - 4.6.519
coveralls.net - 0.7.0
My appveyor.yml is as below :
version: 1.0.{build}
os: Visual Studio 2017
skip_tags: true
configuration: Release
environment:
nodejs_version: "0.12"
COVERALLS_REPO_TOKEN:
secure: rstgrtert
cache:
- "%LOCALAPPDATA%\\Yarn"
install:
- npm i -g yarn#0.16.1
- npm i -g typescript typings
- yarn global add typescript typings
- cd ".\Promact.Oauth.Server\src\Promact.Oauth.Server\"
- yarn
- cd..
- cd..
build_script:
- ps: dotnet restore
build:
project: .\Promact.Oauth.Server\Promact.Oauth.Server.sln
verbosity: minimal
test_script:
- cd ".\src\"
- ps: >-
C:\Users\appveyor\.nuget\packages\OpenCover\4.6.519\tools\OpenCover.Console.exe-target:"C:\Program Files\dotnet\dotnet.exe" -targetargs:"test -f netcoreapp1.1 -c Release .\Promact.Oauth.Server.Tests\Promact.Oauth.Server.Tests.csproj" -mergeoutput -hideskipped:File -output:opencover.xml -oldStyle -filter:"+[Promact.Oauth.Server]*Repository -[Promact.Oauth.Server.Tests*]*" -register:user
if(![string]::IsNullOrEmpty($env:COVERALLS_REPO_TOKEN)){
$coveralls = (Resolve-Path "C:\Users\appveyor\.nuget\packages\coveralls.net\0.7.0\tools\csmacnz.coveralls. exe").ToString()
& $coveralls --opencover -i opencover.xml --repoToken
$env:COVERALLS_REPO_TOKEN --commitId $env:APPVEYOR_REPO_COMMIT --commitBranch $env:APPVEYOR_REPO_BRANCH --commitAuthor $env:APPVEYOR_REPO_COMMIT_AUTHOR --commitEmail $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL --commitMessage $env:APPVEYOR_REPO_COMMIT_MESSAGE --jobId $env:APPVEYOR_JOB_ID
}
In appveyor it runs the test and simply shows
Committing...
No results, this could be for a number of reasons. The most common reasons are:
1) missing PDBs for the assemblies that match the filter please review the
output file and refer to the Usage guide (Usage.rtf) about filters.
2) the profiler may not be registered correctly, please refer to the Usage
guide and the -register switch.
Coverage data uploaded to coveralls.
link to the appveyor build

Using an alternate compiler for Travis-CI R project builds

Travis-CI's official R project build support on Ubuntu uses (at the time of this question) gcc version 4.6.
CRAN uses gcc 4.9 and some packages that build fine on CRAN will not build on Travis with gcc 4.6.
How does one change the default gcc compiler for R project/package builds to more closely mirror CRAN builds?
I really wanted to be able to use Travis to test my ndjson package but the C++ library I'm using won't compile under gcc 4.6.
The ndjson package is on CRAN and the CRAN builds are fine (except for r-oldrel on Windows which doesn't bother me a bit), so I needed a way to change the compiler that R uses on Travis.
I'm using gcc 5 in the example below, but you can use any version available in the toolchain test builds. Ideally, one should mimic CRAN's gcc version and this may be something the Travis folks might consider making default for R builds.
The .travis.yml starts off the same:
language: r
warnings_are_errors: true
sudo: required
env:
global:
- CRAN: http://cran.rstudio.com
I added a matrix build configuration to add the new package source as well as specify the package(s) that needed to be installed. I left it in a matrix configuration since I'm going to try to (eventually) add clang.
matrix:
include:
- os: linux
compiler: gcc
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5']
env:
- COMPILER=g++-5
- CC=gcc=5
- CXX=g++-5
Next, I made sure the auto default compiler is set to this newer gcc and also made doubly sure that R would use it by creating a local Makevars:
before_install:
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 100
- mkdir -p ~/.R
- echo "VkVSPS01CkNDPWdjYyQoVkVSKSAtc3RkPWMxMSAKQ1hYPWcrKyQoVkVSKQpTSExJQl9DWFhMRD1nKyskKFZFUikKRkM9Z2ZvcnRyYW4KRjc3PWdmb3J0cmFuCg==" | base64 -d > ~/.R/Makevars
- cat ~/.R/Makevars
The base64 string equates to:
VER=-5
CC=gcc$(VER) -std=c11
CXX=g++$(VER)
SHLIB_CXXLD=g++$(VER)
FC=gfortran
F77=gfortran
and is just (IMO) cleaner this way.
In theory, all I would have had to do is create the Makevars (i.e. not have to change the default gcc with update-alternatives) but it turned out that Travis used the Makevars gcc setting when installing the dependencies but not for the actual package build itself. So, the update-alternatives is necessary. I also had to add the -std=c11 to ensure a few of the dependencies compiled (the build errored w/o it).
After these modifications to the .travis.yml configuration, ndjson built fine.
Just to give an alternate approach, I use a custom shell script in one of my packages sourcetools. My goal there was to ensure the package would build using the (now ancient) gcc-4.4 compiler. In .travis.yml, I have:
language: r
cache: packages
sudo: false
warnings_are_errors: true
before_install:
- source travis/before-install.sh
addons:
apt:
packages:
- gcc-4.4
- g++-4.4
- clang
r:
- oldrel
- release
- devel
env:
- COMPILER=gcc-4.4
- COMPILER=gcc
- COMPILER=clang
And in travis/before-install.sh, I have:
#!/usr/bin/env sh
mkdir -p ~/.R
if [ "${COMPILER}" = "gcc-4.4" ]; then
echo "CC=gcc-4.4 -std=gnu99" >> ~/.R/Makevars
echo "CXX=g++-4.4" >> ~/.R/Makevars
echo "CXX1X=g++-4.4 -std=c++0x" >> ~/.R/Makevars
fi
if [ "${COMPILER}" = "gcc" ]; then
echo "CC=gcc -std=gnu99" >> ~/.R/Makevars
echo "CXX=g++" >> ~/.R/Makevars
echo "CXX1X=g++ -std=c++0x" >> ~/.R/Makevars
fi
if [ "${COMPILER}" = "clang" ]; then
echo "CC=clang -std=gnu99" >> ~/.R/Makevars
echo "CXX=clang++" >> ~/.R/Makevars
echo "CXX1X=clang++ -std=c++0x" >> ~/.R/Makevars
fi
The end result is basically the same, but IMHO it's somewhat cleaner to separate the 'setup' logic into its own script that's driven entirely off of environment variables. It also makes it easier to construct the R matrix builds, since Travis automatically combines the permutations of r and env here (no need to do it 'by hand').
I imagine the before-install.sh script I use could be cleaned up / made more general, but I haven't had the need to do that yet.

C++ linux install executable file on deploy environment

Hello every one i need to deploy linux(centos) c++ project with make file or script. By one makefile or script install dependency and project executable binary.
my dependency applications libboost-devel,gcc-g++ and pcre. my excuteble binary file is run_excute
Yip sure - put the below commands into a file. At the top of the file add:
#!/bin/bash
Save the file - lets say you call it install; on the command line type:
chmod +x ./install
Then to build and install your program type:
sudo ./install
Alternatively, if you've got some time on your hands:
http://www.rpm.org/max-rpm/ch-rpm-build.html
As an example the basic rpm build process for fedora is:
Step 1: setup your machine to do packaging:
dnf install #development-tools fedora-packager rpmdevtools
rpmdev-setuptree
Step 2: source and Makefile
Place these in ~/rpmbuild/SOURCES
Step 3: Create a spec file
In ~/rpmbuild/SPECS create file called myname.spec. It should contain something like:
Summary: My program description
Name: myname
Version: 0.0.0
Release: 0
License: GPLv2
Group: Applications/Databases
Source: https://xyz.tar.gz
URL: http://myurl
BuildRequires: libicu-devel
BuildRequires: pcre-devel
%description
A couple of lines describing the package
%prep
%setup -q
%build
cd %{myname}/source
make %{?_smp_mflags}
%install
%make_install
%files
%{_bindir}/*
%changelog
* Tue Nov 10 2015 Yours Truly <me#somewhere.com> - 0.0.0-0
- Some change comments
Step 4: create the source and binary rpm
cd ~/rpmbuild/SPECS
rpmbuild -ba myname.spec
Step 5: use the rpm
cd ~/rpmbuild/RPMS/x86_64
rpm -Uvh ./myprogram-version-release.a.whole.lot.of.stuff.rpm
To install the dependencies use yum, so:
sudo yum install libboost-devel
sudo yum group install "Development Tools"
sudo yum install pcre-devel
To build the application, move to the directory with the makefile in it and do:
make
sudo make install
Finally to run the application
./run_excute
or if your lucky
run_excute
will work.