Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

CDT/Obsolete/ScannerDiscovery61/Stories

< CDT‎ | Obsolete‎ | ScannerDiscovery61
Revision as of 11:36, 15 September 2010 by Angvoz.dev.gmail.com (Talk | contribs) (Integrator Story)

The Stories and The Alpha Version of Scanner Discovery for CDT 8.0

Disclaimer

I am about to attach Work In Progress Alpha version of Scanner Discovery for CDT 8.0 to 290631. This is generally working version but may be rough on the edges. The code is far from clean and not suitable for commit.

There is a lot of moving parts and connection points to wire to CDT. I may have missed some - if you notice let me know. So far my biggest concern was to connect the moving parts and keep it from falling apart. Big thanks to git and its rebase feature BTW. UI is pretty much experimental and needs to be reworked from interaction design standpoint and consolidated with existing one. I shall go again along the stories posted trying to streamline the flow from user POV. If your scenario is missing, please let me know.

So far there was not much of feedback and I'd be happy to get any at the Summit. I won't attend, so please post thoughts in 290631. If feedback is positive, my plan is to add this to CDT 8.0 peacemeal. I would split it to smaller pieces and work on each one under a separate bugzilla.

Andrew Gvozdev

Legacy Projects

Special care is being taken to keep the choice of using legacy Scanner Discovery mechanism. That choice could be the default until the new functionality is stable enough. There is a checkbox in New Project Wizard to enable/disable it on project creation (see #Regular Use). The new stuff is enabled by default in demo version though - solely for the demo purpose.

Regular Use

For the regular user using project types and toolchains supported by CDT, no any special setup is necessary.

Scanner discovery for a project is defined when the project is created by New Project Wizard. It is possible to enable the new "alpha" version or keep using legacy method.

SD80 RegularUseStory.png

If user is using legacy discovery it is still possible to use project properties to use new scanner discovery providers (see [LanguageSettingsProviders]).

Boost Story

Here is an example how you would setup Boost libraries project in eclipse. This does not require any special settings related to Scanner Discovery, just setting it up to compile and bjam option to provoke compiler command in output.

  1. Download latest boost library from http://sourceforge.net/projects/boost/files/boost/1.44.0/
  2. Download also bjam from there
  3. Unzip the source somewhere outside the workspace and copy bjam.exe into the source root.
  4. Using wizard "Makefile Project with Existing Code" create a new Makefile project with appropriate toolchain (MinGW in this example) referring to the folder with boost sources.
    SD80 BoostStory NewMakefileProjectFromExisting.png
  5. In project properties change settings to be able to compile:
    • In Tool Chain Editor select "Gnu Make Builder"
    • In C/C++ Build/Builder Settings: Use External Builder
    • Uncheck "Generate Makefiles automatically"
    • Uncheck "Use default build command"
    • Set "Build Command" to "bjam -d+2 --toolset=gcc --with-python". This is to compile python library only. Option "-d+2" is needed to get compiler command printed in the output. If you add "-na" options it will print the output but not compile.
    • In Behaviour Tab remove "all" from "Build (Incremental build)" target.
    • Save settings.
  6. Build the project.

The project may not compile successfully everything but it is not the point here. It generates enough build output to demonstrate how scanner discovery picks compilation options and assigns them to proper resources in the project.

The settings appear in each file properties->Paths and Symbols->All Language Settings tab. You can see which language settings providers are used and which settings the providers retrieved.

SD80 BoostStory ResourceLanguageSettings.png

Integrator Story

This is not really a story but rather some pointers about settings under the hood. I think the integrators could use that short description.

Similarly to ErrorParsers there is a list of available language settings providers. They provide the language settings for indexer use (corresponding to Include paths -I compiler options, predefined preprocessor macros -D options and others). There are several providers available, each one for a separate purpose. An integrator can pick and configure providers on per-project-configuration basis. The providers are defined as extensions in plugin.xml.

SD80 IntergatorStory Providers.png

  • There are 2 special providers, one is User provider which supports adding/editing user entries and MBS provider which represents setting entries supplied by MBS.
  • GCC Build Output Parser is responsible for parsing build output and assigning individual language settings for source files (see #Boost Story).
  • GCC Builtin Settings Detectors fetch built-in compiler settings. That kind of provider would be normally set as global instance in workspace and run only once. The language settings it retrieved would be shared between different projects.
  • The initial list of providers is defined by a Toolchain and Configuration as an additional attribute in buildDefinitions extension point and the providers are assigned to each configuration during initial creation of CDT project.


Compiler Upgrade Story

One of the painful stories related to scanner discovery is the story of compiler upgrade. Even if we finally provided UI to clean up discovered entries in 7.0.1/8.0 (bug 206372), it is hard for user to discover it or figure out how to use it.

The UI in the new proposed version is arguably not ideal at that point, but the story itself is a good example to illustrate another feature the new design.

The compiler language settings are kept by corresponding compiler Builtin Settings Detector. Normally that kind of language settings provider is defined on workspace level and the settings retrieved only once for different projects to reuse. To re-run the detector select it in Preferences->C/C++ Build->Discovery tab and use "Clear" button. After the settings cleared, you could do "Run Now" or it would be run automatically with the first build.

SD80 CompilerUpgradeStory.png

More stories and screenshots to follow

Back to the top