Skip to content

Commit

Permalink
feat(flow): upgrade gcc to 14
Browse files Browse the repository at this point in the history
upgrade git action to 24.0.4, which support gcc 14 in default mode.
  • Loading branch information
ShannonBase committed Sep 5, 2024
1 parent bf68581 commit 3d3d1b7
Show file tree
Hide file tree
Showing 21 changed files with 82 additions and 92 deletions.
33 changes: 14 additions & 19 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
lint:
name: lint
# if: ${{ contains(github.event.pull_request.labels.*.name, 'ready-for-testing') && github.event.pull_request.merged != true }}
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -39,17 +39,18 @@ jobs:
build:
needs: lint
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: install_lib
run: |
sudo apt update -y && sudo apt upgrade -y && sudo apt install -y libssl-dev libncurses-dev libudev-dev g++ libbison-dev flex clang-format lcov pkg-config \
cmake zlib1g-dev wget build-essential libldap-dev libisl-dev libmpfr-dev patchelf libevent-dev openssl libssl-dev -y && sudo apt install libsasl2-dev -y
#- name: install_gcc
# run: |
# sudo apt install bison texinfo libgmp3-dev zlib1g-dev -y && sudo apt install gcc-10 g++-10 -y && \
# sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 && sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100
cmake zlib1g-dev libzstd-dev wget build-essential libldap-dev libisl-dev libmpfr-dev patchelf libevent-dev openssl libssl-dev -y && sudo apt install libsasl2-dev -y \
libtirpc-dev
- name: install_gcc_14
run: |
sudo apt install bison texinfo libgmp3-dev zlib1g-dev -y && sudo apt install gcc-14 g++-14 -y && \
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100 && sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100
- name: install_boost
run: |
cd /tmp && wget https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.gz && \
Expand All @@ -58,36 +59,30 @@ jobs:
#sed -i '61s/^/#/' cmake_install.cmake to disable can not find openssl_executeable error. removes it when it fixed.
- name: build_shannon_and_install
run: |
mkdir /home/ShannonBase && cd /home/ShannonBase
cd ${{ github.workspace }}
mkdir cmake_build && cd cmake_build
git config --global --add safe.directory /home/ShannonBase/ShannonBase
git config --global --add safe.directory ${{ github.workspace }}
git fetch --tags -f
cmake ../ \
-DWITH_BOOST=/usr/local/boost/include \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/home/shannon-bin/ \
-DMYSQL_DATADIR=/home/shannon-bin/ \
-DSYSCONFDIR=/home/shannon-bin/ \
-DSYSCONFDIR=. \
-DMYSQL_UNIX_ADDR=/home/shannon-bin/temp/mysql.sock \
-DWITH_EMBEDDED_SERVER=OFF \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DMYSQL_TCP_PORT=3306 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_LIBEVENT=bundled \
-DEXTRA_CHARSETS=all \
-DWITH_PROTOBUF=bundled \
-DWITH_SSL_PATH=/usr/include/openssl/ \
-DDEFAULT_SET=community \
-DWITH_UNIT_TESTS=OFF \
-DWITH_LTO=OFF \
-DWITH_HYPERGRAPH_OPTIMIZER=ON \
-DCOMPILATION_COMMENT="MySQL Community Server, and Shannon Data AI Alpha V.- (GPL)" && make -j5 && \
sed -i '61s/^/#/' cmake_install.cmake && sed -i '62s/^/#/' cmake_install.cmake && sed -i '63s/^/#/' cmake_install.cmake && \
-DCOMPILATION_COMMENT="MySQL Community Server, and Shannon Data AI Alpha V.- (GPL)" && make -j$(nproc) && \
sudo make install
- name: clean_up_shannonbase_build
run: |
sudo rm /home/ShannonBase/ -rf
sudo rm ${{ github.workspace }} -rf
- name: run_mtr_test
run: |
mkdir -p /home/shannon-bin/log
Expand Down
33 changes: 14 additions & 19 deletions .github/workflows/pull-requests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
lint:
name: lint
# if: ${{ contains(github.event.pull_request.labels.*.name, 'ready-for-testing') && github.event.pull_request.merged != true }}
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -59,17 +59,18 @@ jobs:
build:
needs: lint
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: install_lib
run: |
sudo apt update -y && sudo apt upgrade -y && sudo apt install -y libssl-dev libncurses-dev libudev-dev g++ libbison-dev flex clang-format lcov pkg-config \
cmake zlib1g-dev wget build-essential libldap-dev libisl-dev libmpfr-dev patchelf libevent-dev openssl libssl-dev -y && sudo apt install libsasl2-dev -y
#- name: install_gcc
# run: |
# sudo apt install bison texinfo libgmp3-dev zlib1g-dev -y && sudo apt install gcc-10 g++-10 -y && \
# sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 && sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100
cmake zlib1g-dev libzstd-dev wget build-essential libldap-dev libisl-dev libmpfr-dev patchelf libevent-dev openssl libssl-dev -y && sudo apt install libsasl2-dev -y \
libtirpc-dev
- name: install_gcc_14
run: |
sudo apt install bison texinfo libgmp3-dev zlib1g-dev -y && sudo apt install gcc-14 g++-14 -y && \
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100 && sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100
- name: install_boost
run: |
cd /tmp && wget https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.gz && \
Expand All @@ -78,36 +79,30 @@ jobs:
#sed -i '61s/^/#/' cmake_install.cmake to disable can not find openssl_executeable error. removes it when it fixed.
- name: build_shannon_and_install
run: |
mkdir /home/ShannonBase && cd /home/ShannonBase
cd ${{ github.workspace }}
mkdir cmake_build && cd cmake_build
git config --global --add safe.directory /home/ShannonBase
git config --global --add safe.directory ${{ github.workspace }}
git fetch --tags -f
cmake ../ \
-DWITH_BOOST=/usr/local/boost/include \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/home/shannon-bin/ \
-DMYSQL_DATADIR=/home/shannon-bin/ \
-DSYSCONFDIR=/home/shannon-bin/ \
-DSYSCONFDIR=. \
-DMYSQL_UNIX_ADDR=/home/shannon-bin/temp/mysql.sock \
-DWITH_EMBEDDED_SERVER=OFF \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DMYSQL_TCP_PORT=3306 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_LIBEVENT=bundled \
-DEXTRA_CHARSETS=all \
-DWITH_PROTOBUF=bundled \
-DWITH_SSL_PATH=/usr/include/openssl/ \
-DDEFAULT_SET=community \
-DWITH_UNIT_TESTS=OFF \
-DWITH_HYPERGRAPH_OPTIMIZER=ON \
-DCOMPILATION_COMMENT="MySQL Community Server, and Shannon Data AI Alpha V.- (GPL)" && make -j5 && \
sed -i '61s/^/#/' cmake_install.cmake && sed -i '62s/^/#/' cmake_install.cmake && sed -i '63s/^/#/' cmake_install.cmake && \
-DWITH_LTO=OFF \
-DCOMPILATION_COMMENT="MySQL Community Server, and Shannon Data AI Alpha V.- (GPL)" && make -j$(nproc) && \
sudo make install
- name: clean_up_shannonbase_build
run: |
sudo rm /home/ShannonBase/ -rf
sudo rm ${{ github.workspace }} -rf
- name: run_mtr_test
run: |
sudo mkdir -p /home/shannon-bin/log
Expand Down
34 changes: 14 additions & 20 deletions .github/workflows/weekly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
lint:
name: lint
# if: ${{ contains(github.event.pull_request.labels.*.name, 'ready-for-testing') && github.event.pull_request.merged != true }}
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -37,20 +37,20 @@ jobs:
run: |
git diff -U0 --no-color ${{ github.event.pull_request.base.sha }} HEAD storage/rapid_engine ml | /usr/share/clang/clang-format-14/clang-format-diff.py -p1 | tee /tmp/.clang-format-diff
[ -s /tmp/.clang-format-diff ] && exit 1 || true
build:
needs: lint
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: install_lib
run: |
sudo apt update -y && sudo apt upgrade -y && sudo apt install -y libssl-dev libncurses-dev libudev-dev g++ libbison-dev flex clang-format lcov pkg-config \
cmake zlib1g-dev wget build-essential libldap-dev libisl-dev libmpfr-dev patchelf libevent-dev openssl libssl-dev -y && sudo apt install libsasl2-dev -y
#- name: install_gcc
# run: |
# sudo apt install bison texinfo libgmp3-dev zlib1g-dev -y && sudo apt install gcc-10 g++-10 -y && \
# sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 && sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100
cmake zlib1g-dev libzstd-dev wget build-essential libldap-dev libisl-dev libmpfr-dev patchelf libevent-dev openssl libssl-dev -y && sudo apt install libsasl2-dev -y \
libtirpc-dev
- name: install_gcc_14
run: |
sudo apt install bison texinfo libgmp3-dev zlib1g-dev -y && sudo apt install gcc-14 g++-14 -y && \
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100 && sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100
- name: install_boost
run: |
cd /tmp && wget https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.gz && \
Expand All @@ -59,36 +59,30 @@ jobs:
#sed -i '61s/^/#/' cmake_install.cmake to disable can not find openssl_executeable error. removes it when it fixed.
- name: build_shannon_and_install
run: |
mkdir /home/ShannonBase && cd /home/ShannonBase
cd ${{ github.workspace }}
mkdir cmake_build && cd cmake_build
git config --global --add safe.directory /home/ShannonBase/ShannonBase
git config --global --add safe.directory ${{ github.workspace }}
git fetch --tags -f
cmake ../ \
-DWITH_BOOST=/usr/local/boost/include \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/home/shannon-bin/ \
-DMYSQL_DATADIR=/home/shannon-bin/ \
-DSYSCONFDIR=/home/shannon-bin/ \
-DSYSCONFDIR=. \
-DMYSQL_UNIX_ADDR=/home/shannon-bin/temp/mysql.sock \
-DWITH_EMBEDDED_SERVER=OFF \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DMYSQL_TCP_PORT=3306 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_LIBEVENT=bundled \
-DEXTRA_CHARSETS=all \
-DWITH_PROTOBUF=bundled \
-DWITH_SSL_PATH=/usr/include/openssl/ \
-DDEFAULT_SET=community \
-DWITH_UNIT_TESTS=OFF \
-DWITH_LTO=OFF \
-DWITH_HYPERGRAPH_OPTIMIZER=ON \
-DCOMPILATION_COMMENT="MySQL Community Server, and Shannon Data AI Alpha V.- (GPL)" && make -j5 && \
sed -i '61s/^/#/' cmake_install.cmake && sed -i '62s/^/#/' cmake_install.cmake && sed -i '63s/^/#/' cmake_install.cmake && \
-DCOMPILATION_COMMENT="MySQL Community Server, and Shannon Data AI Alpha V.- (GPL)" && make -j$(nproc) && \
sudo make install
- name: clean_up_shannonbase_build
run: |
sudo rm /home/ShannonBase/ -rf && cd .. && sudo rm ./cmake_build -rf
sudo rm ${{ github.workspace }} -rf
- name: run_mtr_test
run: |
mkdir -p /home/shannon-bin/log
Expand Down
Binary file modified extra/jerryscript/lib/libjerry-core.a
Binary file not shown.
Binary file modified extra/jerryscript/lib/libjerry-ext.a
Binary file not shown.
Binary file modified extra/jerryscript/lib/libjerry-port.a
Binary file not shown.
2 changes: 1 addition & 1 deletion extra/jerryscript/lib/pkgconfig/libjerry-core.pc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
prefix=/workshop/tools/jerryscript/install
prefix=/home/lihao/workshop/tools/jerryscript/install
libdir=${prefix}/lib
includedir=${prefix}/include

