Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade dependencies and CI config #804

Merged
merged 7 commits into from
Dec 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# TODO: The bugprone-implicit-widening-of-multiplication-result is nice,
# but current implementation is over-pedantic.
# See https://github.com/llvm/llvm-project/issues/52806.

Checks: >
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
cert-*,
-cert-err58-cpp,
clang-analyzer-*,
Expand All @@ -15,11 +21,12 @@ Checks: >
readability-*,
-readability-braces-around-statements,
-readability-else-after-return,
-readability-function-cognitive-complexity,
-readability-implicit-bool-conversion,
-readability-magic-numbers,
-readability-named-parameter,
-readability-qualified-auto,
-readability-uppercase-literal-suffix,

WarningsAsErrors: '*'
FormatStyle: file
FormatStyle: file
1 change: 1 addition & 0 deletions .codespell-whitelist
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
mut
crate
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also not sure why, it's a normal English word?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. The codespell suggests crate -> create.

1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES Clang)
-Wno-double-promotion
-Wno-float-equal
-Wno-padded
-Wno-return-std-move-in-c++11
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was this causing?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This flag does not exist any more.

-Wno-switch-enum
)
endif()
Expand Down
30 changes: 9 additions & 21 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ parameters:
executors:
linux-gcc-latest:
docker:
- image: ethereum/cpp-build-env:16-gcc-10
- image: ethereum/cpp-build-env:17-gcc-11
linux-clang-latest:
docker:
- image: ethereum/cpp-build-env:16-clang-11
- image: ethereum/cpp-build-env:17-clang-13
macos:
macos:
xcode: 11.6.0
rust:
docker:
- image: cimg/rust:1.49
- image: cimg/rust:1.57

commands:
install_macos_deps:
Expand Down Expand Up @@ -720,16 +720,10 @@ workflows:
unless: <<pipeline.parameters.benchmark>>
jobs:
- lint
- release-linux:
requires:
- release-native-linux
- release-linux
- release-native-linux
- release-macos:
requires:
- release-native-macos
- release-native-macos:
requires:
- sanitizers-macos
- release-macos
- release-native-macos
- coverage-gcc
- coverage-clang
- sanitizers-clang
Expand All @@ -739,16 +733,10 @@ workflows:
- spectest:
requires:
- coverage-clang
- arm64-linux:
requires:
- coverage-gcc
- arm64-linux
- bindings-rust
- bindings-rust-asan:
requires:
- bindings-rust
- bindings-rust-coverage:
requires:
- bindings-rust
- bindings-rust-asan
- bindings-rust-coverage

benchmarking:
when: <<pipeline.parameters.benchmark>>
Expand Down
16 changes: 13 additions & 3 deletions cmake/Hunter/config.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
# Hunter local configuration.

hunter_config(
GTest
VERSION 1.11.0
URL https://github.com/google/googletest/archive/release-1.11.0.tar.gz
SHA1 7b100bb68db8df1060e178c495f3cbe941c9b058
CMAKE_ARGS
HUNTER_INSTALL_LICENSE_FILES=LICENSE
gtest_force_shared_crt=TRUE
)

hunter_config(
benchmark
VERSION 1.5.3
URL https://github.com/google/benchmark/archive/v1.5.3.tar.gz
SHA1 32655d8796e708439ac5d4de8aa31f00d9dbda3b
VERSION 1.6.0
URL https://github.com/google/benchmark/archive/v1.6.0.tar.gz
SHA1 c4d1a9135e779c5507015ccc8c428cb4aca69cef
)
6 changes: 4 additions & 2 deletions lib/fizzy/asserts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@
#include "asserts.hpp"

#ifdef GCOV
extern "C" void __gcov_flush();
/// Explicitly dump coverage counters.
/// https://gcc.gnu.org/onlinedocs/gcc/Gcov-and-Optimization.html
extern "C" void __gcov_dump();
#endif

namespace fizzy
{
bool unreachable() noexcept
{
#ifdef GCOV
__gcov_flush();
__gcov_dump();
#endif
return false; // LCOV_EXCL_LINE
}
Expand Down
2 changes: 1 addition & 1 deletion test/unittests/parser_expr_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ TEST(parser_expr, instr_br_table_as_return)
*/

const auto code_bin = i32_const(0) + "0e00000b"_bytes;
const auto [code, _] = parse_expr(code_bin);
const auto [code, end] = parse_expr(code_bin);
EXPECT_THAT(code.instructions,
ElementsAre(Instr::i32_const, 0, 0, 0, 0, Instr::br_table, /*label_count:*/ 0, 0, 0, 0,
/*arity:*/ 0, 0, 0, 0, /*code_offset:*/ 22, 0, 0, 0, /*stack_drop:*/ 0, 0, 0, 0,
Expand Down
2 changes: 1 addition & 1 deletion test/unittests/validation_stack_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ TEST(validation_stack, br_table)
EXPECT_THAT(module->codesec[0].max_stack_height, 2);
}

TEST(validation_stack, return_)
TEST(validation_stack, return_1)
{
/* wat2wasm
(func
Expand Down
4 changes: 2 additions & 2 deletions test/utils/typed_value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
namespace fizzy::test
{
/// Creates uint64_t value with intention to map it to i64 WebAssembly type.
inline constexpr uint64_t operator"" _u64(unsigned long long x)
inline constexpr uint64_t operator""_u64(unsigned long long x)
{
return uint64_t{x}; // Guarantees lossless conversion if needed.
}

/// Creates uint32_t value with intention to map it to i32 WebAssembly type.
inline constexpr uint32_t operator"" _u32(unsigned long long x)
inline constexpr uint32_t operator""_u32(unsigned long long x)
{
const auto v = static_cast<uint32_t>(x);
if (v != x)
Expand Down
2 changes: 1 addition & 1 deletion test/utils/wasm3_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ WasmEngine::Result Wasm3Engine::execute(
{
unsigned ret_valid;
uint64_t ret_value;
IM3Function function = reinterpret_cast<IM3Function>(func_ref);
auto function = reinterpret_cast<IM3Function>(func_ref); // NOLINT(performance-no-int-to-ptr)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably new clang-tidy warning (as I upgraded to clang-tidy-13). Pointer to integer cast blocks some optimizations. https://clang.llvm.org/extra/clang-tidy/checks/performance-no-int-to-ptr.html.

auto const result = m3_CallProper(
function, static_cast<uint32_t>(args.size()), args.data(), &ret_valid, &ret_value);
if (result == m3Err_none)
Expand Down