Skip to content
This repository was archived by the owner on Aug 19, 2019. It is now read-only.

Revamp configuration implementation mechanism.#127

Merged
igorpeshansky merged 6 commits intomasterfrom
igorp-config-revamp
Sep 11, 2018
Merged

Revamp configuration implementation mechanism.#127
igorpeshansky merged 6 commits intomasterfrom
igorp-config-revamp

Conversation

@igorpeshansky
Copy link
Copy Markdown
Contributor

This will probably not get merged in its current state, but wanted to start a discussion on a better configuration mechanism implementation.

@igorpeshansky
Copy link
Copy Markdown
Contributor Author

Rebased this against the latest master. This is ready to be reviewed.

@igorpeshansky igorpeshansky requested review from davidbtucker and removed request for ACEmilG May 23, 2018 19:55
Copy link
Copy Markdown
Contributor

@davidbtucker davidbtucker left a comment

Choose a reason for hiding this comment

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

LGTM

Comment thread src/Makefile Outdated
UNAME_S=$(shell uname -s)
ifeq ($(UNAME_S),Darwin)
CPPFLAGS+= -I/usr/local/include -I/usr/local/opt/openssl/include
CPPFLAGS+= -UNOOPT -DNOOPT='[[clang::optnone]]' -I/usr/local/include -I/usr/local/opt/openssl/include
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add a comment explaining why we need these options.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No longer relevant, so removed.

Comment thread src/configuration.h Outdated

// Shared configuration.
const std::string& ProjectId() const {
NOOPT const std::string& ProjectId() const {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also comment on the NOOPTs in this file.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Uh, apologies for jumping in here, but [[clang:optnone]] is not guaranteed to be honoured even by clang. If you want to force the function to never be inlined, use a different attribute. In this case, __attribute__((noinline)) is supported by both clang and gcc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There's definitely something fishy on MacOS with respect to optimizing those functions. It used to crash for me with __attribute__((noinline)), but not with [[clang::optnone]], but no longer seems to. I'll just remove it for now, and we can investigate if the crashes reoccur.

Copy link
Copy Markdown
Contributor Author

@igorpeshansky igorpeshansky left a comment

Choose a reason for hiding this comment

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

Thanks. PTAL.

Comment thread src/configuration.h Outdated

// Shared configuration.
const std::string& ProjectId() const {
NOOPT const std::string& ProjectId() const {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There's definitely something fishy on MacOS with respect to optimizing those functions. It used to crash for me with __attribute__((noinline)), but not with [[clang::optnone]], but no longer seems to. I'll just remove it for now, and we can investigate if the crashes reoccur.

Comment thread src/Makefile Outdated
UNAME_S=$(shell uname -s)
ifeq ($(UNAME_S),Darwin)
CPPFLAGS+= -I/usr/local/include -I/usr/local/opt/openssl/include
CPPFLAGS+= -UNOOPT -DNOOPT='[[clang::optnone]]' -I/usr/local/include -I/usr/local/opt/openssl/include
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No longer relevant, so removed.

@igorpeshansky
Copy link
Copy Markdown
Contributor Author

Rebased off master. PTAL.

Copy link
Copy Markdown
Contributor

@bmoyles0117 bmoyles0117 left a comment

Choose a reason for hiding this comment

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

LGTM

@igorpeshansky igorpeshansky changed the title RFC: Revamp configuration implementation mechanism. Revamp configuration implementation mechanism. Sep 11, 2018
@igorpeshansky igorpeshansky merged commit d481466 into master Sep 11, 2018
@igorpeshansky igorpeshansky deleted the igorp-config-revamp branch September 11, 2018 23:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants