Skip to content

Commit 9bf944a

Browse files
committed
Moved from c++ 17 to c++ 20; fix CI.
1 parent bc06c7b commit 9bf944a

File tree

4 files changed

+33
-91
lines changed

4 files changed

+33
-91
lines changed

.github/workflows/ci.yml

+30-88
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,32 @@ jobs:
2626
strategy:
2727
matrix:
2828
os: [macos-12, ubuntu-22.04]
29+
# I moved to C++ 20 2024-01-12-- the earliest version of boost that can compile
30+
# under C++ 20 seems to be 1.75. That was released 2020-12-11, over three years
31+
# ago so I'm comfortable calling that "oldest", now. Let's call 1.81 (one year ago)
32+
# "pinned".
2933
boost: [oldest, pinned, latest]
3034
include:
3135
- os: macos-12
3236
boost: oldest
33-
boost-ver: 1_63_0
34-
boost-dl: https://boostorg.jfrog.io/artifactory/main/release/1.63.0/source/boost_1_63_0.tar.bz2
37+
boost-ver: 1_75_0
38+
boost-dl: https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.bz2
3539
- os: macos-12
3640
boost: pinned
37-
boost-ver: 1_74_0
38-
boost-dl: https://boostorg.jfrog.io/artifactory/main/release/1.74.0/source/boost_1_74_0.tar.bz2
41+
boost-ver: 1_81_0
42+
boost-dl: https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/boost_1_81_0.tar.bz2
3943
- os: macos-12
4044
boost: latest
4145
boost-ver: 1_84_0
4246
boost-dl: https://boostorg.jfrog.io/artifactory/main/release/1.84.0/source/boost_1_84_0.tar.bz2
4347
- os: ubuntu-22.04
4448
boost: oldest
45-
boost-ver: 1_63_0
46-
boost-dl: https://boostorg.jfrog.io/artifactory/main/release/1.63.0/source/boost_1_63_0.tar.bz2
49+
boost-ver: 1_75_0
50+
boost-dl: https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.bz2
4751
- os: ubuntu-22.04
4852
boost: pinned
49-
boost-ver: 1_74_0
50-
boost-dl: https://boostorg.jfrog.io/artifactory/main/release/1.74.0/source/boost_1_74_0.tar.bz2
53+
boost-ver: 1_81_0
54+
boost-dl: https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/boost_1_81_0.tar.bz2
5155
- os: ubuntu-22.04
5256
boost: latest
5357
boost-ver: latest
@@ -103,8 +107,8 @@ jobs:
103107
set -e
104108
105109
- name: Cache boost (Ubuntu)
106-
# On Ubuntu, we install "pinned" & "latest" directly from the packages.
107-
if: matrix.os == 'ubuntu-22.04' && matrix.boost == 'oldest'
110+
# On Ubuntu, we install "latest" directly from the package repositories.
111+
if: matrix.os == 'ubuntu-22.04' && matrix.boost != 'latest'
108112
id: cache-boost-ubuntu
109113
uses: actions/cache@v2
110114
with:
@@ -126,16 +130,8 @@ jobs:
126130
pwd
127131
sudo apt-get install -y libboost-all-dev
128132
129-
- name: Install boost (Ubuntu, pinned)
130-
if: matrix.os == 'ubuntu-22.04' && matrix.boost == 'pinned'
131-
shell: bash
132-
run: |
133-
set -x
134-
pwd
135-
sudo apt-get install -y libboost1.74-all-dev
136-
137-
- name: Get boost (Ubuntu, oldest)
138-
if: matrix.os == 'ubuntu-22.04' && matrix.boost == 'oldest' && steps.cache-boost-ubuntu.outputs.cache-hit != 'true'
133+
- name: Get boost (Ubuntu, non-latest)
134+
if: matrix.os == 'ubuntu-22.04' && matrix.boost != 'latest' && steps.cache-boost-ubuntu.outputs.cache-hit != 'true'
139135
run: |
140136
set -ex
141137
pwd
@@ -272,8 +268,8 @@ jobs:
272268
otool -L libboost_timer.dylib
273269
echo ================================================
274270
275-
- name: Configure scribbu (Ubuntu, oldest)
276-
if: matrix.os == 'ubuntu-22.04' && matrix.boost == 'oldest'
271+
- name: Configure scribbu (Ubuntu, non-latest)
272+
if: matrix.os == 'ubuntu-22.04' && matrix.boost != 'latest'
277273
shell: bash
278274
run: |
279275
autoconf --version
@@ -284,8 +280,8 @@ jobs:
284280
./bootstrap
285281
./configure --with-boost=$(cd boost_${{ matrix.boost-ver }}/installdir; pwd)
286282
287-
- name: Configure scribbu (Ubuntu, non-oldest)
288-
if: matrix.os == 'ubuntu-22.04' && matrix.boost != 'oldest'
283+
- name: Configure scribbu (Ubuntu, latest)
284+
if: matrix.os == 'ubuntu-22.04' && matrix.boost == 'latest'
289285
shell: bash
290286
run: |
291287
autoconf --version
@@ -326,62 +322,8 @@ jobs:
326322
eval "$(/usr/libexec/path_helper)"
327323
PATH="/usr/local/opt/bison/bin:/usr/local/opt/texinfo/bin:$PATH" make -j 4
328324
329-
- name: Patch boost binary dependencies (MacOS, oldest)
330-
if: matrix.os == 'macos-12' && matrix.boost == 'oldest'
331-
shell: bash
332-
run: |
333-
set -x
334-
echo "===================================="
335-
otool -L scribbu/.libs/libscribbu.dylib
336-
echo "===================================="
337-
there=$(cd boost_${{ matrix.boost-ver }}/installdir/lib; pwd)
338-
echo "Changing the load location for boost libs to ${there}."
339-
install_name_tool -change libboost_iostreams.dylib ${there}/libboost_iostreams.dylib scribbu/.libs/libscribbu.dylib
340-
install_name_tool -change libboost_log.dylib ${there}/libboost_log.dylib scribbu/.libs/libscribbu.dylib
341-
install_name_tool -change libboost_program_options.dylib ${there}/libboost_program_options.dylib scribbu/.libs/libscribbu.dylib
342-
install_name_tool -change libboost_regex.dylib ${there}/libboost_regex.dylib scribbu/.libs/libscribbu.dylib
343-
install_name_tool -change libboost_system.dylib ${there}/libboost_system.dylib scribbu/.libs/libscribbu.dylib
344-
echo "===================================="
345-
otool -L scribbu/.libs/libscribbu.dylib
346-
echo "===================================="
347-
echo "===================================="
348-
otool -L src/.libs/scribbu
349-
echo "===================================="
350-
there=$(cd boost_${{ matrix.boost-ver }}/installdir/lib; pwd)
351-
echo "Changing the load location for boost libs to ${there}."
352-
install_name_tool -change libboost_iostreams.dylib ${there}/libboost_iostreams.dylib src/.libs/scribbu
353-
install_name_tool -change libboost_log.dylib ${there}/libboost_log.dylib src/.libs/scribbu
354-
install_name_tool -change libboost_program_options.dylib ${there}/libboost_program_options.dylib src/.libs/scribbu
355-
install_name_tool -change libboost_regex.dylib ${there}/libboost_regex.dylib src/.libs/scribbu
356-
install_name_tool -change libboost_system.dylib ${there}/libboost_system.dylib src/.libs/scribbu
357-
there=$(cd scribbu/.libs; pwd)
358-
echo "Changing the load location for scribbu lib to be ${there}."
359-
install_name_tool -change /usr/local/lib/libscribbu.4.dylib ${there}/libscribbu.4.dylib src/.libs/scribbu
360-
echo "===================================="
361-
otool -L src/.libs/scribbu
362-
src/.libs/scribbu --version
363-
echo "===================================="
364-
cd test && make unit
365-
echo "===================================="
366-
otool -L .libs/unit
367-
echo "===================================="
368-
there=$(cd ../boost_${{ matrix.boost-ver }}/installdir/lib; pwd)
369-
echo "Changing the load location for boost libs to ${there}."
370-
install_name_tool -change libboost_iostreams.dylib ${there}/libboost_iostreams.dylib .libs/unit
371-
install_name_tool -change libboost_log.dylib ${there}/libboost_log.dylib .libs/unit
372-
install_name_tool -change libboost_program_options.dylib ${there}/libboost_program_options.dylib .libs/unit
373-
install_name_tool -change libboost_regex.dylib ${there}/libboost_regex.dylib .libs/unit
374-
install_name_tool -change libboost_system.dylib ${there}/libboost_system.dylib .libs/unit
375-
install_name_tool -change libboost_unit_test_framework.dylib ${there}/libboost_unit_test_framework.dylib .libs/unit
376-
there=$(cd ../scribbu/.libs; pwd)
377-
echo "Changing the load location for unit lib to be ${there}."
378-
install_name_tool -change /usr/local/lib/libscribbu.4.dylib ${there}/libscribbu.4.dylib .libs/unit
379-
echo "===================================="
380-
otool -L .libs/unit
381-
.libs/unit --help
382-
383-
- name: Patch boost binary dependencies (MacOS, non-oldest)
384-
if: matrix.os == 'macos-12' && matrix.boost != 'oldest'
325+
- name: Patch boost binary dependencies (MacOS)
326+
if: matrix.os == 'macos-12'
385327
shell: bash
386328
run: |
387329
set -x
@@ -434,8 +376,8 @@ jobs:
434376
otool -L .libs/unit
435377
.libs/unit --help
436378
437-
- name: Test scribbu (Ubuntu, oldest)
438-
if: matrix.os == 'ubuntu-22.04' && matrix.boost == 'oldest'
379+
- name: Test scribbu (Ubuntu, non-latest)
380+
if: matrix.os == 'ubuntu-22.04' && matrix.boost != 'latest'
439381
shell: bash
440382
run: |
441383
set -x
@@ -450,8 +392,8 @@ jobs:
450392
exit 1
451393
fi
452394
453-
- name: Test scribbu (Ubuntu, non-oldest)
454-
if: matrix.os == 'ubuntu-22.04' && matrix.boost != 'oldest'
395+
- name: Test scribbu (Ubuntu, latest)
396+
if: matrix.os == 'ubuntu-22.04' && matrix.boost == 'latest'
455397
shell: bash
456398
run: |
457399
set -x
@@ -473,9 +415,9 @@ jobs:
473415
exit 1
474416
fi
475417
476-
- name: Test the Autotools distribution (Ubuntu, oldest)
418+
- name: Test the Autotools distribution (Ubuntu, non-latest)
477419
# I only make the Autotools distro on Ubuntu, so just test there
478-
if: matrix.os == 'ubuntu-22.04' && matrix.boost == 'oldest'
420+
if: matrix.os == 'ubuntu-22.04' && matrix.boost != 'latest'
479421
shell: bash
480422
run: |
481423
set -x
@@ -492,8 +434,8 @@ jobs:
492434
exit 1
493435
fi
494436
495-
- name: Test the Autotools distribution (Ubuntu, non-oldest)
496-
if: matrix.os == 'ubuntu-22.04' && matrix.boost != 'oldest'
437+
- name: Test the Autotools distribution (Ubuntu, latest)
438+
if: matrix.os == 'ubuntu-22.04' && matrix.boost == 'latest'
497439
shell: bash
498440
run: |
499441
pwd

