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

Build with -Werror on CI #7646

Merged
merged 1 commit into from
Apr 30, 2024
Merged

Build with -Werror on CI #7646

merged 1 commit into from
Apr 30, 2024

Conversation

tgoyne
Copy link
Member

@tgoyne tgoyne commented Apr 29, 2024

We used to have the Jenkins error parser that made the job fail if there were any warnings, but now we have nothing and warnings can slip through. This is a little worse as it makes the build fail immediately rather than letting it run the tests, but it's better than nothing.

@@ -114,7 +114,7 @@ std::optional<CollectionType> process_collection(const Property& property)
else if (is_dictionary(property.type)) {
return CollectionType::Dictionary;
}
return {};
return std::nullopt;
Copy link
Member Author

Choose a reason for hiding this comment

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

This is working around a bug in GCC 9 which was fixed in 10.

@@ -142,7 +142,7 @@ void SyncManager::do_make_logger()
REALM_ASSERT(m_logger_ptr);
}

const std::shared_ptr<util::Logger>& SyncManager::get_logger() const
std::shared_ptr<util::Logger> SyncManager::get_logger() const
Copy link
Member Author

Choose a reason for hiding this comment

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

Returning a reference here exposed the field which was supposed to be guarded by the mutex.

@@ -3091,7 +3091,7 @@ TEMPLATE_TEST_CASE("client reset collections of links", "[sync][pbs][client rese
{Remove{dest_pk_1}, Remove{dest_pk_2}}, {dest_pk_3, dest_pk_4});
}
}
else if constexpr (test_type_is_set) {
if constexpr (test_type_is_set) {
Copy link
Member Author

Choose a reason for hiding this comment

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

With the else here, GCC determined that this if was unreachable without ever evaluating test_type_is_set and so produced an unused variable warning. This is IMO a bug in GCC, but removing the else doesn't change anything.

@tgoyne tgoyne force-pushed the tg/werror branch 2 times, most recently from 1755db2 to d010fad Compare April 29, 2024 18:04
Copy link

coveralls-official bot commented Apr 29, 2024

Pull Request Test Coverage Report for Build thomas.goyne_324

Details

  • 3 of 5 (60.0%) changed or added relevant lines in 4 files are covered.
  • 80 unchanged lines in 14 files lost coverage.
  • Overall coverage decreased (-0.01%) to 90.74%

Changes Missing Coverage Covered Lines Changed/Added Lines %
test/test_encrypted_file_mapping.cpp 0 2 0.0%
Files with Coverage Reduction New Missed Lines %
src/realm/index_string.cpp 1 85.17%
src/realm/sync/noinst/client_impl_base.cpp 1 82.79%
src/realm/util/serializer.cpp 1 90.43%
test/test_index_string.cpp 1 93.48%
src/realm/object-store/shared_realm.cpp 2 91.89%
src/realm/collection_parent.cpp 3 93.08%
src/realm/sync/network/network.cpp 3 87.72%
src/realm/table.cpp 3 90.08%
src/realm/unicode.cpp 3 83.83%
src/realm/sync/noinst/server/server_history.cpp 4 63.51%
Totals Coverage Status
Change from base Build 2275: -0.01%
Covered Lines: 212452
Relevant Lines: 234132

💛 - Coveralls

We used to have the Jenkins error parser that made the job fail if there were
any warnings, but now we have nothing and warnings can slip through. This is a
little worse as it makes the build fail immediately rather than letting it run
the tests, but it's better than nothing.
@tgoyne tgoyne merged commit e7285a3 into master Apr 30, 2024
32 of 37 checks passed
@tgoyne tgoyne deleted the tg/werror branch April 30, 2024 15:09
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants