1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-03-28 14:56:28 +01:00
Commit graph

14460 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Jonah Graham
64ad743617 Update maven dependencies to latest versions, especially Hamcrest
Fixes #1037
2025-01-16 14:57:42 -05:00
betamax
3c4287f03d
Make CMakeBuildConfiguration API (#1010)
For ISV integration/extension to CDT CMake, it is necessary to extend
several non-API classes (eg: CMakeBuildConfiguration,
CMakeBuildConfigurationProvider). This would cause "Discouraged access:
The type XXX is not API" warnings.

The classes have now been made API so can be extended without warnings.

Addresses Issue: CDT CMake Improvements #1000, IDE-82683-REQ-017
Extending CMakeBuildConfiguration
2025-01-15 11:18:36 -05:00
Jonah Graham
2f55372836
Remove New C and New C++ Project Wizard top-level entry points (#993)
Fixes #965
2025-01-07 10:02:19 -05:00
Jonah Graham
dfdc174b6d Update and refactor Dockerfiles to newer Ubuntu
The docker images all have new, simpler names and use Ubuntu 20.04
(instead of 18.04) as their base.

A few new tools have been added, specifically what is needed for:

- Linux on RISC-V - see #980
- Winodows on ARM - see #969

Fixes #976
2024-12-28 10:48:30 -05:00
Jonah Graham
344d715b83 Allow PTY to not load WinPTY on Windows
Refactors the initialization code of PTY to allow code to avoid
loading WinPTY if it isn't needed. The previous code would
load WinPTY even if ConPTY was in use.

To achieve this the code was refactored to have cleaner state
with a new field ptyType that replaces isConPTY, isWinPTY and
hasPTY.

This is needed so that WoA can run without needing to port the
unneeded WinPTY library. In particular, the winpty.dll and
pty.dll are no longer used on WoA.

Part of #969
2024-12-28 10:48:30 -05:00
Tue Ton
83e52ef18c Add native support for Windows on Arm64 (#971)
- add a new fragment 'org.eclipse.cdt.core.win32.aarch64' containing
re-compiled Arm64 natives suitable for the Windows on Arm64 platform.

- add the 'serial.dll' binary re-compiled for Windows on Arm64.

- add the win32/win32/aarch64 environment triplet to various Maven
build scripts to support building CDT software for that environment.

The updated dlls/exes are not included in this commit and will be provided
in subsequent commits with the corresponding update to build infrastructure

Part of #969
2024-12-28 10:48:30 -05:00
Torbjörn Svensson
27b8da4ecd Classify unrecognized command line options as an error
Contributed by STMicroelectronics

Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
2024-10-19 16:53:52 +02:00
Jonah Graham
e50f81b95b
Bump version to CDT 12.0.0 (#911) 2024-10-08 12:52:15 -04:00
Torbjörn Svensson
9b09dce3a0 __DATE__ should expand with the name of the month in English
Contributed by STMicroelectronics

Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
2024-08-30 14:03:24 +02:00
Torbjörn Svensson
3b6f1359f0 __DATE__ should have day prefixed with space
The documentation for GCC, and other compilers, stipulates that
__DATE__ with a day of month less than 10 should be prefixed by a space,
not a zero.

Contributed by STMicroelectronics

Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
2024-08-30 14:03:24 +02:00
Torbjörn Svensson
54ebddc01c Added missing bracers in native code
Contributed by STMicroelectronics

Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
2024-08-13 13:32:33 +02:00
John Dallaway
6ffa02911a Allow multiple parserPage XML elements
Eliminates warning on org.eclipse.cdt.ui/plugin.xml
2024-08-07 16:17:02 +01:00
John Dallaway
9e1be512cb Add ELF machine IDs for AVR32, MicroBlaze and V800 2024-07-28 03:45:53 +01:00
Andreas Dangel
3875408070 Speed up closing all file descriptors in the child process (Fixes #835)
_This commit adds to #840 7bd8d52c6c to apply the same fix to
another place that does the same operation on all fds._

When _SC_OPEN_MAX (max nr of open files limit per process) is a very
big number, then closing all possible file handles can take a while.
This change first tries to use the syscall close_range() if available,
falling back to use /proc/self/fd to close only open file handles,
and lastly falling back to the old way of closing all possible handles
one after another.
In general, the first or second approach should be available
which speeds up the pty spawning.

Refs JetBrains/pty4j#147
Copied from 04685d870f
(which is EPL 1.0)

Co-authored-by: Sergey Simonchik <sergey.simonchik@jetbrains.com>
2024-06-27 20:08:16 -04:00
Jonah Graham
24d9bd1834
Correct formatting of C code (#843)
Apply the coding standards to the C code from #840
2024-06-23 14:35:34 -04:00
Jonah Graham
f39fa5596a Bump version of o.e.cdt.core.native 2024-06-23 12:07:26 -04:00
Andreas Dangel
7bd8d52c6c Speed up closing all file descriptors in the child process (Fixes #835)
When _SC_OPEN_MAX (max nr of open files limit per process) is a very
big number, then closing all possible file handles can take a while.
This change first tries to use the syscall close_range() if available,
falling back to use /proc/self/fd to close only open file handles,
and lastly falling back to the old way of closing all possible handles
one after another.
In general, the first or second approach should be available
which speeds up the pty spawning.

Refs JetBrains/pty4j#147
Copied from 04685d870f
(which is EPL 1.0)

Co-authored-by: Sergey Simonchik <sergey.simonchik@jetbrains.com>
2024-06-23 12:07:26 -04:00
betamax
0f36d5dba1
On createBuildConfiguration, reset project's ScannerInfoProvider (#817)
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.
2024-06-12 08:56:47 -04:00
Jonah Graham
7fcfbb0f96
Prepare repo for 11.7.0 development (#813) 2024-06-05 13:19:53 -04:00
G. Hentschke
9f85daf44b
[#808] Support overriden default-editor-association in EditorUtility (#809) 2024-05-31 13:16:03 -04:00
ewaterlander
cd0292a4fc
LLVM optimization remarks. (#803)
Added support for LLVM optimization remarks to the GCC c/c++ error
parser. They were falsly treated as errors (OtherError). Now they are
treated as generic infos. GCC has no diagnostic messages of 'remark'
type. Since GCC and LLVM messages are very similar, no separate LLVM
error parser was created.

Fixes #752
2024-05-29 08:53:59 -04:00
Marc-Andre Laperle
3062cdc8d8
Parse empty __attribute__(()) (#770)
This is accepted by both GCC and Clang and encountered in real code. It looks a
bit strange but basically a condtionally defined macro was used inside the (())
depending on a configurable feature macro of the project.
2024-05-17 12:49:41 -04:00
Jonah Graham
b433dfad02 Update docker image of osxcross to latest requirements.
Building osxcross is somewhat problematic because the versions
are not fixed and reproducibility of making this docker file
can be problematic. For example new versions of cmake, etc
make be needed. TODO Is there a way to fix the version of
osxcross so that we can rebuild reliably?
2024-05-01 12:36:57 -04:00
Jonah Graham
f0ae450f72 Remove use of Thread.stop from test code 2024-04-27 06:18:10 -04:00
Jonah Graham
cc66780e92 Cleanup CDT repo related to the docker + Java 21 updates
- Fix links for cdt-infra
- The cdt-infra git repo is now archived, so this commit updates
the links to the current values.
- Add new Docker related files to the gitattributes as text files
- Update DEFAULT_BUFFER_SIZE for Java 21's value when building JNI,
this also means the dll/exe need a rebuild
- add a toolchains.xml since we use Java 21 toolchain, but most bundles
are Java 17 still
2024-04-26 20:26:40 -04:00
Jonah Graham
381cb7eac5
Refactor MarkOccurrenceTest to JUnit5 style (#730)
This was completed so I could best investigate
https://github.com/eclipse-cdt/cdt/pull/729#issuecomment-1984184372
2024-03-08 11:59:50 -05:00
Jonah Graham
221d346f6d
Prep repo for 11.6.0 (#729) 2024-03-07 14:17:45 -05:00
Dietrich Travkin
95fe4d8701
[#716] Fix varying order of elements in project explorer (#717) 2024-02-26 11:35:53 -05:00
Jonah Graham
207bddab5a
Build with Tycho 4.0.6 (#715)
Includes bundle version bumps for new version of ECJ and
target platform update.

Co-authored-by: Александър Куртаков <akurtakov@gmail.com>
2024-02-22 21:38:57 -05:00
Александър Куртаков
25edc17924 Copyright year bumps 2024-02-21 16:59:16 +02:00
Александър Куртаков
ceb55c49fb Unify maven-compiler-plugin setting
Define the common version in parent pom and don't override it.
Move to latest version while at it.
2024-02-21 16:59:16 +02:00
G. Hentschke
d04849b0c4
[703] fix NPE when no build binaries on system PATH (#704)
[703] fix NPE when no build binaries on system PATH

- fixes NPE when new cmake project has been created while there are no
C/C++ build binaries on the PATH environment variable. The NPE has been
thrown when the children of the project should be fetched (e.g. in
project explorer view)
- fix NPE cause in ErrorBuildConfiguration
- fix unit test

fixes #703
2024-02-11 07:45:57 +01:00
Alexander Fedorov
7f69191296 [#693] Fix resource leak warnings for org.eclipse.cdt.core.utils
* use `try-with-resources` for `AutoCloseable`
2024-02-07 18:24:08 +03:00
John Dallaway
a1a9d93c7e Accommodate external binary object files
- Adorn external binary object icons
- Present symbols under external binary object resources
- Label external binary objects with filename only
- Present absent external binary objects with grey label
- Sort external binary objects by filename only
2024-02-03 04:24:32 +00:00
Marc-Andre Laperle
d5ec9d7c68
Improve ProblemBinding checker message for failed function instantiation (#668)
Display the new more accurate error when all candidates were failed
instantiations. Otherwise, if there is a mix of failed instantiation and
wrong number of arguments, display the old message.
This could really be improved even more...

template<typename T>
void function() {}

Before:
function(); // Invalid arguments 'Candidates are:

After:
function(); // Cannot instantiate template function 'Candidates are:
2024-02-02 11:40:47 -05:00
Marc-Andre Laperle
e838a231d9
Partial fix for bug 574196/530103, error involving sizeof...() (#667)
Also discovered that non-type param is not handled at all.  This case is not
covered in this commit but there is a commented-out failing test for it.
2024-02-02 11:39:16 -05:00
John Dallaway
233c6d8696 Invoke "gcc" to build assembler files
Enables pre-processing of *.S and *.sx source files.
2024-01-24 20:25:19 +00:00