1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 10:16:03 +02:00
Commit graph

36469 commits

Author SHA1 Message Date
jantje
b4853d8511
Merge 715a14aa7f into b4d81a130e 2025-05-31 20:11:55 -04:00
Jonah Graham
b4d81a130e Document indexer shows errors on a project that previously worked
This documents the workaround that worked in https://github.com/eclipse-cdt/cdt/issues/1174
2025-05-30 12:48:22 -04:00
Jonah Graham
abe4d1b8e1
Adapt compare control to CompareConfiguration (#1173)
This is to accomodate a bug fix done in Eclipse Platform in
https://github.com/eclipse-platform/eclipse.platform.ui/pull/2629

Fixes https://github.com/eclipse-cdt/cdt/issues/1172
2025-05-28 18:54:00 -04:00
Jonah Graham
2d313f69b8
Make sure remove.doc.isv appears on help.eclipse.org (#1171)
Remove unneeded dependencies in the help bundle because the
infocenter on help.eclipse.org only includes help bundles.

These removed dependencies were actually unused.

Fixes https://github.com/eclipse-cdt/cdt/issues/1170
2025-05-28 12:55:38 -04:00
John Moule
2c82545ba0
Improve CMake Build Settings labels - fixes #1120 (#1163)
The "Build all target" label was renamed to "Build target" to better
reflect what the control does.

Also added tooltips to the tab's controls.
2025-05-22 11:47:06 -04:00
Jonah Graham
9b6fded373 Explicitly use Platform's M3 I-build
Since M3 was published, platform had upped version
of org.eclipse.core.runtime.

See https://github.com/eclipse-cdt/cdt/pull/1165#issuecomment-2892408192
2025-05-19 20:54:39 -04:00
Jonah Graham
60b71ecba7 Migrate tm.terminal.control to eclipse platform
The new location of this bundle's source is
https://github.com/eclipse-platform/eclipse.platform/tree/master/terminal/plugins/org.eclipse.tm.terminal.control

It was mirgated to platform in:
https://github.com/eclipse-platform/eclipse.platform/pull/1851 as part
of the work to achieve https://github.com/eclipse-platform/eclipse.platform/pull/1762
2025-05-19 18:12:53 -04:00
Jonah Graham
8687aec665 [releng] Require target platform bundles as minimum version
Using:

```
mvn org.eclipse.tycho.extras:tycho-version-bump-plugin:4.0.12:update-manifest
```

and then multiple iterations to bump the bundle-version:

```
mvn verify org.eclipse.tycho:tycho-versions-plugin:4.0.12:bump-versions -Dtycho.bump-versions.increment=100 -DskipDoc=true         -DskipTests=true         -P baseline-compare-and-replace -fae -Djgit.dirtyWorkingTree-cdtDefault=warning
```

Make sure bounds of all dependencies match what we built against. This
prevents issues such as Bug 536448 from recurring. In 2025-06 there
are a number of Eclipse Platform changes that make CDT susceptible
to these types of issues again.

Note that this change is similar to previous iterations, such
as 1087dc5f22, but with the automatation
we can now apply this to *all* bundles.

In addition, with the tighter version constraints, building from
simrel repo for the jniheader (releng/scripts/do_rebuild_natives.sh)
is no longer sufficient. This speedup has been removed as it was probably
incorrect to have by default.

The api filters were introduced because some bundles are re-exported. Those
re-exported bundle requirements mean that technically we need to bump
the version, but in reality we effectively required the range as now
documented anyway, so doing a major version bump is unneeded.
2025-05-19 14:28:08 -04:00
Jonah Graham
7fa83d2902 Use latest Eclipse Platform and all dependencies for CDT 12.1
Includes removal of references to Platform internals that have been
changed.

Note the removal of setHoverImageDescriptor matches the change
made to platform in
be4a4aab48 (diff-6b07181bf8beb80046741858e13f5721f608136e00ce17749b5fa6d550cece9b)
2025-05-19 14:28:08 -04:00
Christoph Läubrich
4a499fbf1e
Only import the terminal.control (#1158)
The terminal control is migrated to the Eclipse platform, as those it
should be handled like a thrid-party dependency an not directly included
with an exact version in the feature.

This now changes it to a requirement with a lower bound of 5.5 excluding
the next major version. That way CDT and other consumers can gracefully
upgrade to the new platform variant.
2025-05-14 11:20:28 -04:00
Jonah Graham
eae23dac2f
Document how I diagnose code cleanliness failures (#1161)
These are the steps I used to diagnose https://github.com/eclipse-cdt/cdt/pull/1159#issuecomment-2858751463
2025-05-08 09:12:52 -04:00
John Dallaway
0f47c669c1 Improve MinGW detection for toolchain availability filtering
Use the same logic to locate a MinGW toolchain when filtering toolchains
for selection in the project wizard as we do during project build.
2025-05-07 20:11:05 +01:00
John Dallaway
6c53fd8bc3 Support DWARF attribute form DW_FORM_strx1 2025-05-07 15:12:59 +01:00
Jonah Graham
4f39107b14
Prepare repo for CDT 12.1.0 (#1107)
Includes building with Tycho 4.0.12
2025-05-06 16:16:40 -04:00
Jonah Graham
7f86b4a76c
Remove use of deprecated constant to allow Platform to delete the constant (#1131)
See https://github.com/eclipse-platform/eclipse.platform/pull/1784#pullrequestreview-2702035505
2025-04-23 14:11:39 -04:00
DangMinhTam382
a104a4f88d
Build Type comboBox false update when switching tab (#1119)
The Build type combo custom value was lost when switching to another tab and back again.
Solution: Add modifyListener for buildTypeCombo and generator combo to keep properties up-to-date when switching tab.

Fixes #1118
2025-04-23 14:07:47 -04:00
Christoph Läubrich
af359a7bba
Add accessor for included pty instance (#1109)
Currently if I get passed a Process from by a method call I can check it
for the Spawner and can already call special methods like hangup(). But
there is no way to get access the the PTY used to create the Spawner so
for example one can't call PTY#setTerminalSize or query any other
properties.

This now adds a new method pty() that returns this instance for further
investigation and actions.
2025-04-23 14:06:32 -04:00
Jonah Graham
04105c2457
Set Include Binary Equivalents to false for new major release of CDT in setup file (#1137)
Fixes #1123
2025-04-09 13:26:29 -04:00
Jonah Graham
b25dc65e33
p2 composites for CDT LSP 3.1 (#1136)
Part of https://github.com/eclipse-cdt/cdt-lsp/issues/480
2025-04-09 12:38:55 -04:00
Jonah Graham
fd56a4ee11 Update p2 latest URLs to CDT 12.0 and CDT LSP 3.0 2025-03-12 15:16:31 +00:00
Jonah Graham
52456bc332 Update list of archived folders 2025-03-07 20:43:59 -05:00
Jonah Graham
fb733b00c3 Composites for CDT 12.0 and CDT LSP 3.0 2025-03-07 12:18:49 -05:00
Jonah Graham
d31e62aa3e Add link to CDT LSP 3.0.0 milestone in N&N 2025-03-07 11:48:50 -05:00
Jonah Graham
d89b930e34 Cleanup N&N for CDT 12 and add some missing entries
As we approach the release now I collapsed all the milestones into
the CDT 12.0.0 one as the milestone releases are not really public
once the release is complete.
2025-03-07 11:39:50 -05:00
betamax
d1287b09d5
Update Release Notes with Core Build improvements (#1100)
Updated "Release Notes and New & Noteworthy page" page with details of
the Core Build improvements as part of #1000
2025-03-07 10:13:51 -05:00
Jonah Graham
f96dd1a385 Replace dead link to Bracketeer
Replace dead link https://marketplace.eclipse.org/content/bracketeer-cc-cdt
with https://marketplace.eclipse.org/content/bracketeer2 .
Fixes issue #948 .

Co-authored-by: Julian L. <111023244+juli-99@users.noreply.github.com>
2025-03-04 11:44:28 -05:00
betamax
e138646434
Ensure full ICBuildConfiguration environment is used during scanning (#1095)
Under certain conditions*, the compiler param in the command field of
the compile_commands.json is a relative path rather than absolute. When
this happens, the built-ins detection was not successful and the
following exception was thrown:

!ENTRY org.eclipse.cdt.core 4 0 2025-02-23 20:32:10.752
!MESSAGE Error: Cannot run program "gcc": Launching failed
!STACK 0
java.io.IOException: Cannot run program "gcc": Launching failed
	at org.eclipse.cdt.utils.spawner.Spawner.exec(Spawner.java:450)
	at org.eclipse.cdt.utils.spawner.Spawner.<init>(Spawner.java:147)
	at org.eclipse.cdt.utils.spawner.Spawner.<init>(Spawner.java:134)
	at org.eclipse.cdt.utils.spawner.ProcessFactory$Builder.start(ProcessFactory.java:273)
	at org.eclipse.cdt.utils.spawner.ProcessFactory.exec(ProcessFactory.java:366)
	at org.eclipse.cdt.core.CommandLauncher.execute(CommandLauncher.java:189)
	at org.eclipse.cdt.jsoncdb.core.internal.builtins.CompilerBuiltinsDetector.detectBuiltins(CompilerBuiltinsDetector.java:111)
	at org.eclipse.cdt.jsoncdb.core.CompileCommandsJsonParser.detectBuiltins(CompileCommandsJsonParser.java:290)
	at org.eclipse.cdt.jsoncdb.core.CompileCommandsJsonParser.processJsonFile(CompileCommandsJsonParser.java:193)
	at org.eclipse.cdt.jsoncdb.core.CompileCommandsJsonParser.parse(CompileCommandsJsonParser.java:455)
	at org.eclipse.cdt.cmake.core.CMakeBuildConfiguration.processCompileCommandsFile(CMakeBuildConfiguration.java:361)
	at org.eclipse.cdt.cmake.core.CMakeBuildConfiguration.build(CMakeBuildConfiguration.java:241)

This meant that source file includes were not indexed and could not be
opened using Open Declaration (F3) and info markers of the following
type appeared in the Problems view:

  gcc -E -P -dM -Wp,-v
"...extCmakegcc\\build\\cmake.run.win32.x86_64.Local\\detect_compiler_builtins.c"
  Cannot run program "gcc": Launching failed

  Error: Program "gcc" not found in PATH
  PATH=[...]
    extCmakegcc		Unknown	Compiler Builtins Detector Problem
  gcc -E -P -dM -Wp,-v
"...extCmakegcc\\build\\cmake.run.win32.x86_64.Local\\detect_compiler_builtins.c"
  Cannot run program "gcc": Launching failed

This patch fixes the environment issue for Core Build projects, by
calling ICBuildConfiguration.setBuildEnvironment(Map<String, String>) as
part of the built-ins detection setup, thereby supporting absolute and
relative compiler paths.

Addresses Issue: CDT CMake Improvements #1000, IDE-82683-REQ-011 Source
code navigation and Built-ins detection

*: CMake produces relative compiler path

When the CMAKE_<LANG>_COMPILER variable (eg CMAKE_C_COMPILER) is set in
the CMakeLists.txt *after* the project() or language commands, it causes
a relative path to be used. For example, in the CMakeLists.txt below,
gcc is set after project() command:

  cmake_minimum_required(VERSION 3.10)
  project (track2)
  set(CMAKE_C_COMPILER gcc)
  add_executable(${PROJECT_NAME} track2.c)

The above script creates a relative compiler path in
compile_commands.json:
  "command": "gcc   -O3 -DNDEBUG -o ...

Normally the CMAKE_C_COMPILER variable should be set before the
project() comannd.

  "command": "C:\\msys64\\mingw64\\bin\\c++.exe -IC...

Co-authored-by: Jonah Graham <jonah@kichwacoders.com>
2025-02-25 21:56:41 -05:00
Jonah Graham
74c4844357
Avoid null value being converted to "null" string in environment (#1096)
If the CDT Variable is APPEND or PREPEND, and the incoming environment
did not contain that variable name, the resulting environment would
have null.

For example, if PATH was not set on the incoming environment, and
PATH was supposed to be prepended with /usr/bin, this method
would have set PATH=/usr/bin:null

This change ensures that the delimeter + null are not prended/appended
when the incoming value is null.
2025-02-25 21:55:40 -05:00
Jonah Graham
6f818cdffe
Refresh compile_commands.json during the build (#1098)
CMake compile_commands.json file is not found even though it has been
created. During a CMake build's generation stage, it generates the
compile_commands.json file inside the build folder. However,
when it comes to be used it is not found because it hasn't been
reliably refreshed.

To solve this, the file resource is refreshed

Co-authored-by: John Moule <evil_bandit_betamax@yahoo.co.uk>
2025-02-25 21:54:44 -05:00
John Dallaway
5135c9fc85 Improve MinGW installation detection
- Look for clang, gcc or clangd
- Re-order search for MSYS2 MinGW subsystems
- Add clang installation info and notes to 'Before you begin' page
2025-02-23 17:14:35 +00:00
Jonah Graham
654e270767 Clarify API around CBuildConfiguration.getBuildDirectory as @nooverride 2025-02-19 21:03:55 -05:00
Jonah Graham
0e5338966d
Add a directory tracker to the CBS Makefile builder (#1071)
Messages such as "make: Entering directory" are now processed so
that the scanner info builder knows the correct full path to use
for build.

Without this code calls to ToolChain.getResourcesFromCommand() would
pass in the wrong directory and resources could not be reliably
calculated. With the incorrect calculation the scanner info does
not get applied to the file correctly and the file cannot be indexed
reliably.
2025-02-19 21:02:38 -05:00
Jonah Graham
3fc221a349
Use CommandLineUtil to split and join command lines in CBS Makefile support (#1073)
Without this the build and clean command entered in the CBS
settings could be parsed and re-assembled incorrectly.

A simple example is that an extra space (e.g. "make  clean") would
lead to an error when running make like:

```
make: *** empty string invalid as file name.  Stop.
```

This happened because the code used trivial split on " " and join
with " " to handle parsing that command line string into array of
arguments. This change fixes that by using the functionality already
available in CommandLineUtil

Fixes #1072
2025-02-19 21:02:01 -05:00
Jonah Graham
7cb2d69be9
Improve CommandLineUtil to string methods so they look prettier (#1074)
Initially CommandLineUtil.argumentsToString was used to provide properly
quoted string when interacting with GDB. But it is also useful to
print a string that can be copied + pasted to a terminal for the user.

When doing this the always quote every argument looks less nice, so
this change updates the code to only quote argument if needed.

Tests have also been added for the quoting.

Improves look and feel of changes in #1073
2025-02-19 21:00:46 -05:00
Jonah Graham
f5c54bd940
Fix mismatched id/name for CBuildConfigProvider (#1081)
This seems to only cause issues when using the plugin.xml GUI editor
because it cannot find the exsd file due to the incorrect id.
2025-02-19 21:00:23 -05:00
betamax
cf359d59ad
Stops CMake build output folders being named "default" (#1084)
The default IBuildConfiguration is no longer used by projects that use
ICBuildConfigurationProvider.

For CMake, Makefile and other Core Build projects the build output
folder is sometimes named "default" rather than the pattern
toolName.launchMode.toolchain OS.toolchain Arch.launchTarget Id (eg:
cmake.debug.win32.x86_64.Local). PR #1076 exposes new API
(ICBuildConfigurationProvider.getCBuildConfigName) to encourage this
naming pattern.

The "sometimes" is variable and often happens when a project is first
created when the active launch target is Local and the launch mode is
"run", but not always. This gives a random, inconsistent impression to
CDT.

The Platform project always contains a IBuildConfiguration with the name
IBuildConfiguration.DEFAULT_CONFIG_NAME. It seems the original Core
Build system design went to some length to fit in with this and always
make use of this IBuildConfiguration when pairing it with a new
ICBuildConfiguration.

With this PR, this no longer happens, allowing CDT code to be simplified
and the build folder naming made consistent, always adhering to
ICBuildConfigurationProvider.getCBuildConfigName.

Addresses Issue: CDT CMake Improvements #1000, IDE-82683-REQ-024 Default
CMake build folder
2025-02-19 20:55:50 -05:00
DangMinhTam382
e819f8a35c
Add UI for user to control build type (#1090)
User can control the value of the CMake built type (CMAKE_BUILD_TYPE),
for example Debug or Release via new UI in CMakeBuildTab
 Added UT for ICMakeProperties.getBuildType()

Addresses Issue: CDT CMake Improvements #1000, IDE-82683-REQ-013
2025-02-19 13:36:13 -05:00
Jonah Graham
47b1978568
Add internal API to CEditor to allow CDT-LSP to contribute a "try it" banner (#1088)
Part of https://github.com/eclipse-cdt/cdt/issues/968
2025-02-17 17:34:44 -05:00
Jonah Graham
07fcd8ff41
Remove backport from CDT releng (#1089)
It was useful when we were maintaining two branches, but
now it causes numerous false negatives in PRs

Reverts https://github.com/eclipse-cdt/cdt/pull/849
2025-02-17 09:51:55 -05:00
Jonah Graham
ca5dabc3a3
Remove unneeded local variables and instanceof checks (#1087)
new AdaptedSourceViewer was unnecessarily upcast to ISourceViewer
leaving a bunch of null checks and instanceof checks in the rest
of the method. This commit removes the unneeded code.

This extra complication was a result of CDT following JDT, but the JDT
case has much more configurability which meant the extra instanceof
and null checks are needed for JDT case.
2025-02-16 11:57:32 -05:00
John Dallaway
6fd372066e
Update "Before you begin" help to reference MSYS2 packages
Co-authored-by: Jonah Graham <jonah@kichwacoders.com>
2025-02-15 14:20:10 +00:00
Jonah Graham
f43b833f01
Make sure that if any of the piped commands fail, the cleanliness fails (#1083) 2025-02-12 15:46:03 -05:00
betamax
fc083dad86
The active Launch Target is now saved in the ICBuildConfiguration (#1076)
In addition to the active launch mode and toolchain, the active Launch
Target is now used to determine the Core Build Configuration
(ICBuildConfiguration).

The build output folder name now ends with the name of the Launch Target
(eg: cmake.debug.win32.x86_64.Local)

Additionally, API added to allow the ISV to configure the build output
folder name.

The ICBuildConfigurationProvider implementations, shown below, have been
tidied up to use common code.

  CMakeBuildConfigurationProvider
  AutotoolsBuildConfigurationProvider
  MakefileBuildConfigurationProvider
  MesonBuildConfigurationProvider

Addresses Issue: CDT CMake Improvements #1000, IDE-82683-REQ-016 Launch
Targets used in ICBuildConfiguration
Addresses Issue: CDT CMake Improvements #1000, IDE-82683-REQ-018 Build
output folder name
2025-02-12 12:30:48 -05:00
John Dallaway
f0c74ed38d Update SimRel version for CDT 12.0 2025-02-08 17:12:40 +00:00
John Dallaway
12e4b8e74c Add bugs fixed in 12.0.0 milestone builds to N&N 2025-02-08 13:38:51 +00:00
alicetrifu
b6d64ed76d
Issue #1058: Moved generation of the compile_commands.json (#1075)
Moved compile_commands.json file to performPrebuildGeneration, so the
file to be generated only when Makefiles generation is set to be on.
2025-02-03 10:36:17 -05:00
ewaterlander
c8e47b321d
Getting Started documentation update. (#1056)
* Put Core Build and Managed Build items in separate topics.
* Added two images to Creating a CMake project.
* Added new pages about creating a CBS Makefile project, using
  existing code, launch bar, building, running, and debbuggin
  a project.
* Renamed "Creating a simple application" to "Creating a Managed Build
  System Makefile project" and replaced two images.
* Removed "Creating a Makefile project", because it was duplicate
  information.

Fixes #992
2025-01-30 09:03:07 -05:00
Jonah Graham
0fcf41aacf
Bump org.eclipse.cdt.core/ui bundle version to 9.0.0 (#1063)
Some of the changes that are about to arrive have specific impacts
of API of core build. Because CBS is largely in org.eclipse.cdt.core/ui
any breaking changes to the CBS API necessitate bumping the entire
bundle to a new version.

One of the most noticeable changes is expected to be that
org.eclipse.cdt.core.build.ICBuildConfigurationProvider.createBuildConfiguration(IProject, IToolChain, String, IProgressMonitor)
needs a new parameter to properly connect the target. The upcoming
PR that makes the API change will document that change in the
CHANGELOG-API.md and N&N documentation.

Part of #1000
2025-01-29 14:21:09 -05:00
Jonah Graham
889a5f1db5
Add CDT-LSP to API Baseline (#1066)
See https://github.com/eclipse-cdt/cdt-lsp/pull/406#issuecomment-2622119241
2025-01-29 12:43:15 -05:00
Jonah Graham
84d99f277a
Add some documentation and consistency to use of info vs output stream (#1060)
With some better Javadocs the cross referencing between IConsole
and the UI aspects of the console is a little easier to follow.

This resolves #1059 in two parts:

1. For Core Build System this update consistently uses info stream to
show information messages and output stream to be stdout of launched
build tool. This resolves the "Build Complete" appearing as the output
color when doing clean (See screenshots in #1059)

2. CBuildConfiguration.watchProcess(IConsole, IProgressMonitor) incorrectly
passed the info stream as the output stream. Mostly this was used for
the clean stage of builds. This resolves the CMake output like ("Cleaning
all built files...") appearing as the info color when doing clean (See
screenshots in #1059)

Fixes #1059
2025-01-28 18:54:38 -05:00