Skip to content

Commit

Permalink
Extract macOS core build into its own workflow; Fixes for macOS build…
Browse files Browse the repository at this point in the history
… failures: (y-scope#133)

* Add fmtlib specialization for ErrorCode
* Manually remove preinstalled Python in macOS build workflow
  • Loading branch information
kirkrodrigues authored Jun 13, 2023
1 parent 235c546 commit 373151f
Show file tree
Hide file tree
Showing 46 changed files with 124 additions and 131 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/clp-core-build-macos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: build-clp-core-macos

on:
push:
paths:
# NOTE: The order of these paths is important since we're using exclusions
- '.github/workflows/clp-core-build-macos.yaml'
- 'components/core/**'
- '!components/core/tools/docker-images/**'
- '!components/core/tools/scripts/lib_install/**'
- 'components/core/tools/scripts/lib_install/macos-12/**'
pull_request:
paths:
# NOTE: The order of these paths is important since we're using exclusions
- '.github/workflows/clp-core-build-macos.yaml'
- 'components/core/**'
- '!components/core/tools/docker-images/**'
- '!components/core/tools/scripts/lib_install/**'
- 'components/core/tools/scripts/lib_install/macos-12/**'
workflow_dispatch:

jobs:
build-macos:
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

# See https://github.com/actions/setup-python/issues/577
- name: Remove preinstalled binaries which conflict with brew's installs
run: |
rm -f /usr/local/bin/2to3*
rm -f /usr/local/bin/idle3*
rm -f /usr/local/bin/pydoc3*
rm -f /usr/local/bin/python3*
- name: Install dependencies
run: ./components/core/tools/scripts/lib_install/macos-12/install-all.sh

- name: Build CLP Core
uses: ./.github/actions/clp-core-build
20 changes: 4 additions & 16 deletions .github/workflows/clp-core-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ name: build-clp-core
on:
push:
paths:
- 'components/core/**'
- '.github/workflows/clp-core-build.yaml'
- 'components/core/**'
- '!components/core/tools/scripts/lib_install/macos-12/**'
pull_request:
paths:
- 'components/core/**'
- '.github/workflows/clp-core-build.yaml'
- 'components/core/**'
- '!components/core/tools/scripts/lib_install/macos-12/**'
workflow_dispatch:
workflow_run:
workflows: ["generate-build-dependency-image"]
Expand Down Expand Up @@ -109,17 +111,3 @@ jobs:

- name: Build CLP Core
uses: ./.github/actions/clp-core-build

build-macos:
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Install dependencies
run: ./components/core/tools/scripts/lib_install/macos-12/install-all.sh

- name: Build CLP Core
uses: ./.github/actions/clp-core-build
5 changes: 4 additions & 1 deletion components/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ set(SOURCE_FILES_clp
src/Query.hpp
src/ReaderInterface.cpp
src/ReaderInterface.hpp
src/spdlog_with_specializations.hpp
src/SQLiteDB.cpp
src/SQLiteDB.hpp
src/SQLitePreparedStatement.cpp
Expand Down Expand Up @@ -407,6 +408,7 @@ set(SOURCE_FILES_clg
src/Query.hpp
src/ReaderInterface.cpp
src/ReaderInterface.hpp
src/spdlog_with_specializations.hpp
src/SQLiteDB.cpp
src/SQLiteDB.hpp
src/SQLitePreparedStatement.cpp
Expand Down Expand Up @@ -546,6 +548,7 @@ set(SOURCE_FILES_clo
src/Query.hpp
src/ReaderInterface.cpp
src/ReaderInterface.hpp
src/spdlog_with_specializations.hpp
src/SQLiteDB.cpp
src/SQLiteDB.hpp
src/SQLitePreparedStatement.cpp
Expand Down Expand Up @@ -691,7 +694,6 @@ set(SOURCE_FILES_unitTest
src/ffi/search/CompositeWildcardToken.hpp
src/ffi/search/ExactVariableToken.cpp
src/ffi/search/ExactVariableToken.hpp
src/ffi/search/fmtlib_specializations.hpp
src/ffi/search/query_methods.cpp
src/ffi/search/query_methods.hpp
src/ffi/search/QueryMethodFailed.hpp
Expand Down Expand Up @@ -745,6 +747,7 @@ set(SOURCE_FILES_unitTest
src/Query.hpp
src/ReaderInterface.cpp
src/ReaderInterface.hpp
src/spdlog_with_specializations.hpp
src/SQLiteDB.cpp
src/SQLiteDB.hpp
src/SQLitePreparedStatement.cpp
Expand Down
1 change: 1 addition & 0 deletions components/core/cmake/utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ set(SOURCE_FILES_make-dictionaries-readable
${CMAKE_CURRENT_SOURCE_DIR}/src/ParsedMessage.hpp
${CMAKE_CURRENT_SOURCE_DIR}/src/ReaderInterface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/ReaderInterface.hpp
${CMAKE_CURRENT_SOURCE_DIR}/src/spdlog_with_specializations.hpp
${CMAKE_CURRENT_SOURCE_DIR}/src/streaming_compression/Decompressor.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/streaming_compression/Decompressor.hpp
${CMAKE_CURRENT_SOURCE_DIR}/src/streaming_compression/passthrough/Decompressor.cpp
Expand Down
4 changes: 1 addition & 3 deletions components/core/src/ArrayBackedPosIntSet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
#include <unordered_set>
#include <vector>

// spdlog
#include <spdlog/spdlog.h>

// Project headers
#include "Defs.h"
#include "spdlog_with_specializations.hpp"
#include "streaming_compression/zstd/Compressor.hpp"
#include "TraceableException.hpp"

Expand Down
4 changes: 1 addition & 3 deletions components/core/src/DictionaryWriter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
#include <unordered_set>
#include <vector>

// spdlog
#include <spdlog/spdlog.h>

// Project headers
#include "ArrayBackedPosIntSet.hpp"
#include "Defs.h"
#include "dictionary_utils.hpp"
#include "FileWriter.hpp"
#include "spdlog_with_specializations.hpp"
#include "streaming_compression/passthrough/Compressor.hpp"
#include "streaming_compression/passthrough/Decompressor.hpp"
#include "streaming_compression/zstd/Compressor.hpp"
Expand Down
4 changes: 1 addition & 3 deletions components/core/src/EncodedVariableInterpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
#include <cassert>
#include <cmath>

// spdlog
#include <spdlog/spdlog.h>

// Project headers
#include "Defs.h"
#include "ffi/encoding_methods.hpp"
#include "spdlog_with_specializations.hpp"
#include "string_utils.hpp"
#include "type_utils.hpp"

Expand Down
4 changes: 1 addition & 3 deletions components/core/src/FileWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@
#include <cassert>
#include <cerrno>

// spdlog
#include <spdlog/spdlog.h>

// Project headers
#include "Defs.h"
#include "Platform.hpp"
#include "spdlog_with_specializations.hpp"

// Define a fdatasync shim for compilation (just compilation) on macOS
#if defined(__APPLE__) || defined(__MACH__)
Expand Down
4 changes: 1 addition & 3 deletions components/core/src/GlobalSQLiteMetadataDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
// fmt
#include <fmt/core.h>

// spdlog
#include <spdlog/spdlog.h>

// Project headers
#include "database_utils.hpp"
#include "spdlog_with_specializations.hpp"
#include "streaming_archive/Constants.hpp"
#include "type_utils.hpp"

Expand Down
4 changes: 2 additions & 2 deletions components/core/src/LibarchiveFileReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
// C++ standard libraries
#include <cstring>

// spdlog
#include <spdlog/spdlog.h>
// Project headers
#include "spdlog_with_specializations.hpp"

ErrorCode LibarchiveFileReader::try_get_pos (size_t& pos) {
if (nullptr == m_archive) {
Expand Down
4 changes: 1 addition & 3 deletions components/core/src/LibarchiveReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
// libarchive
#include <archive_entry.h>

// spdlog
#include <spdlog/spdlog.h>

// Project headers
#include "Defs.h"
#include "spdlog_with_specializations.hpp"

ErrorCode LibarchiveReader::try_open (size_t buffer_length, const char* buffer, FileReader& file_reader, const std::string& path_if_compressed_file) {
// Create and initialize internal libarchive
Expand Down
4 changes: 2 additions & 2 deletions components/core/src/MySQLDB.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "MySQLDB.hpp"

// spdlog
#include <spdlog/spdlog.h>
// Project headers
#include "spdlog_with_specializations.hpp"

using std::string;

Expand Down
4 changes: 1 addition & 3 deletions components/core/src/MySQLPreparedStatement.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#include "MySQLPreparedStatement.hpp"

// spdlog
#include <spdlog/spdlog.h>

// Project headers
#include "Defs.h"
#include "spdlog_with_specializations.hpp"

using std::string;

Expand Down
4 changes: 1 addition & 3 deletions components/core/src/PageAllocatedVector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@
#include <cstring>
#include <vector>

// spdlog
#include <spdlog/spdlog.h>

// Project headers
#include "Defs.h"
#include "ErrorCode.hpp"
#include "Platform.hpp"
#include "spdlog_with_specializations.hpp"
#include "TraceableException.hpp"

// Define a MREMAP_MAYMOVE shim for compilation (just compilation) on macOS
Expand Down
4 changes: 1 addition & 3 deletions components/core/src/SQLiteDB.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#include "SQLiteDB.hpp"

// spdlog
#include <spdlog/spdlog.h>

// Project headers
#include "Defs.h"
#include "spdlog_with_specializations.hpp"

using std::string;

Expand Down
4 changes: 1 addition & 3 deletions components/core/src/SQLitePreparedStatement.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#include "SQLitePreparedStatement.hpp"

// spdlog
#include <spdlog/spdlog.h>

// Project headers
#include "Defs.h"
#include "spdlog_with_specializations.hpp"

using std::string;

Expand Down
4 changes: 1 addition & 3 deletions components/core/src/Thread.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#include "Thread.hpp"

// spdlog
#include <spdlog/spdlog.h>

// Project headers
#include "Defs.h"
#include "spdlog_with_specializations.hpp"

using std::system_error;

Expand Down
4 changes: 2 additions & 2 deletions components/core/src/TimestampPattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
// Date library
#include "../submodules/date/include/date/date.h"

// spdlog
#include <spdlog/spdlog.h>
// Project headers
#include "spdlog_with_specializations.hpp"

using std::string;
using std::to_string;
Expand Down
4 changes: 1 addition & 3 deletions components/core/src/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
#include <boost/algorithm/string.hpp>
#include <boost/lexical_cast.hpp>

// spdlog
#include <spdlog/spdlog.h>

// Project headers
#include "spdlog_with_specializations.hpp"
#include "string_utils.hpp"

using std::list;
Expand Down
4 changes: 1 addition & 3 deletions components/core/src/VariableDictionaryWriter.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#include "VariableDictionaryWriter.hpp"

// spdlog
#include <spdlog/spdlog.h>

// Project headers
#include "dictionary_utils.hpp"
#include "spdlog_with_specializations.hpp"

bool VariableDictionaryWriter::add_entry (const std::string& value, variable_dictionary_id_t& id) {
bool new_entry = false;
Expand Down
4 changes: 1 addition & 3 deletions components/core/src/clg/CommandLineArguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
// Boost libraries
#include <boost/program_options.hpp>

// spdlog
#include <spdlog/spdlog.h>

// Project headers
#include "../spdlog_with_specializations.hpp"
#include "../version.hpp"

namespace po = boost::program_options;
Expand Down
2 changes: 1 addition & 1 deletion components/core/src/clg/clg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

// spdlog
#include <spdlog/sinks/stdout_sinks.h>
#include <spdlog/spdlog.h>

// Project headers
#include "../Defs.h"
Expand All @@ -16,6 +15,7 @@
#include "../GlobalMySQLMetadataDB.hpp"
#include "../GlobalSQLiteMetadataDB.hpp"
#include "../Profiler.hpp"
#include "../spdlog_with_specializations.hpp"
#include "../streaming_archive/Constants.hpp"
#include "CommandLineArguments.hpp"

Expand Down
4 changes: 1 addition & 3 deletions components/core/src/clo/CommandLineArguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
// Boost libraries
#include <boost/program_options.hpp>

// spdlog
#include <spdlog/spdlog.h>

// Project headers
#include "../spdlog_with_specializations.hpp"
#include "../version.hpp"

namespace po = boost::program_options;
Expand Down
4 changes: 1 addition & 3 deletions components/core/src/clo/ControllerMonitoringThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
// C standard libraries
#include <unistd.h>

// spdlog
#include <spdlog/spdlog.h>

// Project headers
#include "../networking/socket_utils.hpp"
#include "../spdlog_with_specializations.hpp"

void ControllerMonitoringThread::thread_method () {
// Wait for the controller socket to close
Expand Down
2 changes: 1 addition & 1 deletion components/core/src/clo/clo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@

// spdlog
#include <spdlog/sinks/stdout_sinks.h>
#include <spdlog/spdlog.h>

// Project headers
#include "../Defs.h"
#include "../compressor_frontend/utils.hpp"
#include "../Grep.hpp"
#include "../Profiler.hpp"
#include "../networking/socket_utils.hpp"
#include "../spdlog_with_specializations.hpp"
#include "../streaming_archive/Constants.hpp"
#include "../Utils.hpp"
#include "CommandLineArguments.hpp"
Expand Down
Loading

0 comments on commit 373151f

Please sign in to comment.