Skip to content

Commit 413b898

Browse files
authored
Deprecate Ubuntu 20.04 (#1641)
* not always gh mac runners have nproc utility * deprecate Ubuntu 20.04 * fix linking issues of portable tonlibjson.dylib * fix libemulator.dylib linking issues
1 parent 0cc297b commit 413b898

File tree

7 files changed

+37
-30
lines changed

7 files changed

+37
-30
lines changed

.github/workflows/build-ton-linux-arm64-appimage.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,21 @@ jobs:
3636
uses: actions/cache@v4
3737
with:
3838
path: 3pp
39-
key: ${{ runner.os }}-${{ runner.arch }}-ubuntu-20.04-arm-3pp-${{ hashFiles('**/assembly/native/build-ubuntu-appimages.sh') }}
39+
key: ${{ runner.os }}-${{ runner.arch }}-ubuntu-22.04-arm-3pp-${{ hashFiles('**/assembly/native/build-ubuntu-appimages.sh') }}
4040

4141
- name: Cache OpenSSL
4242
id: cache-openssl
4343
uses: actions/cache@v4
4444
with:
4545
path: openssl_3
46-
key: ${{ runner.os }}-${{ runner.arch }}-ubuntu-20.04-arm-openssl_3-${{ hashFiles('**/assembly/native/build-ubuntu-appimages.sh') }}
46+
key: ${{ runner.os }}-${{ runner.arch }}-ubuntu-22.04-arm-openssl_3-${{ hashFiles('**/assembly/native/build-ubuntu-appimages.sh') }}
4747

4848
- name: Restore cache TON
4949
uses: actions/cache/restore@v4
5050
with:
5151
path: ~/.ccache
52-
key: ${{ runner.os }}-${{ runner.arch }}-ubuntu-20.04-arm-portable-ccache-${{ steps.date-stamp.outputs.timestamp }}
53-
restore-keys: ${{ runner.os }}-${{ runner.arch }}-ubuntu-20.04-arm-portable-ccache
52+
key: ${{ runner.os }}-${{ runner.arch }}-ubuntu-22.04-arm-portable-ccache-${{ steps.date-stamp.outputs.timestamp }}
53+
restore-keys: ${{ runner.os }}-${{ runner.arch }}-ubuntu-22.04-arm-portable-ccache
5454

5555
- name: Build TON
5656
run: |
@@ -65,7 +65,7 @@ jobs:
6565
uses: actions/cache/save@v4
6666
with:
6767
path: ~/.ccache
68-
key: ${{ runner.os }}-${{ runner.arch }}-ubuntu-20.04-arm-portable-ccache-${{ steps.date-stamp.outputs.timestamp }}
68+
key: ${{ runner.os }}-${{ runner.arch }}-ubuntu-22.04-arm-portable-ccache-${{ steps.date-stamp.outputs.timestamp }}
6969

7070
- name: Make AppImages
7171
run: |
@@ -80,8 +80,8 @@ jobs:
8080
uses: actions/cache@v4
8181
with:
8282
path: ~/.ccache
83-
key: ${{ runner.os }}-${{ runner.arch }}-ubuntu-20.04-arm-portable-libs-ccache-${{ steps.date-stamp.outputs.timestamp }}
84-
restore-keys: ${{ runner.os }}-${{ runner.arch }}-ubuntu-20.04-arm-portable-libs-ccache
83+
key: ${{ runner.os }}-${{ runner.arch }}-ubuntu-22.04-arm-portable-libs-ccache-${{ steps.date-stamp.outputs.timestamp }}
84+
restore-keys: ${{ runner.os }}-${{ runner.arch }}-ubuntu-22.04-arm-portable-libs-ccache
8585

8686
- name: Build TON libs
8787
run: |

.github/workflows/build-ton-linux-x86-64-appimage.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on: [push,workflow_dispatch,workflow_call]
44

55
jobs:
66
build:
7-
runs-on: ubuntu-20.04
7+
runs-on: ubuntu-22.04
88

99
steps:
1010
- name: Check out repository
@@ -25,12 +25,6 @@ jobs:
2525
sudo apt remove libgsl-dev
2626
mkdir ~/.ccache 3pp
2727
28-
- name: Install gcc-11 g++-11
29-
run: |
30-
sudo apt install -y manpages-dev software-properties-common
31-
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
32-
sudo apt update && sudo apt install gcc-11 g++-11
33-
3428
- name: Install clang-16
3529
run: |
3630
wget https://apt.llvm.org/llvm.sh
@@ -42,20 +36,20 @@ jobs:
4236
uses: actions/cache@v4
4337
with:
4438
path: 3pp
45-
key: ${{ runner.os }}-${{ runner.arch }}-ubuntu-20.04-3pp-${{ hashFiles('**/assembly/native/build-ubuntu-appimages.sh') }}
39+
key: ${{ runner.os }}-${{ runner.arch }}-ubuntu-22.04-3pp-${{ hashFiles('**/assembly/native/build-ubuntu-appimages.sh') }}
4640

4741
- name: Cache OpenSSL
4842
id: cache-openssl
4943
uses: actions/cache@v4
5044
with:
5145
path: openssl_3
52-
key: ${{ runner.os }}-${{ runner.arch }}-ubuntu-20.04-openssl_3-${{ hashFiles('**/assembly/native/build-ubuntu-appimages.sh') }}
46+
key: ${{ runner.os }}-${{ runner.arch }}-ubuntu-22.04-openssl_3-${{ hashFiles('**/assembly/native/build-ubuntu-appimages.sh') }}
5347

5448
- name: Restore cache TON
5549
uses: actions/cache/restore@v4
5650
with:
5751
path: ~/.ccache
58-
key: ${{ runner.os }}-${{ runner.arch }}-ubuntu-20.04-portable-ccache
52+
key: ${{ runner.os }}-${{ runner.arch }}-ubuntu-22.04-portable-ccache
5953

6054
- name: Build TON
6155
run: |
@@ -70,7 +64,7 @@ jobs:
7064
uses: actions/cache/save@v4
7165
with:
7266
path: ~/.ccache
73-
key: ${{ runner.os }}-${{ runner.arch }}-ubuntu-20.04-portable-ccache-${{ steps.date-stamp.outputs.timestamp }}
67+
key: ${{ runner.os }}-${{ runner.arch }}-ubuntu-22.04-portable-ccache-${{ steps.date-stamp.outputs.timestamp }}
7468

7569
- name: Make AppImages
7670
run: |
@@ -85,8 +79,8 @@ jobs:
8579
uses: actions/cache@v4
8680
with:
8781
path: ~/.ccache
88-
key: ${{ runner.os }}-${{ runner.arch }}-ubuntu-20.04-portable-libs-ccache-${{ steps.date-stamp.outputs.timestamp }}
89-
restore-keys: ${{ runner.os }}-${{ runner.arch }}-ubuntu-20.04-portable-libs-ccache
82+
key: ${{ runner.os }}-${{ runner.arch }}-ubuntu-22.04-portable-libs-ccache-${{ steps.date-stamp.outputs.timestamp }}
83+
restore-keys: ${{ runner.os }}-${{ runner.arch }}-ubuntu-22.04-portable-libs-ccache
9084

9185
- name: Build TON libs
9286
run: |

.github/workflows/build-ton-linux-x86-64-shared.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
strategy:
88
fail-fast: false
99
matrix:
10-
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04]
10+
os: [ubuntu-22.04, ubuntu-24.04]
1111
runs-on: ${{ matrix.os }}
1212

