Include the top-level subdir.mk only when one was actually generated
(i.e. when there are source files there), just like for all other
subdir.mk, otherwise a stale one from earlier when there were source
files that have since been removed may be picked up, causing "No rule to
make target" errors.
In some cases (from bug 303953), the removal would be noticed and the
stale subdir.mk be overwritten by a correct empty one, avoiding the
error, but not in the following cases:
- When CommonBuilder.performCleanning() decides that a full rebuild is
needed, regenerateMakefiles() is called instead of generateMakefiles(),
which doesn't get the delta.
- When the refresh in which Eclipse notices the removed source file
happens as part of a build (one that probably failed because the
makefiles weren't updated yet), the next build after that apparently
does not get the delta containing the removal anymore.
Change-Id: Id15b424f02dd5c513d2124620c0c8699d61874fd
Signed-off-by: Christian Walther <walther@indel.ch>
Several parts of makefile output were generated by iterating over
HashMaps, which do not have a deterministic iteration order. Use
TreeMaps instead to output in sorted order. This is possible now that
the API function with return type HashMap is no longer public API and
can be changed to return Map instead.
Benchmark files for affected tests are updated to the new ordering.
This would not be strictly necessary: the tests would also succeed
without, since org.eclipse.cdt.managedbuilder.testplugin.
ManagedBuildTestHelper.compareMakefiles() uses a reordering-tolerant
comparison. However, recording the new (now hopefully stable) order
makes future development on makefile generation easier by avoiding
spurious diff output when tests fail due to changes to other parts of
makefiles.
Change-Id: I20f2e51bd5b9e3bcc5da245d781ca5b4a34fc0b2
Signed-off-by: Christian Walther <walther@indel.ch>
This fixes a small and rarely hit in practice regression regarding
nondeterministic ordering in makefile output introduced in 15c29eb (bug
505882).
Multiple values for a build output variable were previously output in
definition order. Now they are generated by iterating over a HashSet,
which does not have a deterministic iteration order. Use a TreeSet for
output in a consistently sorted order instead.
Output variables with multiple values are rare (most tools generate one
output file of a particular type) and this case was not exercised in the
existing unit tests. Modify one such that it does (even if in a somewhat
contrived situation). Of note, ${OUTPUT} cannot be used in the
commandLinePattern for such a tool because it squashes the multiple
values into a single quoted file name - misuse ${FLAGS} instead.
Change-Id: Iaa28525c21d74c87dd4d72a03e334ed0e5576727
Signed-off-by: Christian Walther <walther@indel.ch>
Add API to o.e.tools.templates.ui that hooks into the smart import
feature and allows easy implementation of configurators for various
CDT project types.
Project types that have a IGenerator may use this API to offer smart
import functionality by registering their implementation using the
org.eclipse.ui.ide.projectConfigurator extension point.
This change includes project import implementations for Meson and
CMake project types.
For these project types users can use the normal project import
workflow for their existing non-Eclipse CMake projects instead of
using the New Project Wizard. As an additional benefit, users
can now also import more than one project at a time, even nested
projects.
Change also includes SWTBot tests to exercise the feature.
Signed-off-by: Mat Booth <mat.booth@gmail.com>
Change-Id: I96589e86bee561aa200a4a4487549305765d6409
If these tests fail, they cause a series of metadata corruption that
will render most/all test executed after as unreliable. Usually, there
is about ~150 test cases that fail without reason when one of these
fails.
Contributed by STMicroelectronics
Change-Id: Ic71ace8b6a55c49dd729d40385b245f12dbd6d85
Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
The interface has no use as it's hardcoded to be an instance of
ManagedBuildGnuToolInfo in the GnuMakefileGenerator anyway.
Contributed by STMicroelectronics
Change-Id: I0e9130ef485d103e7114e0d122015c062253b4bb
Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
To avoid errors like "Command line too long" when removing build
artifacts, split the clean command on multiple lines. In order to
properly handle whitespace etc, generate a new clean target in each
subdir.mk with the explicit list of files to remove in that directory.
The command should be splited on a sane length, 6000 is used in the
internal builder, so reuse that limit here.
Contributed by STMicroelectronics
Change-Id: I843e1ac896076d279173c421210b72f4a325296f
Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
One more place where the GnuMakefileGenerator is instanciated that
should have been changed in previous commit.
Contributed by STMicroelectronics
Change-Id: Ib89d5e77cbdd2148723b9b1a80cafb72d35390a4
Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
The GnuMakefileGenerator is a huge file that needs lots of fixes.
However most of the time to implement the fixes are taken up trying
to not break API. Most extenders of CDT provide their own
implementation of GnuMakefileGenerator by copying the CDT one
and modifying it. Therefore CDT is going to take that same
approach internally and leave the existing GnuMakefileGenerator
in its unmodifiable state.
Change-Id: I12fafb5e347112648a02d4593267bd88a47b5c88
Bug_303953Test.testBuildAfterSourcefileDelete() is occasionally seen
failing with an unexpected change to .cproject. I have not investigated
what the change is, but it's plausible that some background process like
the indexer or scanner discovery might asynchronously modify .cproject,
and .cproject is not the focus of this test, so just ignore it along
with .project.
On the hopeful assumption that this was the only flakiness, I am
removing the @Tag(BaseTestCase5.FLAKY_TEST_TAG) annotation.
Change-Id: Ie9191aaf1a66e8475f05eb422d6e4b3949f8138d
Signed-off-by: Christian Walther <walther@indel.ch>
This file was not being detected by Surefire because it didn't
match the expected file name pattern.
Change-Id: I357fcf7845ad4fdaa2697599d0f400bb128efd20
Exclude everything in */meson-private/* when generating meson
projects.
Signed-off-by: Mat Booth <mat.booth@gmail.com>
Change-Id: Id26c8dd695e5d09d158bb747b50e04544df706c9
Addendum to 0436516 (Bug 573502): The main-build target now always
exists, not just when there is a pre-build step, so it must always be
marked as .PHONY.
Change-Id: I478222bcc319c516a6e116f710d8382346b5ded5
Signed-off-by: Christian Walther <walther@indel.ch>
Most of the tests in this bundle already had this bit of code
before calling create project. This makes BuildDescriptionModelTests
consistent with the rest.
Note that this modifies global state and does not restore it. However,
as that is consistent with the other tests in this bundle, and the
global state is only maintained while running tests on this bundle,
I am not fixing this aspect of the code.
Change-Id: I2004af177a959e1efbd45b23c960b517d8993b7c
While most of these commands don't actually have spaces in them, or
their arguments, avoid the deprecated methods.
Change-Id: If7b4324695699d5a6d9a2f8a979657977486d8a4
The "eclipse.launcher" property is available when using the eclipse
launcher. If the headless builder app is launched without the eclipse
launcher, fall back to generic "PROGRAM".
The property is not available when running eclipse in runtime mode!
Contributed by STMicroelectronics
Change-Id: If2c99a234fd841451af05e3635d44fe2967c9537
Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
During operations, such as remove projects, the subtask of a progress
monitor has useful information for users. However during a normal build
there ends up being lots of output that is of little value.
Change-Id: Ie5bf95a743e8909242a0224883fd22e49ff55ed6
The post-build step may depend on secondary artifacts of the build and
should thus be executed last.
Contributed by STMicroelectronics
Change-Id: Iaf67f6b3e1fcab008798d2712e15d0a6a46ceae8
Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
This allows to clean the correct configuration
Contributed by STMicroelectronics
Change-Id: Ia47f3694809579f8d6fa6d6e6b0dd46f553d256d
Also-by: Torbjörn Svensson <torbjorn.svensson@st.com>
Also-by: Jonah Graham <jonah@kichwacoders.com>
Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
Signed-off-by: Jonah Graham <jonah@kichwacoders.com>
When a user switches toolchain integration used, all the settings will
be lost. Rather than having the user find this out the hard way, prompt
about it and highlight the implications of changing toolchain.
Contributed by STMicroelectronics
Change-Id: I885bc5544d7222eb1aeee7c92ac98c0d1c083cb1
Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
Note that:
- doc/org.eclipse.cdt.doc.isv
- doc/org.eclipse.cdt.doc.user
were updated in commit 149aca51f9 made
this release cycle.
Change-Id: I5b19c7ba14d1c3f837163c109603f9a330e9f138
System.arraycopy is more error prone and subsequent commits will
be modifying the array. This commit is to keep unrelated code
separate.
Change-Id: I2490318176da3e631a63974ffe5fa62da44a96ea
Upgrade the tests to JUnit5 so they can be marked as flaky and slow.
Also removed a bunch of unused code.
This partially reverts commit 8220215a2e.
Reason for revert: These tests were "temporarily" disabled a while ago
as part of the JIRO migration in Bug 545624.
Change-Id: I111cf4d9d9f5e07e49074ca2355a3d1f52fb1070
Added missed license headers
Updated baseline for the parent pom to CDT 10.2
Updated version for pom.xml to 10.3
Updated version for features and bundles to CDT 10.3
Updated copyright for about.properties to be 2021
Incremented version + 100 where needed
Change-Id: I79666fcc0402fee6607499d7dce1eaf87a5f446d
Signed-off-by: Alexander Fedorov <alexander.fedorov@arsysop.ru>
When invoking the headless build, the verdict should be the "sum" of
all the build configurations. If one build configuration fails, then
the verdict of the build should also be "failed".
Contributed by STMicroelectronics
Change-Id: Ic3237d3531657f7f89c9338142ebf8fdb477c481
Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@st.com>
Moved handling of "-help" to a new plugin using the same approach as
was used for the JavaCodeFormatter in bug 543363. This mainly allows
to get the help text even if the workspace is missing.
Contributed by STMicroelectronics
Change-Id: I4ee2e93f0e8fed13ddebd70c3bce58f047aa1d12
Also-by: Jonah Graham <jonah@kichwacoders.com>
Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@st.com>
Allow extenders to extend the ManagedCommandLineGenerator in order to
add options that are placed on the toolchain node instead of the tool.
Contributed by STMicroelectronics
Change-Id: I548bcbf72f1290cd4bc0ce830c27ce032a62c9c9
Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@st.com>
A change of build configuration should rebuild the artifact.
With make, this is achieved by depending on the makefile that contains
the rule to build the artifact. If the flags change, so will the
makefile do and the artifact is rebuilt.
Contributed by STMicroelectronics
Change-Id: I56e0376ff9bfa5629b55c1b6c9f94a6f930e0d69
Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@st.com>
When there is a linked file in the project, the build target for the
content in the .d file should be the .o file as that is what is
depending on the source file.
Use "$@" rather than "$(@)" as it's the usual syntax for single letter
variables in make.
Contributed by STMicroelectronics
Change-Id: I6b024b2b3a1a8b061740e99de5e96923981c92fa
Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@st.com>
The symbols generated are:
* BUILD_ARTIFACT_NAME
Value of "Artifact name" field defined in the build configuration
* BUILD_ARTIFACT_EXTENSION
Value of "Artifact extension" field defined in the build configuration
* BUILD_ARTIFACT_PREFIX
Value of "Output prefix" field defined in the build configuration
* BUILD_ARTIFACT
Assembly of the other values to build the target file name
The above symbols make it easier to extend the generated makefile using
the provided makefile hooks "makefile.init", "makefile.defs" and
"makefile.targets". There is no longer need to duplicate the name of
the target artifact in the hooks files.
The hooks can for example be used when the post-build step is not
flexible enough. By placing the post-build step in makefile.targets,
when done properly, will let the user have full control over the
sequence, including parallelism, for the required steps.
Contributed by STMicroelectronics
Change-Id: I163917837b65cb397eb5943c4357a54e9576cf42
Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@st.com>