Skip to content

Commit

Permalink
fix(ci): use a newer fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dilks committed Nov 28, 2023
1 parent 3121cef commit e5663a9
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 16 deletions.
50 changes: 41 additions & 9 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ defaults:
run:
shell: bash

env:
hipo_version: master
fmt_version: 9.1.0

jobs:

# build
# dependencies
#########################################################

build_hipo:
Expand All @@ -27,6 +31,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: gavalian/hipo
ref: ${{ env.hipo_version }}
- name: build
run: |
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=hipo
Expand All @@ -41,14 +46,40 @@ jobs:
retention-days: 1
path: hipo.tar.gz

build_fmt:
name: Build fmt
runs-on: ubuntu-latest
steps:
- name: checkout fmt
uses: actions/checkout@v4
with:
repository: fmtlib/fmt
ref: ${{ env.fmt_version }}
- name: build
run: |
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=fmt
cmake --build build -j2
cmake --install build
- run: tree fmt
- name: tar
run: tar czvf fmt{.tar.gz,}
- uses: actions/upload-artifact@v3
with:
name: build
retention-days: 1
path: fmt.tar.gz

# build
#########################################################

build_iguana:
name: Build Iguana
needs: [ build_hipo ]
needs:
- build_hipo
- build_fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: setup fmt
run: sudo apt install -y libfmt-dev
- name: setup meson
run: python -m pip install meson ninja
- name: summarize dependencies
Expand All @@ -59,15 +90,16 @@ jobs:
for dep in python ruby meson ninja ; do
echo "| \`$dep\` | $($dep --version) |" >> $GITHUB_STEP_SUMMARY
done
echo "| \`fmt\` | $(apt show libfmt-dev | grep -w Version) |" >> $GITHUB_STEP_SUMMARY
echo "| \`fmt\` | ${{ env.fmt_version }} |" >> $GITHUB_STEP_SUMMARY
echo "| \`hipo\` | ${{ env.hipo_version }} |" >> $GITHUB_STEP_SUMMARY
- name: get build artifacts
uses: actions/download-artifact@v3
with:
name: build
- name: untar build
run: ls *.tar.gz | xargs -I{} tar xzvf {}
- name: build iguana
run: ./install.rb --hipo hipo
run: ./install.rb --hipo hipo --fmt fmt
- name: dump build log
if: always()
run: cat build-iguana/meson-logs/meson-log.txt
Expand Down Expand Up @@ -108,11 +140,11 @@ jobs:

test_iguana:
name: Test Iguana
needs: [ download_validation_files, build_iguana ]
needs:
- download_validation_files
- build_iguana
runs-on: ubuntu-latest
steps:
- name: install dependencies
run: sudo apt install -y libfmt-dev
- name: get build artifacts
uses: actions/download-artifact@v3
with:
Expand Down
6 changes: 5 additions & 1 deletion install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
build: "#{Dir.pwd}/build-iguana",
install: "#{Dir.pwd}/iguana",
hipo: "#{Dir.pwd}/hipo",
fmt: nil,
clean: false,
purge: false,
}
Expand All @@ -22,7 +23,8 @@
parser.separator ''
parser.on("-i", "--install [INSTALL DIR]", "Directory for installation", "Default: #{options[:install]}")
parser.separator ''
parser.on("-h", "--hipo [HIPO DIR]", "Path to HIPO installation", "Default: #{options[:hipo]}", "if not found, tries env var $HIPO")
parser.on("--hipo [HIPO DIR]", "Path to HIPO installation", "Default: #{options[:hipo]}", "if not found, tries env var $HIPO")
parser.on("--fmt [FMT DIR]", "Path to fmt installation", "Default: assumes system installation" )
parser.separator 'TROUBLESHOOTING:'
parser.on("--clean", "Remove the buildsystem at [BUILD DIR] beforehand")
parser.on("--purge", "Remove the installation at [INSTALL DIR] beforehand")
Expand Down Expand Up @@ -73,13 +75,15 @@ def buildOpt(key,val)
'meson setup',
"--prefix #{prefix}",
buildOpt('hipo', options[:hipo]),
buildOpt('fmt', options[:fmt]),
options[:build],
SourceDir,
],
:config => [
'meson configure',
"--prefix #{prefix}",
buildOpt('hipo', options[:hipo]),
buildOpt('fmt', options[:fmt]),
options[:build],
],
:install => [
Expand Down
21 changes: 15 additions & 6 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,23 @@ project_inc = include_directories('src')
project_lib_install_dir = 'lib' # to keep it the same for different Linux distributions
project_bin_install_dir = 'bin'

project_lib_rpath = '$ORIGIN'
project_bin_rpath = ':'.join([
'$ORIGIN/../' + project_lib_install_dir,
dep_lib_rpaths = [
get_option('hipo') + '/lib'
])
]
if get_option('fmt') != ''
dep_lib_rpaths += get_option('fmt') + '/lib'
endif
project_lib_rpath = '$ORIGIN'
project_bin_rpath = ':'.join(['$ORIGIN/../' + project_lib_install_dir] + dep_lib_rpaths)

fmt_dep = dependency('fmt')
hipo_dep = dependency('hipo4', method: 'cmake', cmake_args: '-DCMAKE_PREFIX_PATH=' + get_option('hipo'))
fmt_dep = dependency(
'fmt',
cmake_args: get_option('fmt')!='' ? '-DCMAKE_PREFIX_PATH='+get_option('fmt') : '',
)
hipo_dep = dependency(
'hipo4',
cmake_args: '-DCMAKE_PREFIX_PATH='+get_option('hipo'),
)

subdir('src/services')
subdir('src/algorithms')
Expand Down
1 change: 1 addition & 0 deletions meson.options
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
option('hipo', type: 'string', value: '/usr/local', description: 'HIPO installation location')
option('fmt', type: 'string', value: '', description: 'fmt installation location')

0 comments on commit e5663a9

Please sign in to comment.