Skip to content

Commit

Permalink
Merge pull request #2546 from finos/fix-windows-build
Browse files Browse the repository at this point in the history
Update to LLVM 17 & fix Python/Windows build
  • Loading branch information
texodus authored Feb 27, 2024
2 parents fda23d8 + 343c927 commit 0ea5b4e
Show file tree
Hide file tree
Showing 16 changed files with 83 additions and 67 deletions.
29 changes: 15 additions & 14 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ AlignConsecutiveMacros:
AcrossComments: false
AlignCompound: false
PadOperators: false
# AlignConsecutiveShortCaseStatements:
# Enabled: false
# AcrossEmptyLines: false
# AcrossComments: false
# AlignCaseColons: false
AlignConsecutiveShortCaseStatements:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCaseColons: false
AlignEscapedNewlines: Right
AlignOperands: DontAlign
AlignTrailingComments:
Expand Down Expand Up @@ -141,7 +141,7 @@ IntegerLiteralSeparator:
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
# KeepEmptyLinesAtEOF: false
KeepEmptyLinesAtEOF: false
LambdaBodyIndentation: Signature
LineEnding: LF
MacroBlockBegin: ""
Expand Down Expand Up @@ -170,6 +170,7 @@ QualifierAlignment: Leave
ReferenceAlignment: Pointer
ReflowComments: true
RemoveBracesLLVM: false
RemoveParentheses: Leave
RemoveSemicolon: false
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: OuterScope
Expand All @@ -187,7 +188,7 @@ SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
# SpaceBeforeJsonColon: false
SpaceBeforeJsonColon: false
SpaceBeforeParens: ControlStatements
SpaceBeforeParensOptions:
AfterControlStatements: true
Expand All @@ -208,12 +209,12 @@ SpacesInContainerLiterals: true
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
# SpacesInParens: Never
# SpacesInParensOptions:
# InCStyleCasts: false
# InConditionalStatements: false
# InEmptyParentheses: false
# Other: false
SpacesInParens: Never
SpacesInParensOptions:
InCStyleCasts: false
InConditionalStatements: false
InEmptyParentheses: false
Other: false
SpacesInSquareBrackets: false
Standard: c++17
StatementAttributeLikeMacros:
Expand All @@ -223,7 +224,7 @@ StatementMacros:
- QT_REQUIRE_VERSION
TabWidth: 4
UseTab: Never
# VerilogBreakBetweenInstancePorts: true
VerilogBreakBetweenInstancePorts: true
WhitespaceSensitiveMacros:
- BOOST_PP_STRINGIZE
- CF_SWIFT_NAME
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,10 @@ jobs:
# Dependencies #
################
################
- name: Install LLVM 16
- name: Install LLVM 17
uses: KyleMayes/install-llvm-action@v1
with:
version: "16"
version: "17"
directory: "./.llvm"

# JS
Expand Down Expand Up @@ -462,10 +462,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Install LLVM and Clang
- name: Install LLVM 17
uses: KyleMayes/install-llvm-action@v1
with:
version: "16"
version: "17"
directory: "./.llvm"

##########
Expand Down Expand Up @@ -1067,12 +1067,12 @@ jobs:
# Dependencies #
################
################
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
if: false
with:
version: "16"
directory: "./.llvm"
# - name: Install LLVM 17
# uses: KyleMayes/install-llvm-action@v1
# if: false
# with:
# version: "17"
# directory: "./.llvm"

# JS
- name: Install yarn
Expand Down
15 changes: 10 additions & 5 deletions cpp/perspective/src/cpp/arrow_csv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ ParseYYYY_MM_DD(const char* s, arrow_vendored::date::year_month_day* out) {
*out = {
arrow_vendored::date::year{year},
arrow_vendored::date::month{month},
arrow_vendored::date::day{day}};
arrow_vendored::date::day{day}
};
return out->ok();
}

Expand All @@ -99,7 +100,8 @@ ParseYYYY_DD_MM(const char* s, arrow_vendored::date::year_month_day* out) {
*out = {
arrow_vendored::date::year{year},
arrow_vendored::date::month{month},
arrow_vendored::date::day{day}};
arrow_vendored::date::day{day}
};
return out->ok();
}

Expand All @@ -125,7 +127,8 @@ ParseYYYY_D_M(const char* s, arrow_vendored::date::year_month_day* out) {
*out = {
arrow_vendored::date::year{year},
arrow_vendored::date::month{month},
arrow_vendored::date::day{day}};
arrow_vendored::date::day{day}
};
return out->ok();
}

