-
Notifications
You must be signed in to change notification settings - Fork 386
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
Using ARG --global EARTHLY_GIT_HASH
results in error when using FROM --pass-args
#3775
Comments
Same issue here. It seems if a target uses a built-in arg and uses --pass-args to invoke other targets, the issue is raised. |
I wrote a simple patch to ignore variable names that matches any built-in args instead of erroring out, I can create the PR but I am not sure if this behavior is acceptable by the Earthly team. I wasn't too sure how to propagate the offending variables up to a "console writer" or how I can refer to the console within the
|
ARG --global EARTHLY_GIT_HASH
results in error when using with FROM --pass-args
ARG --global EARTHLY_GIT_HASH
results in error when using FROM --pass-args
Thanks for taking a deep dive @dustyhorizon I think it would be better to tackle it under earthly/earthfile2llb/converter.go Line 1708 in 34320d5
earthly/earthfile2llb/converter.go Line 1901 in 34320d5
However, there's some additional issues though that we need to think about, for example consider:
when running
But I don't know if we should also see the built ins, e.g.
edit: let's not pass them along -- after combining the scopes, we could introduce a new function like |
In second thoughts (after chatting with @mikejholly), it seems easier to avoid these edge cases of what the values should be by simply not passing built in args. The |
@alexcb Your last comment sees reasonable.. |
I moved it up in our todo priority; however we'll gladly accept a PR if anyone is able to get to it sooner. |
potential fix in #3872 |
@dustyhorizon can you provide a concrete example for this issue? I went to test it against v0.8.4 and couldn't replicate the issue; here's what I tried:
and
both output the same values:
|
Today I got into same issue in one of our build pipelines.. Simplest pipeline that fails..
|
fixed in v0.8.5 |
What went wrong?
Specifying
ARG --global EARTHLY_GIT_HASH
or any other builtin args outside of thebase
target (i.e. before the firstFROM
directive) causesvalue cannot be specified for built-in build arg EARTHLY_GIT_HASH
when using--pass-args
options forFROM
, andDO
directives (possibly others as well) when referring to external Earthfiles.These external Earthfiles also have
ARG --global EARTHLY_GIT_HASH
set as well.What should have happened?
Earthly should ignore builtin args from being passed in via
--pass-args
as they are implicitly available anyway in the global context.Other Helpful Information
Earthfiles are running
VERSION 0.8
with Earthly 0.8.3, this was a non-issue when usingVERSION 0.7
with Earthly 0.7.23The text was updated successfully, but these errors were encountered: