eclipse-plugins icon indicating copy to clipboard operation
eclipse-plugins copied to clipboard

Use new ALL_FLAGS feature of CDT for discovery

Open jonahgraham opened this issue 2 years ago • 5 comments

CDT 11 includes a new ${ALL_FLAGS} that can be specified in the scanner discovery to pick up all command line options specified in the managed build.

See the N&N entry at:

https://github.com/jonah/cdt/blob/main/NewAndNoteworthy/CDT-11.0.md#scanner-discovery-considering-all-flags (here until https://github.com/eclipse-cdt/cdt/pull/158 is merged)

This change is not required as CDT's change is non-breaking. But to use ALL_FLAGS you need CDT 11 or newer, specifically for org.eclipse.cdt.managedbuilder.core;bundle-version="9.5.0"

jonahgraham avatar Nov 11 '22 18:11 jonahgraham

Marked as draft until https://github.com/eclipse-cdt/cdt/pull/158 is resolved.

jonahgraham avatar Nov 11 '22 18:11 jonahgraham

I'm not sure I understand the details. :-(

Anyway, embed-cdt is based on an older CDT, and I am reluctant to update to CDT 11.

ilg-ul avatar Nov 11 '22 20:11 ilg-ul

I'm not sure I understand the details. :-(

Another concrete example is in the original bug report, if a user specifies -mcpu=cortex-m4 then the __ARM_ARCH pre-defined macro will be 7, but CDT won't know that because it didn't pass the -mcpu=cortex-m4` to GCC when querying GCC for the pre-defined macros. As a result the indexing of source files will be incorrect.

With CDT 10, you can fix the above situation (if you agree it is a problem) by adding the useByScannerDiscovery="true" to the -mcpu= option in the plugin.xml, like you have done for other options.

What this change does is effectively defaults to include all options for scanner discovery, except those explictly excluded.

I am reluctant to update to CDT 11.

That's fine - if users are using CDT 11, like with Eclipse 2022-12 they can make the change manually. This commit only changes the default for new projects and on its own is certainly not enough to bother updating to CDT 11.

jonahgraham avatar Nov 12 '22 01:11 jonahgraham

As things are now, the update URL is https://download.eclipse.org/embed-cdt/updates/v6 and is expected to be valid for existing Eclipses back to the initial Eclipse used after the migration to EF, so as long as these old Eclipses can still be updated, we should be fine.

If, for any reason, we decide to bump the base version to a more recent Eclipse/CDT, we should increase the version to v7 and change the update URL. These changes take some time, thus my reluctance, but otherwise any improvements are welcome.

ilg-ul avatar Nov 12 '22 08:11 ilg-ul

We can leave this as a draft until then, whenever "then" is.

jonahgraham avatar Nov 12 '22 14:11 jonahgraham