scribbu/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pkginclude_HEADERS = scribbu.hh \
5454

5555
AM_YFLAGS = -d
5656
AM_CPPFLAGS = -I$(srcdir)/.. $(BOOST_CPPFLAGS) $(OPENSSL_INCLUDES) $(GUILE_CFLAGS)
57-
AM_CXXFLAGS = -std=c++17 -Wno-register $(GUILE_CFLAGS)
57+
AM_CXXFLAGS = -std=c++20 -Wno-register $(GUILE_CFLAGS)
5858
AM_LDFLAGS = $(BOOST_LDFLAGS) $(LIBUNISTRING)
5959

6060
libscribbu_la_LIBADD = $(GUILE_LIBS) \

src/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ scribbu_SOURCES = scribbu.cc command-utilities.hh command-utilities.cc \
66
AM_CPPFLAGS = -I$(srcdir)/.. $(BOOST_CPPFLAGS) $(GUILE_CFLAGS) -DDATADIR=\"$(datadir)\" -DSCRIBBU_ALWAYS_DUMP_CORE
77
# AM_CPPFLAGS = -I$(srcdir)/.. $(BOOST_CPPFLAGS) $(GUILE_CFLAGS) -DDATADIR=\"$(datadir)\"
88

9-
AM_CXXFLAGS = -std=c++17 $(GUILE_CFLAGS)
9+
AM_CXXFLAGS = -std=c++20 $(GUILE_CFLAGS)
1010
AM_LDFLAGS = $(BOOST_LDFLAGS) $(LIBUNISTRING)
1111
scribbu_LDADD = ../scribbu/libscribbu.la \
1212
$(GUILE_LIBS) \

test/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ unit_SOURCES = unit.cc unit.hh charsets.cc ostream.cc id3v1.cc framesv2.cc \
4444
scribbu.cc id3v2-edit.cc tagset.cc winamp-genres.cc
4545

4646
AM_CPPFLAGS = -DBOOST_TEST_DYN_LINK -I$(srcdir)/.. $(BOOST_CPPFLAGS)
47-
AM_CXXFLAGS = -std=c++17
47+
AM_CXXFLAGS = -std=c++20
4848
AM_LDFLAGS = $(BOOST_LDFLAGS)
4949
unit_LDADD = ../scribbu/libscribbu.la \
5050
$(GUILE_LIBS) \

0 commit comments

Comments
 (0)