Skip to content

Commit

Permalink
CI: Switch Travis to Ubuntu 22.04 and fix non-prototype in ODBC (#3002)
Browse files Browse the repository at this point in the history
* CI: Switch Travis to Ubuntu 22.04 (jammmy)

Default Python version reported by Travis for 20.04 is 3.7.13. While that's still a supported version for 8.3 release if it would be released now, 2023-06-27 is end of support for 3.7, so it seems safe to not test the main branch with 3.7 at this point.

Ubuntu 22.04 in Travis uses Python 3.10 by default according to the documentation.

* Update wxgtk pkg to 4.0

* Replace custom install list by apt.txt file from GitHub Actions

* Change shebang to use bash instead of POSIX sh (#3)

* CI(travis): Add --with-pdal in linux.script.sh

* CI(travis): Remove sudo: required as it has no effect

* CI(travis): Fix warning os and dist missing from root

* CI(travis): Fix warning matrix is an alias for jobs

* CI(travis): Run make with make -j $(nproc)

* CI(travis): Show MAKEFLAGS at start of script

* CI(travis): use c++17 standard

* CI(travis): Remove duplicated dist key in include array

* CI(travis): Remove invalid --with-python from configure flags

* CI(travis): Remove unused codecov upload

* CI(travis): Remove irc notification

* CI(travis): Add -Werror and -fPIC to CFLAGS and CXXFLAGS on make call

* CI(travis): Limit runs on branches to main and release branches

* CI(travis): Add -Wfatal-errors

* db: Fix -Wdeprecated-non-prototype in describe.c for clang builds

* CI(travis): Add --no-keep-going in MAKEFLAGS to stop on errors

* db: Fix -Wdeprecated-non-prototype in odbc driver's fetch.c for clang builds

* db: Fix -Wdeprecated-non-prototype in odbc driver's listtab.c for clang builds

---------

Co-authored-by: Edouard Choinière <27212526+echoix@users.noreply.github.com>
  • Loading branch information
wenzeslaus and echoix committed Jun 19, 2024
1 parent 7847417 commit 6f0eccb
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 85 deletions.
24 changes: 12 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,33 @@
# Author: Ivan Mincik, ivan.mincik@gmail.com (linux)
# Rainer M. Krug, Rainer@krugs.de (osx)

os: linux
dist: jammy
language: c
cache: ccache

matrix:
# safelist
branches:
only:
- main
- releasebranch*

jobs:
include:
- os: linux
dist: focal
compiler: gcc
sudo: required
env: CC=gcc CXX=g++

- os: linux
dist: focal
compiler: clang
sudo: required
env: CC=clang CXX=clang++

env:
global:
- CFLAGS="-Werror=implicit-function-declaration"
- CXXFLAGS="-std=c++11"
- CXXFLAGS="-std=c++17"
- GRASS_EXTRA_CFLAGS="-Werror -fPIC -Wfatal-errors"
- GRASS_EXTRA_CXXFLAGS="-Werror -fPIC -Wfatal-errors"

before_install:
- ./.travis/$TRAVIS_OS_NAME.before_install.sh
Expand All @@ -32,9 +38,3 @@ install:

script:
- ./.travis/$TRAVIS_OS_NAME.script.sh

after_success:
- bash < (curl -s https://codecov.io/bash)

notifications:
irc: chat.freenode.net#grass
2 changes: 1 addition & 1 deletion .travis/linux.before_install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
#!/usr/bin/env bash
# Author: Ivan Mincik, ivan.mincik@gmail.com

set -e
Expand Down
54 changes: 5 additions & 49 deletions .travis/linux.install.sh
Original file line number Diff line number Diff line change
@@ -1,53 +1,9 @@
#!/usr/bin/env sh
#!/usr/bin/env bash
# Author: Ivan Mincik, ivan.mincik@gmail.com

set -e

sudo apt-get install --no-install-recommends \
libcairo2-dev \
libfftw3-dev \
libfreetype6-dev \
libgdal-dev \
libgeos-dev \
libglu1-mesa-dev \
libgsl-dev \
libjpeg-dev \
liblapack-dev \
libncurses5-dev \
libnetcdf-dev \
libopenjp2-7 \
libopenjp2-7-dev \
libpdal-dev \
libpdal-plugin-python \
libpng-dev \
libmysqlclient-dev \
libpq-dev \
libproj-dev \
libreadline-dev \
libsqlite3-dev \
libtiff-dev \
libxmu-dev \
libzstd-dev \
python3 \
python3-dateutil \
python3-dev \
python3-numpy \
python3-pil \
python3-pip \
python3-ply \
python-wxgtk3.0 \
unixodbc-dev \
libnetcdf-dev \
autoconf2.13 \
autotools-dev \
debhelper \
ccache \
fakeroot \
flex \
bison \
netcdf-bin \
dpatch \
libblas-dev \
pdal \
proj-bin \
proj-data
sudo apt-get update -y
sudo apt-get install -y wget git gawk findutils
xargs -a <(awk '! /^ *(#|$)/' ".github/workflows/apt.txt") -r -- \
sudo apt-get install -y --no-install-recommends --no-install-suggests
12 changes: 8 additions & 4 deletions .travis/linux.script.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
#!/usr/bin/env sh
#!/usr/bin/env bash
# Author: Ivan Mincik, ivan.mincik@gmail.com

set -e

export CC="ccache $CC"
export CXX="ccache $CXX"
export MAKEFLAGS="-j $(nproc) --no-keep-going"

echo "MAKEFLAGS is '$MAKEFLAGS'"

./configure --host=x86_64-linux-gnu \
--build=x86_64-linux-gnu \
--prefix=/usr/lib \
Expand All @@ -28,7 +32,7 @@ export CXX="ccache $CXX"
--with-freetype-includes=/usr/include/freetype2/ \
--with-postgres-includes=/usr/include/postgresql/ \
--with-proj-share=/usr/share/proj \
--with-python \
--with-cairo
--with-cairo \
--with-pdal

make -j2
make CFLAGS="$CFLAGS $GRASS_EXTRA_CFLAGS" CXXFLAGS="$CXXFLAGS $GRASS_EXTRA_CXXFLAGS"
12 changes: 3 additions & 9 deletions db/drivers/odbc/describe.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@

int set_column_type(dbColumn *column, int otype);

int db__driver_describe_table(table_name, table)
dbString *table_name;
dbTable **table;
int db__driver_describe_table(dbString *table_name, dbTable **table)
{
char *name = NULL;
SQLINTEGER err;
Expand Down Expand Up @@ -60,9 +58,7 @@ dbTable **table;
return DB_OK;
}

int describe_table(stmt, table)
SQLHSTMT stmt;
dbTable **table;
int describe_table(SQLHSTMT stmt, dbTable **table)
{
dbColumn *column;
int col;
Expand Down Expand Up @@ -143,9 +139,7 @@ dbTable **table;
return DB_OK;
}

int set_column_type(column, otype)
dbColumn *column;
int otype;
int set_column_type(dbColumn *column, int otype)
{
int dbtype;

Expand Down
8 changes: 2 additions & 6 deletions db/drivers/odbc/fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
#include "globals.h"
#include "proto.h"

int db__driver_fetch(cn, position, more)
dbCursor *cn;
int position;
int *more;
int db__driver_fetch(dbCursor *cn, int position, int *more)
{
cursor *c;
dbToken token;
Expand Down Expand Up @@ -163,8 +160,7 @@ int *more;
return DB_OK;
}

int db__driver_get_num_rows(cn)
dbCursor *cn;
int db__driver_get_num_rows(dbCursor *cn)
{
cursor *c;
dbToken token;
Expand Down
5 changes: 1 addition & 4 deletions db/drivers/odbc/listtab.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
#include "globals.h"
#include "proto.h"

int db__driver_list_tables(tlist, tcount, system)
dbString **tlist;
int *tcount;
int system;
int db__driver_list_tables(dbString **tlist, int *tcount, int system)
{
cursor *c;
dbString *list;
Expand Down

0 comments on commit 6f0eccb

Please sign in to comment.