1313
steps:
@@ -28,13 +28,6 @@ jobs:
2828
sudo apt-get install -y build-essential git cmake ninja-build zlib1g-dev libsecp256k1-dev libmicrohttpd-dev libsodium-dev liblz4-dev libjemalloc-dev ccache
2929
mkdir ~/.ccache
3030
31-
- if: matrix.os == 'ubuntu-20.04'
32-
name: Install gcc-11
33-
run: |
34-
sudo apt install -y manpages-dev software-properties-common
35-
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
36-
sudo apt update && sudo apt install gcc-11 g++-11
37-
3831
- if: matrix.os != 'ubuntu-24.04'
3932
run: |
4033
wget https://apt.llvm.org/llvm.sh

assembly/native/build-macos-portable.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ fi
127127
cmake -GNinja .. \
128128
-DPORTABLE=1 \
129129
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=$OSX_TARGET \
130-
-DCMAKE_CXX_FLAGS="-stdlib=libc++" \
131130
-DCMAKE_BUILD_TYPE=Release \
132131
-DOPENSSL_FOUND=1 \
133132
-DOPENSSL_INCLUDE_DIR=$opensslPath/include \

assembly/native/build-macos-shared.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ brew install openssl@3
6666
brew unlink openssl@3 && brew link --overwrite openssl@3
6767

6868
cmake -GNinja -DCMAKE_BUILD_TYPE=Release .. \
69-
-DCMAKE_CXX_FLAGS="-stdlib=libc++" \
7069
-DLZ4_FOUND=1 \
7170
-DLZ4_LIBRARIES=$lz4Path/lib/liblz4.a \
7271
-DLZ4_INCLUDE_DIRS=$lz4Path/lib

emulator/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@ else()
3030
target_link_libraries(emulator PUBLIC emulator_static git)
3131
endif()
3232

33+
if (APPLE)
34+
set(CMAKE_MACOSX_RPATH ON)
35+
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
36+
set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
37+
endif()
38+
39+
if (APPLE AND PORTABLE)
40+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++")
41+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libstdc++")
42+
endif()
43+
3344
generate_export_header(emulator EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/emulator_export.h)
3445
if (EMULATOR_STATIC OR USE_EMSCRIPTEN)
3546
target_compile_definitions(emulator PUBLIC EMULATOR_STATIC_DEFINE)

tonlib/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,17 @@ else()
102102
target_link_libraries(tonlibjson PRIVATE tonlibjson_private)
103103
endif()
104104

105+
if (APPLE)
106+
set(CMAKE_MACOSX_RPATH ON)
107+
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
108+
set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
109+
endif()
110+
111+
if (APPLE AND PORTABLE)
112+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++")
113+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libstdc++")
114+
endif()
115+
105116
generate_export_header(tonlibjson EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/tonlib/tonlibjson_export.h)
106117
if (TONLIBJSON_STATIC OR USE_EMSCRIPTEN)
107118
target_compile_definitions(tonlibjson PUBLIC TONLIBJSON_STATIC_DEFINE)

0 commit comments

Comments
 (0)