engine: fix +ignore pragma for constructors#11835
Open
matipan wants to merge 1 commit intodagger:mainfrom
Open
engine: fix +ignore pragma for constructors#11835matipan wants to merge 1 commit intodagger:mainfrom
matipan wants to merge 1 commit intodagger:mainfrom
Conversation
Fixes dagger#11750 Signed-off-by: Matias Pan <[email protected]>
80f06c5 to
e63aa32
Compare
sipsma
reviewed
Feb 10, 2026
Contributor
sipsma
left a comment
There was a problem hiding this comment.
Are we 100% sure that this was specific to constructors? I can't see anything in the diff that is specific to constructors, but might have missed something.
Asking because if the behavior of "explicit arg doesn't use ignore" was true for normal functions but false for constructors, then I totally agree we should make them consistent.
However, if the behavior today is that "explicit arg doesn't use ignore" for all functions, then I actually think it's pretty ambiguous whether that's correct or not. I can see cases where passing an explicit argument in place of your context dir:
- should NOT use the default ignores, i.e. I really want you to use the directory I give you
- should use the default ignores, i.e. don't make me manually type all that out again just because I'm overriding a path
It almost seems like something that should be possible to specify somehow when you pass the arg?
cc @shykes @kpenfound DX related
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.
Fixes #11750.
The issue is caused by a check on
setCallInputs:In this context an argument is considered contextual if either the
DefaultPathorDefaultAddressis set. If it is thensetCallInputswill not go through the ignore process of directories. The problem: arguments that are contextual (they have a default path) but a user specified a value will not be loaded as part of the contextual loading and will also be ignored in this check. This meansapplyIgnoreOnDirwill never run for them.Looking into the code I found two potential fixes:
isContextualcheck and apply ignore on all arguments. Great for simplicity, but it means we are going to run theapplyIgnoreOnDirfunctions on truly contextual arguments twice.I went with the second option even though it required more code changes. I'm not 100% sure on the performance impact of running
applyIgnoreOnDirtwice for contextual args, but it felt wasteful.As for the test: I created a separate test even though we already have a
TestIgnore. This was mainly to keep the existing test clean given that it tests a wide range of cases but for function arguments only. Happy to merge them and look into potential improvements for them.Tested the change with a dev engine and a module with the following code:
Specifying the arg using a dev engine vs v0.19.11:

Not specifying the arg (using the context):

AI disclosure
We don't really do or require this in the project, but given the buzz in social media I thought it would be worth disclosing the use of AI for this PR.
I used it as a guide to look into the code and it helped me understand how arguments are considered contextual, at which point they are loaded and ignored and what is the difference between constructor and function args. Once we found the bug, the code changes were also AI assisted but not vibe coded.