Expand Down Expand Up @@ -390,7 +393,8 @@ std::vector<std::shared_ptr<arrow::TimestampParser>> DATE_PARSERS{
arrow::TimestampParser::MakeStrptime("%m/%d/%Y"),
arrow::TimestampParser::MakeStrptime("%d %m %Y"),
// TODO: time type column
arrow::TimestampParser::MakeStrptime("%H:%M:%S.%f")};
arrow::TimestampParser::MakeStrptime("%H:%M:%S.%f")
};

std::vector<std::shared_ptr<arrow::TimestampParser>> DATE_READERS{
std::make_shared<UnixTimestampParser>(),
Expand All @@ -402,7 +406,8 @@ std::vector<std::shared_ptr<arrow::TimestampParser>> DATE_READERS{
arrow::TimestampParser::MakeStrptime("%m-%d-%Y"),
arrow::TimestampParser::MakeStrptime("%m/%d/%Y"),
arrow::TimestampParser::MakeStrptime("%d %m %Y"),
arrow::TimestampParser::MakeStrptime("%H:%M:%S.%f")};
arrow::TimestampParser::MakeStrptime("%H:%M:%S.%f")
};

int64_t
parseAsArrowTimestamp(const std::string& input) {
Expand Down
9 changes: 6 additions & 3 deletions cpp/perspective/src/cpp/computed_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,8 @@ const std::string days_of_week[7] = {
"4 Wednesday",
"5 Thursday",
"6 Friday",
"7 Saturday"};
"7 Saturday"
};

const std::string months_of_year[12] = {
"01 January",
Expand All @@ -989,7 +990,8 @@ const std::string months_of_year[12] = {
"09 September",
"10 October",
"11 November",
"12 December"};
"12 December"
};

day_of_week::day_of_week(
t_expression_vocab& expression_vocab, bool is_type_validator
Expand Down Expand Up @@ -1158,7 +1160,8 @@ tsl::hopscotch_map<char, t_date_bucket_unit> bucket::UNIT_MAP = {
{'D', t_date_bucket_unit::DAYS},
{'W', t_date_bucket_unit::WEEKS},
{'M', t_date_bucket_unit::MONTHS},
{'Y', t_date_bucket_unit::YEARS}};
{'Y', t_date_bucket_unit::YEARS}
};

bucket::bucket() : exprtk::igeneric_function<t_tscalar>("T?") {}

Expand Down
3 changes: 2 additions & 1 deletion cpp/perspective/src/cpp/date_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ const std::string t_date_parser::VALID_FORMATS[12] = {
"%m %d %Y",
"%m/%d/%Y",
"%m/%d/%y",
"%d %m %Y"};
"%d %m %Y"
};

t_date_parser::t_date_parser() {}

Expand Down
3 changes: 2 additions & 1 deletion cpp/perspective/src/cpp/gnode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ t_gnode::t_gnode(t_schema input_schema, t_schema output_schema) :
m_output_schema,
m_output_schema,
trans_schema,
existed_schema};
existed_schema
};
m_epoch = std::chrono::high_resolution_clock::now();
}

Expand Down
3 changes: 2 additions & 1 deletion cpp/perspective/src/cpp/storage_impl_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ t_lstore::create_file() {
}

void*
t_lstore::create_mapping() const {
// NOLINTNEXTLINE
t_lstore::create_mapping() {
void* rval = mmap(0, capacity(), m_mprot, m_mflags, m_fd, 0);
PSP_VERBOSE_ASSERT(rval != MAP_FAILED, "mmap failed");
return rval;
Expand Down
3 changes: 2 additions & 1 deletion cpp/perspective/src/cpp/storage_impl_osx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ t_lstore::create_file() {
}

void*
t_lstore::create_mapping() const {
// NOLINTNEXTLINE
t_lstore::create_mapping() {
void* rval = mmap(nullptr, capacity(), m_mprot, m_mflags, m_fd, 0);
PSP_VERBOSE_ASSERT(rval, != MAP_FAILED, "mmap failed");
return rval;
Expand Down
2 changes: 1 addition & 1 deletion cpp/perspective/src/cpp/storage_impl_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ t_lstore::create_file() {
}

void*
t_lstore::create_mapping() const {
t_lstore::create_mapping() {
std::pair<std::uint32_t, std::uint32_t> capacity = capacity_pair();

m_winmapping_handle = CreateFileMapping(
Expand Down
22 changes: 14 additions & 8 deletions cpp/perspective/src/cpp/vendor/arrow_single_threaded_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ namespace csv {
std::shared_ptr<DataType> type
) {
return Column{
std::move(col_name), col_index, false, std::move(type)};
std::move(col_name), col_index, false, std::move(type)
};
}

static Column
Expand Down Expand Up @@ -308,7 +309,8 @@ namespace csv {
block_index_++,
is_final,
bytes_skipped,
[](int64_t) { return Status::OK(); }});
[](int64_t) { return Status::OK(); }
});
}
partial_ = std::move(empty);
}
Expand Down Expand Up @@ -353,7 +355,8 @@ namespace csv {
block_index_++,
is_final,
bytes_skipped,
std::move(consume_bytes)});
std::move(consume_bytes)
});
}
};

