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

[READY] Hide C++ symbols by default #848

Merged
merged 1 commit into from
Dec 23, 2017
Merged

Conversation

bstaletic
Copy link
Collaborator

@bstaletic bstaletic commented Sep 28, 2017

I accidentally closed #826 (force push gone wrong and confused github).
This PR implements the same change but also #827 at the same time.

The boost downgrade is for this change to work properly because of [a bug in the new boost that disallows hidden C++ symbols (i.e. Boost doesn't force the ycm_core to be visible).


This change is Reviewable

@micbou
Copy link
Collaborator

micbou commented Sep 28, 2017

I think it's overkill to create a header file for one definition. This is what I did for YCM_DLL_EXPORT and it was a mistake. It would be more reasonable to define YCM_EXPORT in Utils.h.


Reviewed 14 of 14 files at r1.
Review status: 13 of 369 files reviewed at latest revision, 1 unresolved discussion.


cpp/CMakeLists.txt, line 266 at r1 (raw file):

      -DYCM_EXPORT=__attribute__\(\(visibility\(\"default\"\)\)\) )
  endif()
endif()

This block should be with the one that sets the -fvisibility=hidden flag.


Comments from Reviewable

@codecov-io
Copy link

codecov-io commented Sep 28, 2017

Codecov Report

Merging #848 into master will decrease coverage by 0.17%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #848      +/-   ##
==========================================
- Coverage   94.82%   94.64%   -0.18%     
==========================================
  Files          41       41              
  Lines        4018     4018              
==========================================
- Hits         3810     3803       -7     
- Misses        208      215       +7

@bstaletic
Copy link
Collaborator Author

I moved the definition to Utils.h.


Review status: 2 of 370 files reviewed at latest revision, 1 unresolved discussion.


cpp/CMakeLists.txt, line 266 at r1 (raw file):

Previously, micbou wrote…

This block should be with the one that sets the -fvisibility=hidden flag.

Done.


Comments from Reviewable

@bstaletic
Copy link
Collaborator Author

The latest commit updates cpp/ycm/.ycm_extra_conf.py to reflect this PR's change.

Is it just me or is codecov reporting nonsense?

@Valloric
Copy link
Member

Valloric commented Oct 4, 2017

:lgtm:

Thanks!


Review status: 6 of 370 files reviewed at latest revision, all discussions resolved, some commit checks failed.


Comments from Reviewable

zzbot added a commit that referenced this pull request Dec 22, 2017
[READY] Update Boost to 1.66.0

This version of Boost fixes the issue where `ycm_core` cannot be imported when compiling with the `-fvisibility=hidden` flag. With this new version, downgrading Boost in PR #848 won't be needed.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/887)
<!-- Reviewable:end -->
@zzbot
Copy link
Contributor

zzbot commented Dec 22, 2017

☔ The latest upstream changes (presumably #887) made this pull request unmergeable. Please resolve the merge conflicts.

@bstaletic
Copy link
Collaborator Author

I have just force-pushed the update that should make this work with the latest boost.
But I'd advise to wait for the bots to say all the tests have passed.

@micbou
Copy link
Collaborator

micbou commented Dec 23, 2017

Some minor comments but :lgtm:.


Reviewed 1 of 14 files at r1, 8 of 8 files at r2, 1 of 356 files at r4.
Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks failed.


cpp/CMakeLists.txt, line 148 at r3 (raw file):

else()
  add_definitions( -DYCM_EXPORT= )
endif()

Missing blank line.


cpp/ycm/exceptions.h, line 30 at r4 (raw file):

 * Thrown when a file does not exist.
 */
struct YCM_EXPORT ClangParseError : virtual std::exception {};

Is there a reason to put YCM_EXPORT after struct and not before like we do for classes?


Comments from Reviewable

@bstaletic
Copy link
Collaborator Author

Review status: 13 of 14 files reviewed at latest revision, 2 unresolved discussions.


cpp/CMakeLists.txt, line 148 at r3 (raw file):

Previously, micbou wrote…

Missing blank line.

Done.


cpp/ycm/exceptions.h, line 30 at r4 (raw file):

Previously, micbou wrote…

Is there a reason to put YCM_EXPORT after struct and not before like we do for classes?

There actually is, and you've found the reason last time.

If we do it the logical way compilers* will ignore it for whatever reason. And if it gets ignored, the exception is simply not thrown when calling throw.

* I'm certain GCC will ignore it, not sure about clang.


Comments from Reviewable

@micbou
Copy link
Collaborator

micbou commented Dec 23, 2017

Let's merge.

@zzbot r+


Reviewed 1 of 1 files at r5.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


cpp/ycm/exceptions.h, line 30 at r4 (raw file):

Previously, bstaletic (Boris Staletic) wrote…

There actually is, and you've found the reason last time.

If we do it the logical way compilers* will ignore it for whatever reason. And if it gets ignored, the exception is simply not thrown when calling throw.

* I'm certain GCC will ignore it, not sure about clang.

Right. I vaguely remember now.


Comments from Reviewable

@zzbot
Copy link
Contributor

zzbot commented Dec 23, 2017

📌 Commit 7aeb56f has been approved by micbou

@zzbot
Copy link
Contributor

zzbot commented Dec 23, 2017

⌛ Testing commit 7aeb56f with merge f787e1a...

zzbot added a commit that referenced this pull request Dec 23, 2017
[READY] Hide C++ symbols by default

I accidentally closed #826 (force push gone wrong and confused github).
This PR implements the same change but also #827 at the same time.

The boost downgrade is for this change to work properly because of [a bug in the new boost that disallows hidden C++ symbols (i.e. Boost doesn't force the ycm_core to be visible).

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/848)
<!-- Reviewable:end -->
@zzbot
Copy link
Contributor

zzbot commented Dec 23, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: micbou
Pushing f787e1a to master...

@zzbot zzbot merged commit 7aeb56f into ycm-core:master Dec 23, 2017
@bstaletic bstaletic deleted the cpp_symbols branch December 23, 2017 20:02
zzbot added a commit to ycm-core/YouCompleteMe that referenced this pull request Feb 10, 2018
[READY] Update ycmd

Include the following changes:

 - PR ycm-core/ycmd#789: add support for Windows flags when --driver-mode=cl is given;
 - PR ycm-core/ycmd#848: hide C++ symbols by default;
 - PR ycm-core/ycmd#857: add Java support using jdt.ls;
 - PR ycm-core/ycmd#861: translate libclang error codes to exceptions;
 - PR ycm-core/ycmd#880: support downloading Clang binaries on ARM systems;
 - PR ycm-core/ycmd#883: handle zero column diagnostic from OmniSharp;
 - PR ycm-core/ycmd#884: specify Platform property when compiling OmniSharp;
 - PR ycm-core/ycmd#886: use current working directory in JavaScript completer;
 - PR ycm-core/ycmd#887: update Boost to 1.66.0;
 - PR ycm-core/ycmd#888: update JediHTTP;
 - PR ycm-core/ycmd#889: update Clang to 5.0.1;
 - PR ycm-core/ycmd#891: fix building with system libclang on Gentoo amd64;
 - PR ycm-core/ycmd#904: drop Python 2.6 and Python 3.3 support;
 - PR ycm-core/ycmd#905: calculate the start column when items are not resolved in the language server completer;
 - PR ycm-core/ycmd#912: download Clang binaries from HTTPS;
 - PR ycm-core/ycmd#914: do not try to symlink libclang on Windows.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2902)
<!-- Reviewable:end -->
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.

5 participants