eclipse-xtext / eclipse-xtext/xtext

BuilderParticipant.doBuild behaviour is order dependent

Open
#2,455 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
831
Forks
330
Avg merge
3d 7h
Merged PRs (30d)
12

Description

The behaviour of BuilderParticipant.doBuild behaviour is order dependent.
it does the cleanDerivedResources on per file level.
thus the guard in cleanDerivedResources that does a if (derivedResourceMarkers.findDerivedResourceMarkers(iFile).length == 0) {
will not match if the "add" delta is proccessed after the "remove"
and "add" and "remove" lead to the same generated file
(e.g. when the dsl supports file shadowing similar to java or you move a file from one to another source folder)

the problem with this behaviour is that the resource event for the derived resources
differs (delete+add, change, no event) which might affect downstream toolchains

so i wonder if first all generators should be called and then the cleanup should take place
or if we should sort the deltas and move "removes" to the end of the deltas list

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing BuilderParticipant.doBuild and its per-file calls to cleanDerivedResources, then inspect how derivedResourceMarkers.findDerivedResourceMarkers is evaluated across add and remove deltas. Reproduce a move or shadowing case where both deltas produce the same generated file, and verify that the resulting derived-resource event is consistent for downstream toolchains.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.