#`no such file or directory` error with `Changes()`

1 messages · Page 1 of 1 (latest)

past zephyr
#

Hi, I get a failed to get paths from diff directory: select: lstat /tmp/buildkit-mount556458409/tmp: no such file or directory error when running the following function:

func (m *Mod) Foo(ctx context.Context) *dagger.Changeset {
    ctr := dag.Container().From("alpine")

    old := ctr.Directory("/tmp")
    ctr = ctr.WithExec([]string{"ls"})
    new := ctr.Directory("/tmp")

    return new.Changes(old)
}

It works as expected if I do any of the following:

  • Comment out the WithExec() line,
  • Replace ls with sh -c 'echo foo > /tmp/bar',
  • Replace Changes() with Diff().

I am running Dagger v0.18.19 and calling the function with dagger call foo.

Not sure if it's a bug of if I'm missing something. Any idea?

little moth
#

Hey @past zephyr. I'm taking a closer look. I'm not super familiar with the changes API but at a first glance you don't seem to be doing anything wrong in that snippet

#

Replace Changes() with Diff().
When I make this change I still get the same error if you evaluate the Directory that is being returned

func (m *Testing) Bar(ctx context.Context) *dagger.Directory {
    ctr := dag.Container().From("alpine")

    old := ctr.Directory("/tmp")
    n := ctr.WithExec([]string{"ls"}).Directory("/tmp")

    return n.Diff(old)
}
little moth