Expand Down Expand Up @@ -453,7 +456,8 @@ namespace csv {
}
views = {
std::string_view(*straddling),
std::string_view(*block.buffer)};
std::string_view(*block.buffer)
};
} else {
views = {std::string_view(*block.buffer)};
}
Expand All @@ -470,7 +474,8 @@ namespace csv {
return ParsedBlock{
std::move(parser),
block.block_index,
static_cast<int64_t>(parsed_size) + block.bytes_skipped};
static_cast<int64_t>(parsed_size) + block.bytes_skipped
};
}

private:
Expand Down Expand Up @@ -736,8 +741,8 @@ namespace csv {
);
}
views = {
std::string_view(*straddling),
std::string_view(*block)};
std::string_view(*straddling), std::string_view(*block)
};
} else {
views = {std::string_view(*block)};
}
Expand All @@ -751,7 +756,8 @@ namespace csv {
num_rows_seen_ += parser->total_num_rows();
}
return ParseResult{
std::move(parser), static_cast<int64_t>(parsed_size)};
std::move(parser), static_cast<int64_t>(parsed_size)
};
}

io::IOContext io_context_;
Expand Down
14 changes: 9 additions & 5 deletions cpp/perspective/src/cpp/vendor/single_threaded_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,8 @@ namespace ipc {
static inline FileBlock
FileBlockFromFlatbuffer(const flatbuf::Block* block) {
return FileBlock{
block->offset(), block->metaDataLength(), block->bodyLength()};
block->offset(), block->metaDataLength(), block->bodyLength()
};
}

Status
Expand Down Expand Up @@ -1542,7 +1543,8 @@ namespace ipc {
));
}
return RecordBatchWithMetadata{
std::move(batch), std::move(custom_metadata)};
std::move(batch), std::move(custom_metadata)
};
}

RETURN_NOT_OK(WaitForDictionaryReadFinished());
Expand Down Expand Up @@ -2489,7 +2491,8 @@ namespace ipc {
if (cached_source_) {
auto cached_source = cached_source_;
io::ReadRange range{
block.offset, block.metadata_length + block.body_length};
block.offset, block.metadata_length + block.body_length
};
auto* pool = state_->options_.memory_pool;
return cached_source->WaitFor({range}).Then(
[cached_source, pool, range](
Expand Down Expand Up @@ -3553,8 +3556,9 @@ namespace ipc {
} else {
// no real IO is performed, it is only saved into a vector for
// replaying later
read_ranges_.emplace_back(io::ReadRange{
position, num_bytes_read});
read_ranges_.emplace_back(
io::ReadRange{position, num_bytes_read}
);
}
return num_bytes_read;
}
Expand Down
15 changes: 2 additions & 13 deletions cpp/perspective/src/include/perspective/date.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,8 @@

namespace perspective {
static const std::int32_t CUMULATIVE_DAYS[2][13] = {
{0,
31,
59,
90,
120,
151,
181,
212,
243,
273,
304,
334,
365} /* Normal years. */,
{0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365
} /* Normal years. */,
{0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366} /* Leap
years.
*/
Expand Down
3 changes: 2 additions & 1 deletion cpp/perspective/src/include/perspective/storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ class PERSPECTIVE_MPROTECT_EXPORT t_lstore : public t_debug_helper
private:
void reserve_impl(t_uindex capacity, bool allow_shrink);
t_handle create_file();
void* create_mapping() const;
// NOLINTNEXTLINE
void* create_mapping();
void resize_mapping(t_uindex cap_new);
void destroy_mapping();

Expand Down
3 changes: 2 additions & 1 deletion cpp/perspective/src/include/perspective/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ static unsigned short const int __mon_yday[2][13] = {
/* Normal years. */
{0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365},
/* Leap years. */
{0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366}};
{0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366}
};
class t_time;

// A simple difference in ms between two t_times can be
Expand Down
Loading

0 comments on commit 0ea5b4e

Please sign in to comment.