Expand Down
2 changes: 1 addition & 1 deletion extra/jerryscript/lib/pkgconfig/libjerry-ext.pc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
prefix=/workshop/tools/jerryscript/install
prefix=/home/lihao/workshop/tools/jerryscript/install
libdir=${prefix}/lib
includedir=${prefix}/include

Expand Down
2 changes: 1 addition & 1 deletion extra/jerryscript/lib/pkgconfig/libjerry-port.pc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
prefix=/workshop/tools/jerryscript/install
prefix=/home/lihao/workshop/tools/jerryscript/install
libdir=${prefix}/lib
includedir=${prefix}/include

Expand Down
2 changes: 1 addition & 1 deletion extra/jerryscript/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ How to use jerryscript in ShannonBase:

2) build the static libs, cp the built static libs files to here.
2.1 `mkdir build && cd build`
2.2 `cmake .. -DCMAKE_BUILD_TYPE=Release -DJERRY_CMDLINE=OFF -DBUILD_SHARED_LIBS=OFF -DJERRY_ERROR_MESSAGES=ON -DCMAKE_INSTALL_PREFIX=/path/to/install`
2.2 `cmake .. -DCMAKE_BUILD_TYPE=Release -DJERRY_CMDLINE=OFF -DENABLE_LTO=OFF -DBUILD_SHARED_LIBS=OFF -DJERRY_ERROR_MESSAGES=ON -DCMAKE_INSTALL_PREFIX=/path/to/install`
2.3 `make -j5`
2.4 `make install`
3) update the libs in this folder, to get the latest version of jerryscript.
Expand Down
Binary file modified ml/3rd_party/lightgbm/lib/lib_lightgbm.a
Binary file not shown.
6 changes: 4 additions & 2 deletions sql-common/oci/signing_key.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ Data Signing_Key::sign(const void *message, size_t length) {
* Constructor.
* Read the key from the file.
*/

auto filecloser = [](FILE* file) { if (file) fclose(file); };
Signing_Key::Signing_Key(const std::string &file_name)
: m_private_key{EVP_PKEY_new()} {
std::unique_ptr<FILE, decltype(&fclose)> fp(fopen(file_name.c_str(), "rb"),
&fclose);
std::unique_ptr<FILE, decltype(filecloser)> fp(fopen(file_name.c_str(), "rb"),
filecloser);
if (!fp) {
log_error("Cannot open signing key file " + file_name + "\n");
return;
Expand Down
34 changes: 17 additions & 17 deletions sql/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ ADD_SUBDIRECTORY(server_component)
ADD_SUBDIRECTORY(protobuf)

SET(ML_SOURCES
../ml/auto_ml.cpp
../ml/ml_algorithm.h
../ml/ml_regression.cpp
../ml/ml_classification.cpp
../ml/ml_forecasting.cpp
../ml/ml_anomaly_detection.cpp
../ml/ml_recommendation.cpp
../ml/ml_utils.cpp
#../ml/auto_ml.cpp
#../ml/ml_algorithm.h
#../ml/ml_regression.cpp
#../ml/ml_classification.cpp
#../ml/ml_forecasting.cpp
#../ml/ml_anomaly_detection.cpp
#../ml/ml_recommendation.cpp
#../ml/ml_utils.cpp
)

SET(DD_SOURCES
Expand Down Expand Up @@ -986,15 +986,15 @@ ADD_DEPENDENCIES(sql_dd GenKeywordList)
TARGET_LINK_LIBRARIES(sql_dd sql_gis sql_main)
SET_TARGET_PROPERTIES(sql_dd PROPERTIES LINK_INTERFACE_MULTIPLICITY 3)

INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ml/3rd_party/lightgbm/include/)
LINK_DIRECTORIES(${CMAKE_SOURCE_DIR}/ml/3rd_party/lightgbm/lib)
ADD_LIBRARY(sql_ml STATIC ${ML_SOURCES})
LINK_DIRECTORIES(${CMAKE_SOURCE_DIR}/ml/)
TARGET_INCLUDE_DIRECTORIES(sql_ml PUBLIC
${CMAKE_SOURCE_DIR}/extra/rapidjson/include
${CMAKE_SOURCE_DIR}/ml/3rd_party/lightgbm/include/)
TARGET_LINK_LIBRARIES(sql_ml _lightgbm)
SET_TARGET_PROPERTIES(sql_ml PROPERTIES LINK_INTERFACE_MULTIPLICITY 3)
#INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ml/3rd_party/lightgbm/include/)
#LINK_DIRECTORIES(${CMAKE_SOURCE_DIR}/ml/3rd_party/lightgbm/lib)
#ADD_LIBRARY(sql_ml STATIC ${ML_SOURCES})
#LINK_DIRECTORIES(${CMAKE_SOURCE_DIR}/ml/)
#TARGET_INCLUDE_DIRECTORIES(sql_ml PUBLIC
# ${CMAKE_SOURCE_DIR}/extra/rapidjson/include
# ${CMAKE_SOURCE_DIR}/ml/3rd_party/lightgbm/include/)
#TARGET_LINK_LIBRARIES(sql_ml _lightgbm)
#SET_TARGET_PROPERTIES(sql_ml PROPERTIES LINK_INTERFACE_MULTIPLICITY 3)

INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/extra/jerryscript/include/)
LINK_DIRECTORIES(${CMAKE_SOURCE_DIR}/extra/jerryscript/lib)
Expand Down
7 changes: 7 additions & 0 deletions sql/log_event.cc
Original file line number Diff line number Diff line change
Expand Up @@ -949,11 +949,18 @@ Log_event::Log_event(Log_event_header *header, Log_event_footer *footer)
common_footer(footer) {
#ifdef MYSQL_SERVER
thd = nullptr;
#endif
#if defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wuninitialized"
#endif
/*
Mask out any irrelevant parts of the server_id
*/
server_id = common_header->unmasked_server_id & opt_server_id_mask;
#if defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic pop
#endif
}

/*
Expand Down
4 changes: 2 additions & 2 deletions sql/sql_bitmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ class Bitmap<64> {
ulonglong map;

public:
Bitmap<64>() { init(); }
Bitmap() { init(); }
enum { ALL_BITS = 64 };

explicit Bitmap<64>(uint prefix_to_set) { set_prefix(prefix_to_set); }
explicit Bitmap(uint prefix_to_set) { set_prefix(prefix_to_set); }
void init() { clear_all(); }
void init(uint prefix_to_set) { set_prefix(prefix_to_set); }
uint length() const { return 64; }
Expand Down
2 changes: 1 addition & 1 deletion sql/stream_cipher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ bool Aes_ctr_cipher<TYPE>::open(const Key_string &password, int header_size) {
}

template <Cipher_type TYPE>
Aes_ctr_cipher<TYPE>::~Aes_ctr_cipher<TYPE>() {
Aes_ctr_cipher<TYPE>::~Aes_ctr_cipher() {
close();
}

Expand Down
2 changes: 1 addition & 1 deletion storage/perfschema/pfs_buffer_container.h
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ class PFS_buffer_scalable_iterator {
template <class T>
class PFS_buffer_processor {
public:
virtual ~PFS_buffer_processor<T>() = default;
virtual ~PFS_buffer_processor() = default;
virtual void operator()(T *element) = 0;
};

Expand Down
4 changes: 2 additions & 2 deletions storage/perfschema/pfs_name.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ class Field;
template <int max_length>
struct PFS_any_name {
public:
PFS_any_name<max_length>() { m_length = 0; }
PFS_any_name() { m_length = 0; }

PFS_any_name<max_length>(const PFS_any_name<max_length> &other) {
PFS_any_name(const PFS_any_name<max_length> &other) {
assert(other.m_length <= max_length);

if (0 < other.m_length && other.m_length <= max_length) {
Expand Down
2 changes: 1 addition & 1 deletion storage/rapid_engine/compress/dictionary/dictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ uint32 Dictionary::store(const uchar *str, size_t len, Encoding_type type) {
{
if (m_content.find(compressed_str) == m_content.end()) { // insert new one.
m_content_id.fetch_add(1, std::memory_order::memory_order_acq_rel);
uint64 id = m_content_id.load(std::memory_order::memory_order_acq_rel);
uint64 id = m_content_id.load();
// compressed string <---> str id. get a copy of string and store it in map.
m_content.emplace(compressed_str, id);
// id<---> orginal string
Expand Down
Loading

0 comments on commit 3d3d1b7

Please sign in to comment.