Skip to content
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

cannot reference target in another directory when directory is defined in LET or ENV #3933

Open
idodod opened this issue Mar 22, 2024 · 0 comments
Labels
type:bug Something isn't working

Comments

@idodod
Copy link
Contributor

idodod commented Mar 22, 2024

What went wrong?

I have 2 target each in a separate Earthfiles. when one target calls the other and specifying the path of the Earthfile where the called target is via LET or ENV, the build fails. When specifying the path via an ARG, the build succeeds.

.
├── Earthfile
└── subdir
    └── Earthfile

./Earthfile:

VERSION 0.8

FROM alpine


caller-with-let:
    LET path="subdir"
    BUILD ./$path+called

caller-with-arg:
    ARG path="subdir"
    BUILD ./$path+called

caller-with-env:
    ENV path="subdir"
    BUILD ./$path+called

./subdir/Earthfile

VERSION 0.8

called:
    FROM alpine
    RUN --no-cache echo called target successfully

earthly +caller-with-let - fails
earthly +caller-with-env - fails
caller-with-arg - succeeds

When it fails, it displays an error such as:

  Error: async earthfile2llb for ./+called: Earthfile line 0:0 target called not found
     18  in             +called

What should have happened?

Other Helpful Information

https://cloud.earthly.dev/builds/9a343710-c326-4fb9-a842-6718a6156de2

@idodod idodod added the type:bug Something isn't working label Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

1 participant