Skip to content

[cxxmodules] Fix autoloading of nested namespaces. #1337

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

Merged
merged 1 commit into from
Nov 19, 2017

Conversation

vgvassilev
Copy link
Member

@vgvassilev vgvassilev commented Nov 15, 2017

When we want to autoload contents from namespaces we end up in
Sema::LookupQualifiedName; then we issue a callback to
FindExternallyVisibleName which forwards to LookupObject. Lookup object
takes a DeclContext as an argument. This argument is always the primary
lookup context (which for a NamespaceDecl is the original namespace.

Regular autoloading does not consider this (or has chosen not to) because
this reduces the amount of autoloads. Such autoloads can happen when
resolving template specializations when computing a decl's linkage by
clang's CodeGen. This in turn loads unexpected libraries such as RooFit
when trying to resolve all template specializations of __to_raw_pointer
(located in <memory>), including the one taking a HistFactory::Data*.
The amount of deserializations might be reduced by applying D29951.

That way we end up needlessly loading RooFit and showing it's weird
banner, potentially breaking a lot of tests.

This behavior can be considered as broken because we hide information
about possible redeclarations which can affect the linkage computation or
other checks in codegen. If we fix the bug we will probably explode
ROOT's memory footprint and make the gap between standard ROOT and ROOT
with modules even bigger.

Since it is not clear how much work and issue resolving is required for
standard ROOT, we can probably only live with the workaround of the missing
concept: moving entities in namespaces whose autoloading requires declarations
to be in the PCH. For instance, ROOT::Experimental::TDataFrame.

@vgvassilev vgvassilev requested a review from pcanal as a code owner November 15, 2017 21:39
@phsft-bot
Copy link

Starting build on centos7/gcc49, mac1012/native, slc6/gcc49, slc6/gcc62, slc6/gcc62, ubuntu14/native, ubuntu14/native, windows10/vc15 with flags -Dvc=OFF -Dimt=ON -Dccache=ON
How to customize builds

@vgvassilev vgvassilev requested a review from Teemperor November 15, 2017 21:40
@vgvassilev
Copy link
Member Author

This PR should supersede PR #1328.

@phsft-bot
Copy link

Starting build on centos7/gcc49, mac1012/native, slc6/gcc49, slc6/gcc62, slc6/gcc62, ubuntu14/native, ubuntu14/native, windows10/vc15 with flags -Dvc=OFF -Dimt=ON -Dccache=ON
How to customize builds

@phsft-bot
Copy link

Starting build on centos7/gcc49, mac1012/native, slc6/gcc49, slc6/gcc62, slc6/gcc62, ubuntu14/native, ubuntu14/native, windows10/vc15 with flags -Dvc=OFF -Dimt=ON -Dccache=ON
How to customize builds

@phsft-bot
Copy link

Build failed on mac1012/native.
See console output.

Warnings:

  • /cvmfs/sft.cern.ch/lcg/releases/R/3.2.5-c8cca/x86_64-mac1012-clang81-opt/lib/R/include/R.h:40:10: warning: non-portable path to file '<RConfig.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]
  • /cvmfs/sft.cern.ch/lcg/releases/R/3.2.5-c8cca/x86_64-mac1012-clang81-opt/lib/R/include/R_ext/RS.h:29:10: warning: non-portable path to file '<RConfig.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]
  • /cvmfs/sft.cern.ch/lcg/releases/R/3.2.5-c8cca/x86_64-mac1012-clang81-opt/lib/R/include/Rinternals.h:60:11: warning: non-portable path to file '<RConfig.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]
  • /cvmfs/sft.cern.ch/lcg/releases/R/3.2.5-c8cca/x86_64-mac1012-clang81-opt/lib/R/library/Rcpp/include/Rcpp/r/headers.h:57:10: warning: non-portable path to file '<RVersion.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]
  • /cvmfs/sft.cern.ch/lcg/releases/R/3.2.5-c8cca/x86_64-mac1012-clang81-opt/lib/R/include/R_ext/Visibility.h:29:10: warning: non-portable path to file '<RConfig.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]
  • /cvmfs/sft.cern.ch/lcg/releases/R/3.2.5-c8cca/x86_64-mac1012-clang81-opt/lib/R/include/R.h:40:10: warning: non-portable path to file '<RConfig.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]
  • /cvmfs/sft.cern.ch/lcg/releases/R/3.2.5-c8cca/x86_64-mac1012-clang81-opt/lib/R/include/R_ext/RS.h:29:10: warning: non-portable path to file '<RConfig.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]
  • /cvmfs/sft.cern.ch/lcg/releases/R/3.2.5-c8cca/x86_64-mac1012-clang81-opt/lib/R/include/Rinternals.h:60:11: warning: non-portable path to file '<RConfig.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]
  • /cvmfs/sft.cern.ch/lcg/releases/R/3.2.5-c8cca/x86_64-mac1012-clang81-opt/lib/R/library/Rcpp/include/Rcpp/r/headers.h:57:10: warning: non-portable path to file '<RVersion.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]
  • /cvmfs/sft.cern.ch/lcg/releases/R/3.2.5-c8cca/x86_64-mac1012-clang81-opt/lib/R/include/R_ext/Visibility.h:29:10: warning: non-portable path to file '<RConfig.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]

And 10 more

Failing tests:

And 2 more

@phsft-bot
Copy link

Starting build on centos7/gcc49, mac1012/native, slc6/gcc49, slc6/gcc62, slc6/gcc62, ubuntu14/native, ubuntu14/native, windows10/vc15 with flags -Dvc=OFF -Dimt=ON -Dccache=ON
How to customize builds

@root-project root-project deleted a comment from phsft-bot Nov 16, 2017
@root-project root-project deleted a comment from phsft-bot Nov 16, 2017
@root-project root-project deleted a comment from phsft-bot Nov 16, 2017
@root-project root-project deleted a comment from phsft-bot Nov 16, 2017
@root-project root-project deleted a comment from phsft-bot Nov 16, 2017
@root-project root-project deleted a comment from phsft-bot Nov 16, 2017
@root-project root-project deleted a comment from phsft-bot Nov 16, 2017
@root-project root-project deleted a comment from phsft-bot Nov 16, 2017
@phsft-bot
Copy link

Build failed on slc6/gcc49.
See console output.

Failing tests:

@phsft-bot
Copy link

Build failed on centos7/gcc49.
See console output.

Failing tests:

@Teemperor
Copy link
Contributor

@phsft-bot build with -Druntime_cxxmodules=On

@phsft-bot
Copy link

Starting build on centos7/gcc49, mac1012/native, slc6/gcc49, slc6/gcc62, slc6/gcc62, ubuntu14/native, ubuntu14/native, windows10/vc15 with flags -Dvc=OFF -Dimt=ON -Dccache=ON
How to customize builds

@phsft-bot
Copy link

Build failed on centos7/gcc49.
See console output.

Failing tests:

@phsft-bot
Copy link

Starting build on centos7/gcc49, mac1012/native, slc6/gcc49, slc6/gcc62, slc6/gcc62, ubuntu14/native, ubuntu14/native, windows10/vc15 with flags -Dvc=OFF -Dimt=ON -Dccache=ON
How to customize builds

@vgvassilev
Copy link
Member Author

@phsft-bot just on slc6/gcc62 with flags -Druntime_cxxmodules=On

@root-project root-project deleted a comment from phsft-bot Nov 17, 2017
@vgvassilev
Copy link
Member Author

@phsft-bot build just on slc6/gcc62 with flags -Druntime_cxxmodules=On

@phsft-bot
Copy link

Starting build on slc6/gcc62 with flags -Dvc=OFF -Dimt=ON -Dccache=ON -Druntime_cxxmodules=On
How to customize builds

@phsft-bot
Copy link

Starting build on slc6/gcc62 with flags -Dvc=OFF -Dimt=ON -Dccache=ON -Druntime_cxxmodules=On
How to customize builds

@phsft-bot
Copy link

Build failed on slc6/gcc62.
See console output.

Warnings:

  • Warning in <GenerateModule>: warning: Couldn't find the following specified headers in the module Core:
  • Warning in <GenerateModule>: warning: Couldn't find the following specified headers in the module valarrayDict:
  • Warning in <GenerateModule>: warning: Couldn't find the following specified headers in the module unordered_multisetDict:
  • Warning in <GenerateModule>: warning: Couldn't find the following specified headers in the module listDict:
  • Warning in <GenerateModule>: warning: Couldn't find the following specified headers in the module unordered_setDict:
  • Warning in <GenerateModule>: warning: Couldn't find the following specified headers in the module dequeDict:
  • Warning in <GenerateModule>: warning: Couldn't find the following specified headers in the module vectorDict:
  • Warning in <GenerateModule>: warning: Couldn't find the following specified headers in the module multisetDict:
  • Warning in <GenerateModule>: warning: Couldn't find the following specified headers in the module multimap2Dict:
  • Warning in <GenerateModule>: warning: Couldn't find the following specified headers in the module multimapDict:

And 7 more

Failing tests:

And 37 more

When we want to autoload contents from namespaces we end up in
Sema::LookupQualifiedName; then we issue a callback to
FindExternallyVisibleName which forwards to LookupObject. Lookup object
takes a DeclContext as an argument. This argument is always the primary
lookup context (which for a NamespaceDecl is the original namespace.

Regular autoloading does not consider this (or has chosen not to) because
this reduces the amount of autoloads. Such autoloads can happen when
resolving template specializations when computing a decl's linkage by
clang's CodeGen. This in turn loads unexpected libraries such as RooFit
when trying to resolve all template specializations of __to_raw_pointer
(located in <memory>), including the one taking a HistFactory::Data*.

That way we end up needlessly loading RooFit and showing it's weird
banner, potentially breaking a lot of tests.

This behavior can be considered as broken because we hide information
about possible redeclarations which can affect the linkage computation or
other checks in codegen. If we fix the bug we will probably explode
ROOT's memory footprint and make the gap between standard ROOT and ROOT
with modules even bigger.

Since it is not clear how much work and issue resolving is required for
standard ROOT, we can probably only live with the workaround of the missing
concept: moving entities in namespaces whose autoloading requires declarations
to be in the PCH. For instance, ROOT::Experimental::TDataFrame.
@phsft-bot
Copy link

Starting build on slc6/gcc62 with flags -Dvc=OFF -Dimt=ON -Dccache=ON -Druntime_cxxmodules=On
How to customize builds

@phsft-bot
Copy link

Build failed on slc6/gcc62.
See console output.

Warnings:

  • Warning in <GenerateModule>: warning: Couldn't find the following specified headers in the module Core:
  • Warning in <GenerateModule>: warning: Couldn't find the following specified headers in the module valarrayDict:
  • Warning in <GenerateModule>: warning: Couldn't find the following specified headers in the module dequeDict:
  • Warning in <GenerateModule>: warning: Couldn't find the following specified headers in the module listDict:
  • Warning in <GenerateModule>: warning: Couldn't find the following specified headers in the module unordered_setDict:
  • Warning in <GenerateModule>: warning: Couldn't find the following specified headers in the module vectorDict:
  • Warning in <GenerateModule>: warning: Couldn't find the following specified headers in the module multisetDict:
  • Warning in <GenerateModule>: warning: Couldn't find the following specified headers in the module multimap2Dict:
  • Warning in <GenerateModule>: warning: Couldn't find the following specified headers in the module multimapDict:
  • Warning in <GenerateModule>: warning: Couldn't find the following specified headers in the module unordered_multisetDict:

And 7 more

Failing tests:

And 37 more

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.

4 participants