-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Seemingly random incorrect evaluation of the can() function #13018
Comments
My trials on intel Mac. Packer version 1.8.5
|
I have tried 1.8.5 amd64 and arm64 binaries on Mac M3 and it shows the same error. The same on Ubuntu 22.04, it just took a bit more tries (I recommend trying with |
False once. True twice.
|
Interesting, I too am able to replicate this behaviour. Are you experiencing this only with |
Thanks! I observe this also in regular builds, but I was not able to prepare a simple test case, which would run as is, so I went down with I have finally tried to prepare the test case for Code:
Output:
|
Yeah it's likely the same problem. Looking at the code it seems to be an order of evaluation problem, not sure if the order in which the variables are defined an aggravating factor (I suspect it is by experience with a similar issue in the past), but definitely we should be more resilient to this, and we should build a solid order of evaluation rather than the optimistic one we've adopted here. I'll see to open a PR soon for this. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Overview of the Issue
I am afraid I am bringing the worst type of bug. I am getting different result for calling
can()
function between different executions of Packer. I was not able to determine what makes the difference between correct and faulty evaluation. Sometimes it is mostly right, sometimes 50:50 and for some of my templates it is always wrong. It sometimes seems that the more complex the template is the more often I get the wrong result.I am noticing something similar with
try()
function. However, its result does not seem to change with different executions but with different arguments provided, so I might create a separate bug report for that later on.Reproduction Steps
Repeatedly run provided Packer template with
packer console .
and printlocal
object.Packer version
From
1.11.0
and1.9.4
Simplified Packer Template
Operating system and Environment details
Tested in two environments for two different versions of Packer:
1.11.0
)1.9.4
)Log Fragments and crash.log files
The text was updated successfully, but these errors were encountered: