Fix built-in macros for the mutable ParseContext #4583

Merged
merged 2 commits into from May 13, 2017

Conversation

Projects
None yet
1 participant
@stuhood
Member

stuhood commented May 12, 2017

Problem

The v2 engine mutates the ParseContext in order to avoid re-creating all macros and context object factories for every build file path. But some built in macros without adequate integration test coverage (or which are instantiated via different codepaths in v2, as is the case with file globs and bundles) escaped being updated.

Solution

Update the remaining macros that attempted to inspect the parse_context.rel_path during construction rather than during usage. Add tests/examples to cover two of the broken macros.

@stuhood stuhood requested review from benjyw, kwlzn and JieGhost May 12, 2017

@stuhood stuhood added this to the 1.3.0 milestone May 12, 2017

@stuhood

This comment has been minimized.

Show comment
Hide comment
@stuhood

stuhood May 13, 2017

Member

Merging --tbr to unblock rc1.

Member

stuhood commented May 13, 2017

Merging --tbr to unblock rc1.

@stuhood stuhood merged commit 7b8500e into pantsbuild:master May 13, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@stuhood stuhood deleted the twitter:stuhood/fix-builtin-macros-for-mutable-parse-context branch May 13, 2017

stuhood added a commit that referenced this pull request May 13, 2017

Fix built-in macros for the mutable ParseContext (#4583)
### Problem

The `v2` engine mutates the `ParseContext` in order to avoid re-creating all macros and context object factories for every build file path. But some built in macros without adequate integration test coverage (or which are instantiated via different codepaths in `v2`, as is the case with file globs and bundles) escaped being updated.

### Solution

Update the remaining macros that attempted to inspect the `parse_context.rel_path` during construction rather than during usage. Add tests/examples to cover two of the broken macros.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment