E

Issue with Monorepo Earthfile Paths

Summary

The user encountered an issue with a main monorepo that has a base earthfile referencing subdirectory earthfiles. When using a git URL to call the monorepo's base earthfile, relative paths in the earthfile do not resolve. The user implemented a workaround by introducing a $MONOREPO_DIR variable to maintain the use of relative paths but is questioning whether this behavior is an oversight or expected. They suggest that if it is expected, it should be documented in the reference materials.

Status
open
Tags
    Source
    #earthly
      c

      cameron.cooks

      10/21/2024

      I ran into a problem earlier today though - I have a main monorepo, with a base earthfile, that has some targets with FROM lines that reference earthfiles in subdirectories

      Then I have a second repo, calling the monorepos base earthfile using a git url

      When using a git url, it seems like any relative paths in the earthfile we are pointing too don't resolve. My workaround was to just introduce a $MONOREPO_DIR variable into our local stack / ci, so we can just keep using relative paths, but I can't help but wonder if this is an oversight or if I'm missing something. If this is expected behavior I think it should be noted in the reference docs