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

customizable_test: revert the offsetof() build-related fixes #56

Merged
merged 1 commit into from
Jul 14, 2022

Conversation

isaac-io
Copy link
Contributor

They were made because the original version failed to compile with Clang
12 and 13, complaining about offsetof() being applied to a non-standard-layout
type. The error is no longer emitted with Clang 14, so this is likely a
compiler bug that was fixed, and there's no need for this dirty hack.

@isaac-io isaac-io requested a review from mrambacher July 14, 2022 10:30
@isaac-io isaac-io self-assigned this Jul 14, 2022
@isaac-io isaac-io linked an issue Jul 14, 2022 that may be closed by this pull request
They were made because the original version failed to compile with Clang
12 and 13, complaining about `offsetof()` being applied to a non-standard-layout
type. The error is no longer emitted with Clang 14, so this is likely a
compiler bug that was fixed, and there's no need for this dirty hack.
@isaac-io isaac-io force-pushed the 55-revert-the-offsetof-changes-to-customizable_test branch from f0b9998 to 9eec87f Compare July 14, 2022 10:31
Copy link
Contributor

@mrambacher mrambacher left a comment

Choose a reason for hiding this comment

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

Please make sure the format is okay. Otherwise, LGTM. Thanks!

#endif // ROCKSDB_LITE
RegisterOptions(&simple_, &simple_option_info);
}
SimpleConfigurable() { RegisterOptions(&simple_, &simple_option_info); }
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I do not think this is the right format (RegisterOptions should be on the new line)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

./build_tools/format-diff.sh seems happy, and at least in my understanding of the Google C++ coding style, this is OK if it doesn't exceed the line length limit:

https://google.github.io/styleguide/cppguide.html#Function_Declarations_and_Definitions

  • The open curly brace is always on the end of the last line of the function declaration, not the start of the next line.
  • The close curly brace is either on the last line by itself or on the same line as the open curly brace.

Copy link
Contributor

Choose a reason for hiding this comment

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

It probably matches the google style but is not how most of the Rocks code is structured. The normal Rocks style appears to be more:
SimpleConfigurable {
RegisterOptions(....)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this case, that's how it was in the original code, and how it looks like in the current HEAD of the RocksDB repository:

https://github.com/facebook/rocksdb/blob/6ce0b2ca34c0d73d17bd322e355a78542b2dfe50/options/customizable_test.cc#L239

@isaac-io
Copy link
Contributor Author

@assaf-speedb this is a unit test only change, and the unit tests passed. I don't think that we need the functional QA cycle and performance test here to merge. Do you agree?

@assaf-speedb
Copy link
Contributor

@isaac-io - I agree here, and in general regarding test fixes.

@isaac-io isaac-io merged commit 1b01213 into main Jul 14, 2022
@isaac-io isaac-io deleted the 55-revert-the-offsetof-changes-to-customizable_test branch July 20, 2022 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Revert the offsetof() changes to customizable_test
3 participants