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

On createBuildConfiguration, reset project's ScannerInfoProvider #817

Merged

Conversation

betamaxbandit
Copy link
Contributor

When the project's active IBuildConfiguration has the default name and the chosen ICBuildConfigurationProvider.getCBuildConfiguration does not support the IBuildConfiguration.DEFAULT_CONFIG_NAME and returns null, this can cause the project's ScannerInfoProvider to become "stuck" (https://bugs.eclipse.org/bugs/show_bug.cgi?id=413357) on the wrong setting (eg LanguageSettingsScannerInfoProvider instead of ICBuildConfiguration) until Eclipse is restarted or the project is closed and reopened. When this happens, the indexer does not function.

This problem may arise if an ISV contributes a
ICBuildConfigurationProvider which has very specific naming conventions for it's build configurations.

The solution uses the API (resetCachedScannerInfoProvider(project)), introduced by 413357, to reset the project's ScannerInfoProvider when a new ICBuildConfiguration is created.

@betamaxbandit betamaxbandit force-pushed the resetCachedScannerInfoProvider branch 2 times, most recently from 1d81b34 to 8415b07 Compare June 10, 2024 13:54
@betamaxbandit
Copy link
Contributor Author

Hi @jonahgraham ,
could you have a look at the 2 code cleanliness checks that are failing please? I don't think they are related to my change.
I can see that the test I added is passing.

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.175 s -- in org.eclipse.cdt.core.build.CBuildConfigurationManagerTests
org.eclipse.cdt.core.build.CBuildConfigurationManagerTests.testResetCachedScannerInfoProvider -- Time elapsed: 1.141 s

Cheers John

Copy link
Member

@jonahgraham jonahgraham left a comment

Choose a reason for hiding this comment

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

The failing tests Code Cleanliness Checks / Test Results (pull_request) are known to fail (since recently) see #816

The Code Cleanliness Checks / build (pull_request) failure is because you reintroduced a deleted project.

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Member

Choose a reason for hiding this comment

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

You have accidentally restored/recreated a project that has been removed from CDT very recently.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OMG, silly of me.
Removed now.

Copy link
Member

@jonahgraham jonahgraham left a comment

Choose a reason for hiding this comment

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

Aside from the small process issues, this is good to go.

@@ -0,0 +1,121 @@
package org.eclipse.cdt.core.build;
Copy link
Member

Choose a reason for hiding this comment

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

Please add copyright block

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@betamaxbandit betamaxbandit force-pushed the resetCachedScannerInfoProvider branch from 8415b07 to 90dc5ff Compare June 11, 2024 20:18
Copy link
Contributor Author

@betamaxbandit betamaxbandit left a comment

Choose a reason for hiding this comment

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

@jonahgraham , thanks for your review.

@@ -0,0 +1,121 @@
package org.eclipse.cdt.core.build;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

OMG, silly of me.
Removed now.

@betamaxbandit
Copy link
Contributor Author

Hi @jonahgraham ,

I pushed an update, but have 3 failing checks now. They say "This job failed". Don't know what I've done or maybe the CI just glitched. Is there a way to rerun?

When the project's active IBuildConfiguration has the default name and
the chosen ICBuildConfigurationProvider.getCBuildConfiguration does not
support the IBuildConfiguration.DEFAULT_CONFIG_NAME and returns null,
this can cause the project's ScannerInfoProvider to become "stuck"
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=413357) on the wrong
setting (eg LanguageSettingsScannerInfoProvider instead of
ICBuildConfiguration) until Eclipse is restarted or the project is
closed and reopened. When this happens, the indexer does not function.

This problem may arise if an ISV contributes a
ICBuildConfigurationProvider which has very specific naming conventions
for it's build configurations.

The solution uses the API (resetCachedScannerInfoProvider(project)),
introduced by 413357, to reset the project's ScannerInfoProvider when a
new ICBuildConfiguration is created.
@betamaxbandit betamaxbandit force-pushed the resetCachedScannerInfoProvider branch from 90dc5ff to c69a5e0 Compare June 12, 2024 07:12
@betamaxbandit
Copy link
Contributor Author

Hi @jonahgraham ,
I think this is ready to merge now.
Cheers John

@jonahgraham
Copy link
Member

I pushed an update, but have 3 failing checks now. They say "This job failed".

It was an error on Github - never seen it before but it said: GitHub Actions has encountered an internal error when running your job.

Don't know what I've done or maybe the CI just glitched. Is there a way to rerun?

As a committer you can press rerun, not sure if contributors can do that. Anyway you figured out the workaround was to just push an update.

I think this is ready to merge now.

Indeed.

@jonahgraham jonahgraham merged commit 0f36d5d into eclipse-cdt:main Jun 12, 2024
5 checks passed
@jonahgraham jonahgraham added this to the 11.7.0 milestone Jun 12, 2024
@betamaxbandit betamaxbandit deleted the resetCachedScannerInfoProvider branch June 13, 2024 15:31
@jonahgraham jonahgraham modified the milestones: 11.7.0, 12.0.0 M1 Jun 21, 2024
@jonahgraham jonahgraham added the backport-to-cdt_11_6 Magic branch to automatically backport labelled PRs label Jun 28, 2024
github-actions bot pushed a commit that referenced this pull request Jun 28, 2024
When the project's active IBuildConfiguration has the default name and
the chosen ICBuildConfigurationProvider.getCBuildConfiguration does not
support the IBuildConfiguration.DEFAULT_CONFIG_NAME and returns null,
this can cause the project's ScannerInfoProvider to become "stuck"
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=413357) on the wrong
setting (eg LanguageSettingsScannerInfoProvider instead of
ICBuildConfiguration) until Eclipse is restarted or the project is
closed and reopened. When this happens, the indexer does not function.

This problem may arise if an ISV contributes a
ICBuildConfigurationProvider which has very specific naming conventions
for it's build configurations.

The solution uses the API (resetCachedScannerInfoProvider(project)),
introduced by 413357, to reset the project's ScannerInfoProvider when a
new ICBuildConfiguration is created.

(cherry picked from commit 0f36d5d)
Copy link

💚 All backports created successfully

Status Branch Result
cdt_11_6

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

jonahgraham pushed a commit that referenced this pull request Jun 29, 2024
…ovider (#817) (#854)

When the project's active IBuildConfiguration has the default name and
the chosen ICBuildConfigurationProvider.getCBuildConfiguration does not
support the IBuildConfiguration.DEFAULT_CONFIG_NAME and returns null,
this can cause the project's ScannerInfoProvider to become "stuck"
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=413357) on the wrong
setting (eg LanguageSettingsScannerInfoProvider instead of
ICBuildConfiguration) until Eclipse is restarted or the project is
closed and reopened. When this happens, the indexer does not function.

This problem may arise if an ISV contributes a
ICBuildConfigurationProvider which has very specific naming conventions
for it's build configurations.

The solution uses the API (resetCachedScannerInfoProvider(project)),
introduced by 413357, to reset the project's ScannerInfoProvider when a
new ICBuildConfiguration is created.

(cherry picked from commit 0f36d5d)

Co-authored-by: betamax <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-cdt_11_6 Magic branch to automatically backport labelled PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants