Use absolute paths for source-transform access transformers - #126
Closed
mezz wants to merge 1 commit into
Closed
Conversation
|
mezz
commented
Aug 11, 2026
## Problem `ApplySourceTransformAction` receives user-provided files from `--access-transformer` and `--validated-access-transformer`. NFRT launches the Java Source Transformer (JST) from a temporary directory for the `transformSources` node, so a relative path such as `config/at.cfg` would be resolved from that directory instead of the directory where NFRT was launched. ## Fix Convert both kinds of user-provided AT paths to absolute paths before formatting the JST command line. Paths inside the node's temporary directory can still be shortened by `ProcessingEnvironment#getPathArgument`, while paths supplied from elsewhere keep their correct location. This change originally came from Technici4n's commits `daa4bd9` and `6acd2cc`. ## Tests Launch the packaged NFRT jar through its normal `run` command against a small offline NeoForm fixture. Pass relative files through both `--access-transformer` and `--validated-access-transformer`, then check the published `gameSources` archive to confirm that the real configured JST applied both files. As a control, removing the two `toAbsolutePath` calls makes the CLI exit with an error when JST reports `NoSuchFileException` for the relative validated AT path. Co-authored-by: Technici4n <13494793+Technici4n@users.noreply.github.com>
mezz
force-pushed
the
pr/normalize-source-transform-at-paths
branch
from
August 13, 2026 16:36
97af295 to
550dd37
Compare
mezz
marked this pull request as draft
August 14, 2026 06:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please bear with me here, I'm going to make a few small PRs as I'm slowly trying to understand NFRT. I'm picking apart #65 for stuff that can be tested and merged sooner.
Problem
ApplySourceTransformActionreceives user-provided files from--access-transformerand--validated-access-transformer. NFRT launches the Java Source Transformer (JST) from a temporary directory for thetransformSourcesnode, so a relative path such asconfig/at.cfgwould be resolved from that directory instead of the directory where NFRT was launched.Fix
Convert both kinds of user-provided AT paths to absolute paths before formatting the JST command line.
This change originally came from Technici4n's commits
daa4bd9and6acd2cc.Tests
RunApplySourceTransformActionthroughNeoFormEngine. The test supplies relative paths for both--access-transformerand--validated-access-transformer, then checks that JST applies both files to the output sources.I created a builder for running the full NFRT command, to allow easier creation of integration tests, then I added a simple test case for this.