status
stringclasses
1 value
repo_name
stringclasses
31 values
repo_url
stringclasses
31 values
issue_id
int64
1
104k
title
stringlengths
4
233
body
stringlengths
0
186k
βŒ€
issue_url
stringlengths
38
56
pull_url
stringlengths
37
54
before_fix_sha
stringlengths
40
40
after_fix_sha
stringlengths
40
40
report_datetime
unknown
language
stringclasses
5 values
commit_datetime
unknown
updated_file
stringlengths
7
188
chunk_content
stringlengths
1
1.03M
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
`, }, { sdk: "python", source: `from dagger import dag, field, function, object_type @object_type class Test: alpine_version: str = field() @classmethod async def create(cls) -> "Test": return cls(alpine_version=await ( dag.container() .from_("alpine:3.18.4") .file("/etc/alpine-release") .contents() )) `, }, { sdk: "typescript", source: ` import { dag, object, field } from "@dagger.io/dagger" @object() class Test { @field() alpineVersion: string // NOTE: this is not standard to do async operations in the constructor. // This is only for testing purpose but it shouldn't be done in real usage. constructor() { return (async () => {
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
this.alpineVersion = await dag.container().from("alpine:3.18.4").file("/etc/alpine-release").contents() return this; // Return the newly-created instance })(); } } `, }, } { tc := tc t.Run(tc.sdk, func(t *testing.T) { t.Parallel() c, ctx := connect(t) ctr := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work/test"). With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)). With(sdkSource(tc.sdk, tc.source)) out, err := ctr.With(daggerCall("alpine-version")).Stdout(ctx) require.NoError(t, err) require.Equal(t, strings.TrimSpace(out), "3.18.4") }) } }) t.Run("return error", func(t *testing.T) { t.Parallel() for _, tc := range []testCase{ { sdk: "go", source: `package main import (
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
"fmt" ) func New() (*Test, error) { return nil, fmt.Errorf("too bad") } type Test struct { Foo string } `, }, { sdk: "python", source: `from dagger import object_type, field @object_type class Test: foo: str = field() def __init__(self): raise ValueError("too bad") `, }, { sdk: "typescript", source: ` import { object, field } from "@dagger.io/dagger" @object() class Test { @field() foo: string constructor() { throw new Error("too bad")
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
} } `, }, } { tc := tc t.Run(tc.sdk, func(t *testing.T) { t.Parallel() var logs safeBuffer c, ctx := connect(t, dagger.WithLogOutput(&logs)) ctr := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work/test"). With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)). With(sdkSource(tc.sdk, tc.source)) _, err := ctr.With(daggerCall("foo")).Stdout(ctx) require.Error(t, err) require.NoError(t, c.Close()) t.Log(logs.String()) require.Contains(t, logs.String(), "too bad") }) } }) t.Run("python: with default factory", func(t *testing.T) { t.Parallel() c, ctx := connect(t) content := identity.NewID() ctr := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work/test").
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
With(daggerExec("init", "--name=test", "--sdk=python")). With(sdkSource("python", fmt.Sprintf(`import dagger from dagger import dag, object_type, field @object_type class Test: foo: dagger.File = field(default=lambda: ( dag.directory() .with_new_file("foo.txt", contents="%s") .file("foo.txt") )) bar: list[str] = field(default=list) `, content), )) out, err := ctr.With(daggerCall("foo", "contents")).Stdout(ctx) require.NoError(t, err) require.Equal(t, content, strings.TrimSpace(out)) out, err = ctr.With(daggerCall("--foo=dagger.json", "foo", "contents")).Stdout(ctx) require.NoError(t, err) require.Contains(t, out, `"sdk": "python"`) _, err = ctr.With(daggerCall("bar")).Sync(ctx) require.NoError(t, err) }) t.Run("typescript: with default factory", func(t *testing.T) { t.Parallel() c, ctx := connect(t) content := identity.NewID() ctr := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work/test"). With(daggerExec("init", "--name=test", "--sdk=typescript")).
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
With(sdkSource("typescript", fmt.Sprintf(` import { dag, File, object, field } from "@dagger.io/dagger" @object() class Test { @field() foo: File = dag.directory().withNewFile("foo.txt", "%s").file("foo.txt") @field() bar: string[] = [] // Allow foo to be set through the constructor constructor(foo?: File) { if (foo) { this.foo = foo } } } `, content), )) out, err := ctr.With(daggerCall("foo", "contents")).Stdout(ctx) require.NoError(t, err) require.Equal(t, content, strings.TrimSpace(out)) out, err = ctr.With(daggerCall("--foo=dagger.json", "foo", "contents")).Stdout(ctx) require.NoError(t, err) require.Contains(t, out, `"sdk": "typescript"`) _, err = ctr.With(daggerCall("bar")).Sync(ctx) require.NoError(t, err) }) } func TestModuleWrapping(t *testing.T) { t.Parallel() type testCase struct {
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
sdk string source string } for _, tc := range []testCase{ { sdk: "go", source: `package main type Wrapper struct{} func (m *Wrapper) Container() *WrappedContainer { return &WrappedContainer{ dag.Container().From("` + alpineImage + `"), } } type WrappedContainer struct { Unwrap *Container` + "`" + `json:"unwrap"` + "`" + ` } func (c *WrappedContainer) Echo(msg string) *WrappedContainer { return &WrappedContainer{ c.Unwrap.WithExec([]string{"echo", "-n", msg}), } } `, }, { sdk: "python", source: `from typing import Self import dagger from dagger import dag, field, function, object_type
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
@object_type class WrappedContainer: unwrap: dagger.Container = field() @function def echo(self, msg: str) -> Self: return WrappedContainer(unwrap=self.unwrap.with_exec(["echo", "-n", msg])) @object_type class Wrapper: @function def container(self) -> WrappedContainer: return WrappedContainer(unwrap=dag.container().from_("` + alpineImage + `")) `, }, { sdk: "typescript", source: ` import { dag, Container, object, func, field } from "@dagger.io/dagger" @object() class WrappedContainer { @field() unwrap: Container constructor(unwrap: Container) { this.unwrap = unwrap } @func() echo(msg: string): WrappedContainer { return new WrappedContainer(this.unwrap.withExec(["echo", "-n", msg])) } } @object()
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
class Wrapper { @func() container(): WrappedContainer { return new WrappedContainer(dag.container().from("` + alpineImage + `")) } } `, }, } { tc := tc t.Run(tc.sdk, func(t *testing.T) { t.Parallel() c, ctx := connect(t) modGen := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). With(daggerExec("init", "--name=wrapper", "--sdk="+tc.sdk)). With(sdkSource(tc.sdk, tc.source)) id := identity.NewID() out, err := modGen.With(daggerQuery( fmt.Sprintf(`{wrapper{container{echo(msg:%q){unwrap{stdout}}}}}`, id), )).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, fmt.Sprintf(`{"wrapper":{"container":{"echo":{"unwrap":{"stdout":%q}}}}}`, id), out) }) } } func TestModuleLotsOfFunctions(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
t.Parallel() const funcCount = 100 t.Run("go sdk", func(t *testing.T) { t.Parallel() c, ctx := connect(t) mainSrc := ` package main type PotatoSack struct {} ` for i := 0; i < funcCount; i++ { mainSrc += fmt.Sprintf(` func (m *PotatoSack) Potato%d() string { return "potato #%d" } `, i, i) } modGen := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{ Contents: mainSrc, }). With(daggerExec("init", "--source=.", "--name=potatoSack", "--sdk=go")) var eg errgroup.Group for i := 0; i < funcCount; i++ { i := i
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
if i%10 != 0 { continue } eg.Go(func() error { _, err := modGen. With(daggerCall(fmt.Sprintf("potato%d", i))). Sync(ctx) return err }) } require.NoError(t, eg.Wait()) }) t.Run("python sdk", func(t *testing.T) { t.Parallel() c, ctx := connect(t) mainSrc := `from dagger import function ` for i := 0; i < funcCount; i++ { mainSrc += fmt.Sprintf(` @function def potato_%d() -> str: return "potato #%d" `, i, i) } modGen := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). WithNewFile("./src/main.py", dagger.ContainerWithNewFileOpts{ Contents: mainSrc,
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
}). With(daggerExec("init", "--source=.", "--name=potatoSack", "--sdk=python")) var eg errgroup.Group for i := 0; i < funcCount; i++ { i := i if i%10 != 0 { continue } eg.Go(func() error { _, err := modGen. With(daggerCall(fmt.Sprintf("potato%d", i))). Sync(ctx) return err }) } require.NoError(t, eg.Wait()) }) t.Run("typescript sdk", func(t *testing.T) { t.Parallel() c, ctx := connect(t) mainSrc := ` import { object, func } from "@dagger.io/dagger" @object() class PotatoSack { ` for i := 0; i < funcCount; i++ { mainSrc += fmt.Sprintf(` @func() potato_%d(): string {
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
return "potato #%d" } `, i, i) } mainSrc += "\n}" modGen := c. Container(). From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). With(sdkSource("typescript", mainSrc)). With(daggerExec("init", "--name=potatoSack", "--sdk=typescript")) var eg errgroup.Group for i := 0; i < funcCount; i++ { i := i if i%10 != 0 { continue } eg.Go(func() error { _, err := modGen. With(daggerCall(fmt.Sprintf("potato%d", i))). Sync(ctx) return err }) } require.NoError(t, eg.Wait()) }) } func TestModuleLotsOfDeps(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
t.Parallel() c, ctx := connect(t) modGen := goGitBase(t, c). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work") modCount := 0 getModMainSrc := func(name string, depNames []string) string { t.Helper() mainSrc := fmt.Sprintf(`package main import "context" type %s struct {} func (m *%s) Fn(ctx context.Context) (string, error) { s := "%s" var depS string _ = depS var err error _ = err `, strcase.ToCamel(name), strcase.ToCamel(name), name)
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
for _, depName := range depNames { mainSrc += fmt.Sprintf(` depS, err = dag.%s().Fn(ctx) if err != nil { return "", err } s += depS `, strcase.ToCamel(depName)) } mainSrc += "return s, nil\n}\n" fmted, err := format.Source([]byte(mainSrc)) require.NoError(t, err) return string(fmted) } var rootCfg modules.ModuleConfig addModulesWithDeps := func(newMods int, depNames []string) []string { t.Helper() var newModNames []string for i := 0; i < newMods; i++ { name := fmt.Sprintf("mod%d", modCount) modCount++ newModNames = append(newModNames, name) modGen = modGen. WithWorkdir("/work/"+name). WithNewFile("./main.go", dagger.ContainerWithNewFileOpts{ Contents: getModMainSrc(name, depNames), }) var depCfgs []*modules.ModuleConfigDependency
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
for _, depName := range depNames { depCfgs = append(depCfgs, &modules.ModuleConfigDependency{ Name: depName, Source: filepath.Join("..", depName), }) } modGen = modGen.With(configFile(".", &modules.ModuleConfig{ Name: name, SDK: "go", Dependencies: depCfgs, })) } return newModNames } curDeps := addModulesWithDeps(1, nil) for i := 0; i < 6; i++ { curDeps = addModulesWithDeps(len(curDeps)+1, curDeps) } addModulesWithDeps(1, curDeps) modGen = modGen.With(configFile("..", &rootCfg)) _, err := modGen.With(daggerCall("fn")).Sync(ctx) require.NoError(t, err) } func TestModuleNamespacing(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
t.Parallel() c, ctx := connect(t) moduleSrcPath, err := filepath.Abs("./testdata/modules/go/namespacing") require.NoError(t, err) ctr := c.Container().From(alpineImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithMountedDirectory("/work", c.Host().Directory(moduleSrcPath)). WithWorkdir("/work") out, err := ctr. With(daggerQuery(`{test{fn(s:"yo")}}`)). Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"test":{"fn":["*dagger.Sub1Obj made 1:yo", "*dagger.Sub2Obj made 2:yo"]}}`, out) } func TestModuleLoops(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
t.Parallel() c, ctx := connect(t) _, err := goGitBase(t, c). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). With(daggerExec("init", "--name=depA", "--sdk=go", "depA")). With(daggerExec("init", "--name=depB", "--sdk=go", "depB")). With(daggerExec("init", "--name=depC", "--sdk=go", "depC")). With(daggerExec("install", "-m=depC", "./depB")). With(daggerExec("install", "-m=depB", "./depA")). With(daggerExec("install", "-m=depA", "./depC")). Sync(ctx) require.ErrorContains(t, err, `local module at "/work/depA" has a circular dependency`) } var badIDArgGoSrc string var badIDArgPySrc string var badIDArgTSSrc string var badIDFieldGoSrc string var badIDFieldTSSrc string var badIDFnGoSrc string var badIDFnPySrc string var badIDFnTSSrc string func TestModuleReservedWords(t *testing.T) { t.Parallel() type testCase struct { sdk string source string }
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
t.Run("id", func(t *testing.T) { t.Parallel() t.Run("arg", func(t *testing.T) { t.Parallel() for _, tc := range []testCase{ { sdk: "go", source: badIDArgGoSrc, }, { sdk: "python", source: badIDArgPySrc, }, { sdk: "typescript", source: badIDArgTSSrc, }, } { tc := tc t.Run(tc.sdk, func(t *testing.T) { t.Parallel() c, ctx := connect(t) _, err := modInit(ctx, t, c, tc.sdk, tc.source). With(daggerQuery(`{test{fn(id:"no")}}`)). Sync(ctx) require.ErrorContains(t, err, "cannot define argument with reserved name \"id\"") }) } }) t.Run("field", func(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
t.Parallel() for _, tc := range []testCase{ { sdk: "go", source: badIDFieldGoSrc, }, { sdk: "typescript", source: badIDFieldTSSrc, }, } { tc := tc t.Run(tc.sdk, func(t *testing.T) { t.Parallel() c, ctx := connect(t) _, err := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)). With(sdkSource(tc.sdk, tc.source)). With(daggerQuery(`{test{fn{id}}}`)). Sync(ctx) require.ErrorContains(t, err, "cannot define field with reserved name \"id\"") }) } }) t.Run("fn", func(t *testing.T) { t.Parallel() for _, tc := range []testCase{ {
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
sdk: "go", source: badIDFnGoSrc, }, { sdk: "python", source: badIDFnPySrc, }, { sdk: "typescript", source: badIDFnTSSrc, }, } { tc := tc t.Run(tc.sdk, func(t *testing.T) { t.Parallel() c, ctx := connect(t) _, err := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). With(daggerExec("init", "--name=test", "--sdk="+tc.sdk)). With(sdkSource(tc.sdk, tc.source)). With(daggerQuery(`{test{id}}`)). Sync(ctx) require.ErrorContains(t, err, "cannot define function with reserved name \"id\"") }) } }) }) } func TestModuleExecError(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
t.Parallel() c, ctx := connect(t) modGen := c.Container().From(alpineImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). With(daggerExec("init", "--source=.", "--name=playground", "--sdk=go")). WithNewFile("main.go", dagger.ContainerWithNewFileOpts{ Contents: ` package main import ( "context" "errors" ) type Playground struct{} func (p *Playground) DoThing(ctx context.Context) error { _, err := dag.Container().From("` + alpineImage + `").WithExec([]string{"sh", "-c", "exit 5"}).Sync(ctx) var e *ExecError if errors.As(err, &e) { if e.ExitCode == 5 { return nil } } panic("yikes") } `}) _, err := modGen. With(daggerQuery(`{playground{doThing}}`)). Stdout(ctx) require.NoError(t, err)
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
} func TestModuleCurrentModuleAPI(t *testing.T) { t.Parallel() t.Run("name", func(t *testing.T) { t.Parallel() c, ctx := connect(t) out, err := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). With(daggerExec("init", "--source=.", "--name=WaCkY", "--sdk=go")). WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{ Contents: `package main import "context" type WaCkY struct {} func (m *WaCkY) Fn(ctx context.Context) (string, error) { return dag.CurrentModule().Name(ctx) } `, }). With(daggerCall("fn")). Stdout(ctx) require.NoError(t, err) require.Equal(t, "WaCkY", strings.TrimSpace(out)) }) t.Run("source", func(t *testing.T) { t.Parallel() c, ctx := connect(t) out, err := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work").
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")). WithNewFile("/work/subdir/coolfile.txt", dagger.ContainerWithNewFileOpts{ Contents: "nice", }). WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{ Contents: `package main import "context" type Test struct {} func (m *Test) Fn(ctx context.Context) *File { return dag.CurrentModule().Source().File("subdir/coolfile.txt") } `, }). With(daggerCall("fn", "contents")). Stdout(ctx) require.NoError(t, err) require.Equal(t, "nice", strings.TrimSpace(out)) }) t.Run("workdir", func(t *testing.T) { t.Parallel() t.Run("dir", func(t *testing.T) { t.Parallel() c, ctx := connect(t) out, err := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")). WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{ Contents: `package main import (
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
"context" "os" ) type Test struct {} func (m *Test) Fn(ctx context.Context) (*Directory, error) { if err := os.MkdirAll("subdir/moresubdir", 0755); err != nil { return nil, err } if err := os.WriteFile("subdir/moresubdir/coolfile.txt", []byte("nice"), 0644); err != nil { return nil, err } return dag.CurrentModule().Workdir("subdir/moresubdir"), nil } `, }). With(daggerCall("fn", "file", "--path=coolfile.txt", "contents")). Stdout(ctx) require.NoError(t, err) require.Equal(t, "nice", strings.TrimSpace(out)) }) t.Run("file", func(t *testing.T) { t.Parallel() c, ctx := connect(t) out, err := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")). WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{ Contents: `package main import (
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
"context" "os" ) type Test struct {} func (m *Test) Fn(ctx context.Context) (*File, error) { if err := os.MkdirAll("subdir/moresubdir", 0755); err != nil { return nil, err } if err := os.WriteFile("subdir/moresubdir/coolfile.txt", []byte("nice"), 0644); err != nil { return nil, err } return dag.CurrentModule().WorkdirFile("subdir/moresubdir/coolfile.txt"), nil } `, }). With(daggerCall("fn", "contents")). Stdout(ctx) require.NoError(t, err) require.Equal(t, "nice", strings.TrimSpace(out)) }) t.Run("error on escape", func(t *testing.T) { t.Parallel() c, ctx := connect(t) ctr := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")). WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{ Contents: `package main import (
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
"context" "os" ) func New() (*Test, error) { if err := os.WriteFile("/rootfile.txt", []byte("notnice"), 0644); err != nil { return nil, err } if err := os.MkdirAll("/foo", 0755); err != nil { return nil, err } if err := os.WriteFile("/foo/foofile.txt", []byte("notnice"), 0644); err != nil { return nil, err } return &Test{}, nil } type Test struct {} func (m *Test) EscapeFile(ctx context.Context) *File { return dag.CurrentModule().WorkdirFile("../rootfile.txt") } func (m *Test) EscapeFileAbs(ctx context.Context) *File { return dag.CurrentModule().WorkdirFile("/rootfile.txt") } func (m *Test) EscapeDir(ctx context.Context) *Directory { return dag.CurrentModule().Workdir("../foo") } func (m *Test) EscapeDirAbs(ctx context.Context) *Directory { return dag.CurrentModule().Workdir("/foo") } `, })
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
_, err := ctr. With(daggerCall("escape-file", "contents")). Stdout(ctx) require.ErrorContains(t, err, `workdir path "../rootfile.txt" escapes workdir`) _, err = ctr. With(daggerCall("escape-file-abs", "contents")). Stdout(ctx) require.ErrorContains(t, err, `workdir path "/rootfile.txt" escapes workdir`) _, err = ctr. With(daggerCall("escape-dir", "entries")). Stdout(ctx) require.ErrorContains(t, err, `workdir path "../foo" escapes workdir`) _, err = ctr. With(daggerCall("escape-dir-abs", "entries")). Stdout(ctx) require.ErrorContains(t, err, `workdir path "/foo" escapes workdir`) }) }) } func TestModuleCustomSDK(t *testing.T) { t.Parallel() t.Run("local", func(t *testing.T) { t.Parallel() c, ctx := connect(t) ctr := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work/coolsdk"). With(daggerExec("init", "--source=.", "--name=cool-sdk", "--sdk=go")). WithNewFile("main.go", dagger.ContainerWithNewFileOpts{ Contents: `package main
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
type CoolSdk struct {} func (m *CoolSdk) ModuleRuntime(modSource *ModuleSource, introspectionJson string) *Container { return modSource.WithSDK("go").AsModule().Runtime().WithEnvVariable("COOL", "true") } func (m *CoolSdk) Codegen(modSource *ModuleSource, introspectionJson string) *GeneratedCode { return dag.GeneratedCode(modSource.WithSDK("go").AsModule().GeneratedContextDirectory()) } func (m *CoolSdk) RequiredPaths() []string { return []string{ "**/go.mod", "**/go.sum", "**/go.work", "**/go.work.sum", "**/vendor/", "**/*.go", } } `, }). WithWorkdir("/work"). With(daggerExec("init", "--source=.", "--name=test", "--sdk=coolsdk")). WithNewFile("main.go", dagger.ContainerWithNewFileOpts{ Contents: `package main import "os" type Test struct {} func (m *Test) Fn() string { return os.Getenv("COOL") } `, })
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
out, err := ctr. With(daggerCall("fn")). Stdout(ctx) require.NoError(t, err) require.Equal(t, "true", strings.TrimSpace(out)) }) t.Run("git", func(t *testing.T) { t.Parallel() c, ctx := connect(t) ctr := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). With(daggerExec("init", "--source=.", "--name=test", "--sdk="+testGitModuleRef("cool-sdk"))). WithNewFile("main.go", dagger.ContainerWithNewFileOpts{ Contents: `package main import "os" type Test struct {} func (m *Test) Fn() string { return os.Getenv("COOL") } `, }) out, err := ctr. With(daggerCall("fn")). Stdout(ctx) require.NoError(t, err) require.Equal(t, "true", strings.TrimSpace(out)) }) } func TestModuleHostError(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
t.Parallel() c, ctx := connect(t) _, err := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). With(daggerExec("init", "--source=.", "--name=test", "--sdk=go")). WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{ Contents: `package main import ( "context" ) type Test struct {} func (m *Test) Fn(ctx context.Context) *Directory { return dag.Host().Directory(".") } `, }). With(daggerCall("fn")). Sync(ctx) require.ErrorContains(t, err, "dag.Host undefined") } func daggerExec(args ...string) dagger.WithContainerFunc {
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
return func(c *dagger.Container) *dagger.Container { return c.WithExec(append([]string{"dagger", "--debug"}, args...), dagger.ContainerWithExecOpts{ ExperimentalPrivilegedNesting: true, }) } } func daggerQuery(query string, args ...any) dagger.WithContainerFunc { return daggerQueryAt("", query, args...) } func daggerQueryAt(modPath string, query string, args ...any) dagger.WithContainerFunc { query = fmt.Sprintf(query, args...) return func(c *dagger.Container) *dagger.Container { execArgs := []string{"dagger", "--debug", "query"} if modPath != "" { execArgs = append(execArgs, "-m", modPath) } return c.WithExec(execArgs, dagger.ContainerWithExecOpts{ Stdin: query, ExperimentalPrivilegedNesting: true, }) } } func daggerCall(args ...string) dagger.WithContainerFunc { return daggerCallAt("", args...) } func daggerCallAt(modPath string, args ...string) dagger.WithContainerFunc {
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
return func(c *dagger.Container) *dagger.Container { execArgs := []string{"dagger", "--debug", "call"} if modPath != "" { execArgs = append(execArgs, "-m", modPath) } return c.WithExec(append(execArgs, args...), dagger.ContainerWithExecOpts{ ExperimentalPrivilegedNesting: true, }) } } func daggerFunctions(args ...string) dagger.WithContainerFunc { return func(c *dagger.Container) *dagger.Container { return c.WithExec(append([]string{"dagger", "--debug", "functions"}, args...), dagger.ContainerWithExecOpts{ ExperimentalPrivilegedNesting: true, }) } } func configFile(dirPath string, cfg *modules.ModuleConfig) dagger.WithContainerFunc { return func(c *dagger.Container) *dagger.Container { cfgPath := filepath.Join(dirPath, "dagger.json") cfgBytes, err := json.Marshal(cfg) if err != nil { panic(err) } return c.WithNewFile(cfgPath, dagger.ContainerWithNewFileOpts{ Contents: string(cfgBytes), }) } } func hostDaggerCommand(ctx context.Context, t testing.TB, workdir string, args ...string) *exec.Cmd {
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
t.Helper() cmd := exec.CommandContext(ctx, daggerCliPath(t), args...) cmd.Dir = workdir return cmd } func hostDaggerExec(ctx context.Context, t testing.TB, workdir string, args ...string) ([]byte, error) { t.Helper() cmd := hostDaggerCommand(ctx, t, workdir, args...) output, err := cmd.CombinedOutput() if err != nil { err = fmt.Errorf("%s: %w", string(output), err) } return output, err } func sdkSource(sdk, contents string) dagger.WithContainerFunc { return func(c *dagger.Container) *dagger.Container { sourcePath := sdkSourceFile(sdk) if sourcePath == "" { return c } return c.WithNewFile(sourcePath, dagger.ContainerWithNewFileOpts{ Contents: heredoc.Doc(contents), }) } } func sdkSourceFile(sdk string) string {
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
switch sdk { case "go": return "dagger/main.go" case "python": return "dagger/src/main.py" case "typescript": return "dagger/src/index.ts" default: return "" } } func sdkCodegenFile(t *testing.T, sdk string) string { t.Helper() switch sdk { case "go": return "dagger/internal/dagger/dagger.gen.go" case "python": return "dagger/sdk/src/dagger/client/gen.py" case "typescript": return "dagger/sdk/api/client.gen.ts" default: return "" } } func modInit(ctx context.Context, t *testing.T, c *dagger.Client, sdk, contents string) *dagger.Container {
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
t.Helper() modGen := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). With(daggerExec("init", "--name=test", "--sdk="+sdk)). With(sdkSource(sdk, contents)) return modGen } func currentSchema(ctx context.Context, t *testing.T, ctr *dagger.Container) *introspection.Schema { t.Helper() out, err := ctr.With(daggerQuery(introspection.Query)).Stdout(ctx) require.NoError(t, err) var schemaResp introspection.Response err = json.Unmarshal([]byte(out), &schemaResp) require.NoError(t, err) return schemaResp.Schema } var moduleIntrospection = daggerQuery(` query { host { directory(path: ".") { asModule { initialize { description
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
objects { asObject { name description constructor { description args { name description defaultValue } } functions { name description args { name description defaultValue } } fields { name description } } } } } } } } `) func inspectModule(ctx context.Context, t *testing.T, ctr *dagger.Container) gjson.Result {
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
t.Helper() out, err := ctr.With(moduleIntrospection).Stdout(ctx) require.NoError(t, err) result := gjson.Get(out, "host.directory.asModule.initialize") t.Logf("module introspection:\n%v", result.Raw) return result } func inspectModuleObjects(ctx context.Context, t *testing.T, ctr *dagger.Container) gjson.Result { t.Helper() return inspectModule(ctx, t, ctr).Get("objects.#.asObject") } func goGitBase(t *testing.T, c *dagger.Client) *dagger.Container { t.Helper() return c.Container().From(golangImage). WithExec([]string{"apk", "add", "git"}). WithExec([]string{"git", "config", "--global", "user.email", "[email protected]"}). WithExec([]string{"git", "config", "--global", "user.name", "Dagger Tests"}). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). WithExec([]string{"git", "init"}) } func logGen(ctx context.Context, t *testing.T, modSrc *dagger.Directory) {
closed
dagger/dagger
https://github.com/dagger/dagger
6,662
Using embedded fields with go modules fails with unhelpful error
Take the following code: ```go type Playground struct { // This breaks *Directory // This doesn't // Directory *Directory } func New() Playground { return Playground{Directory: dag.Directory()} } ``` When attempting to evaluate anything on the `Playground` object, we get the following error: ``` Error: response from query: input: resolve: playground: failed to convert return value: unexpected result value type string for object "Playground" ```
https://github.com/dagger/dagger/issues/6662
https://github.com/dagger/dagger/pull/6715
2f975ef29ad78e08c5b9328f6db3797b4c57da69
b966257dbc24b714e6ee39f01158f10f8fa24fd3
"2024-02-13T15:54:25Z"
go
"2024-02-26T15:11:43Z"
core/integration/module_test.go
t.Helper() generated, err := modSrc.File("dagger.gen.go").Contents(ctx) require.NoError(t, err) t.Cleanup(func() { t.Name() fileName := filepath.Join( os.TempDir(), t.Name(), fmt.Sprintf("dagger.gen.%d.go", time.Now().Unix()), ) if err := os.MkdirAll(filepath.Dir(fileName), 0o755); err != nil { t.Logf("failed to create temp dir for generated code: %v", err) return } if err := os.WriteFile(fileName, []byte(generated), 0644); err != nil { t.Logf("failed to write generated code to %s: %v", fileName, err) } else { t.Logf("wrote generated code to %s", fileName) } }) }
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
package main import ( "context" "encoding/json" "fmt" "net/http" "net/url" "os" "path" "path/filepath" "strings" "dagger.io/dagger" "github.com/dagger/dagger/analytics" "github.com/dagger/dagger/core/modules" "github.com/dagger/dagger/dagql/idtui" "github.com/dagger/dagger/engine/client" "github.com/go-git/go-git/v5" "github.com/iancoleman/strcase" "github.com/juju/ansiterm/tabwriter" "github.com/moby/buildkit/util/gitutil" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/vito/progrock" ) var ( moduleGroup = &cobra.Group{ ID: "module", Title: "Dagger Module Commands (Experimental)", } moduleURL string
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
moduleFlags = pflag.NewFlagSet("module", pflag.ContinueOnError) sdk string licenseID string moduleName string moduleSourcePath string installName string developSDK string developSourcePath string force bool ) const ( moduleURLDefault = "." defaultModuleSourceDirName = "dagger" ) func init() { moduleFlags.StringVarP(&moduleURL, "mod", "m", "", "Path to dagger.json config file for the module or a directory containing that file. Either local path (e.g. \"/path/to/some/dir\") or a github repo (e.g. \"github.com/dagger/dagger/path/to/some/subdir\")") moduleFlags.BoolVar(&focus, "focus", true, "Only show output for focused commands") listenCmd.PersistentFlags().AddFlagSet(moduleFlags) queryCmd.PersistentFlags().AddFlagSet(moduleFlags) funcCmds.AddFlagSet(moduleFlags) moduleInitCmd.Flags().StringVar(&sdk, "sdk", "", "Optionally initialize module for development in the given SDK") moduleInitCmd.Flags().StringVar(&moduleName, "name", "", "Name of the new module (defaults to parent directory name)") moduleInitCmd.Flags().StringVar(&moduleSourcePath, "source", "", "Directory to store the module implementation source code in (defaults to \"dagger/ if \"--sdk\" is provided)") moduleInitCmd.Flags().StringVar(&licenseID, "license", "", "License identifier to generate - see https:spdx.org/licenses/") modulePublishCmd.Flags().BoolVarP(&force, "force", "f", false, "Force publish even if the git repository is not clean") modulePublishCmd.Flags().AddFlagSet(moduleFlags) moduleInstallCmd.Flags().StringVarP(&installName, "name", "n", "", "Name to use for the dependency in the module. Defaults to the name of the module being installed.") moduleInstallCmd.Flags().AddFlagSet(moduleFlags) moduleDevelopCmd.Flags().StringVar(&developSDK, "sdk", "", "New SDK for the module") moduleDevelopCmd.Flags().StringVar(&developSourcePath, "source", "", "Directory to store the module implementation source code in")
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
moduleDevelopCmd.PersistentFlags().AddFlagSet(moduleFlags) configCmd.PersistentFlags().AddFlagSet(moduleFlags) configCmd.AddCommand(oldInitCmd, oldInstallCmd, oldSyncCmd) configCmd.AddGroup(moduleGroup) } var oldInitCmd = &cobra.Command{ Use: "init", Short: "Initialize a new Dagger module", Hidden: true, SilenceUsage: true, DisableFlagParsing: true, Args: func(cmd *cobra.Command, args []string) error { return fmt.Errorf(`"dagger mod init" has been replaced by "dagger init"`) }, Run: func(cmd *cobra.Command, args []string) { }, } var oldInstallCmd = &cobra.Command{ Use: "install", Short: "Add a new dependency to a Dagger module", Hidden: true, SilenceUsage: true, DisableFlagParsing: true, GroupID: moduleGroup.ID, Annotations: map[string]string{ "experimental": "true", }, Args: func(cmd *cobra.Command, args []string) error { return fmt.Errorf(`"dagger mod install" has been replaced by "dagger install"`)
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
}, Run: func(cmd *cobra.Command, args []string) { }, } var oldSyncCmd = &cobra.Command{ Use: "sync", Short: "Setup or update all the resources needed to develop on a module locally", Hidden: true, SilenceUsage: true, GroupID: moduleGroup.ID, Annotations: map[string]string{ "experimental": "true", }, DisableFlagParsing: true, Args: func(cmd *cobra.Command, args []string) error { return fmt.Errorf(`"dagger mod sync" has been replaced by "dagger develop"`) }, Run: func(cmd *cobra.Command, args []string) { }, } var configCmd = &cobra.Command{ Use: "config", Aliases: []string{"mod"}, Short: "Get or set the configuration of a Dagger module", Long: "Get or set the configuration of a Dagger module. By default, print the configuration of the specified module.", Example: strings.TrimSpace(` dagger config -m /path/to/some/dir dagger config -m github.com/dagger/hello-dagger
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
`, ), GroupID: moduleGroup.ID, Annotations: map[string]string{ "experimental": "true", }, RunE: func(cmd *cobra.Command, args []string) error { ctx := cmd.Context() return withEngineAndTUI(ctx, client.Params{}, func(ctx context.Context, engineClient *client.Client) (err error) { cmd.SetContext(ctx) vtx := progrock.FromContext(ctx).Vertex(idtui.PrimaryVertex, cmd.CommandPath()) defer func() { vtx.Done(err) }() setCmdOutput(cmd, vtx) modConf, err := getDefaultModuleConfiguration(ctx, engineClient.Dagger(), true) if err != nil { return fmt.Errorf("failed to load module: %w", err) } if !modConf.FullyInitialized() { return fmt.Errorf("module must be fully initialized") } mod := modConf.Source.AsModule() name, err := mod.Name(ctx) if err != nil { return fmt.Errorf("failed to get module name: %w", err) } sdk, err := mod.SDK(ctx) if err != nil { return fmt.Errorf("failed to get module SDK: %w", err) } tw := tabwriter.NewWriter(cmd.OutOrStdout(), 0, 0, 3, ' ', tabwriter.DiscardEmptyColumns)
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
fmt.Fprintf(tw, "%s\t%s\n", "Name:", name, ) fmt.Fprintf(tw, "%s\t%s\n", "SDK:", sdk, ) fmt.Fprintf(tw, "%s\t%s\n", "Root Directory:", modConf.LocalContextPath, ) fmt.Fprintf(tw, "%s\t%s\n", "Source Directory:", modConf.LocalRootSourcePath, ) return tw.Flush() }) }, } var moduleInitCmd = &cobra.Command{ Use: "init [flags] [PATH]", Short: "Initialize a new Dagger module", Long: `Initialize a new Dagger module in a local directory. By default, create a new dagger.json configuration in the current working directory. If the positional argument PATH is provided, create the module in that directory instead. The configuration will default the name of the module to the parent directory name, unless specified with --name. Any module can be installed to via "dagger install". A module can only be called once it has been initialized with an SDK though. The "--sdk" flag can be provided to init here, but if it's not the configuration can be updated later via "dagger develop". The "--source" flag allows controlling the directory in which the actual module source code is stored. By default, it will be stored in a directory named "dagger". `,
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
Example: "dagger init --name=hello --sdk=python --source=some/subdir", GroupID: moduleGroup.ID, Annotations: map[string]string{ "experimental": "true", }, Args: cobra.MaximumNArgs(1), RunE: func(cmd *cobra.Command, extraArgs []string) (rerr error) { ctx := cmd.Context() return withEngineAndTUI(ctx, client.Params{}, func(ctx context.Context, engineClient *client.Client) (err error) { dag := engineClient.Dagger() vtx := progrock.FromContext(ctx).Vertex(idtui.PrimaryVertex, cmd.CommandPath()) defer func() { vtx.Done(err) }() setCmdOutput(cmd, vtx) cwd, err := os.Getwd() if err != nil { return fmt.Errorf("failed to get current working directory: %w", err) } srcRootPath := cwd if len(extraArgs) > 0 { srcRootPath = extraArgs[0] } if filepath.IsAbs(srcRootPath) { srcRootPath, err = filepath.Rel(cwd, srcRootPath) if err != nil { return fmt.Errorf("failed to get relative path: %w", err) } } modConf, err := getModuleConfigurationForSourceRef(ctx, dag, srcRootPath, false) if err != nil {
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
return fmt.Errorf("failed to get configured module: %w", err) } if modConf.SourceKind != dagger.LocalSource { return fmt.Errorf("module must be local") } if modConf.ModuleSourceConfigExists { return fmt.Errorf("module already exists") } if moduleName == "" { moduleName = filepath.Base(modConf.LocalRootSourcePath) } if sdk != "" { if moduleSourcePath == "" { moduleSourcePath = filepath.Join(modConf.LocalRootSourcePath, defaultModuleSourceDirName) } sourceAbsPath, err := filepath.Abs(moduleSourcePath) if err != nil { return fmt.Errorf("failed to get absolute source path for %s: %w", moduleSourcePath, err) } moduleSourcePath, err = filepath.Rel(modConf.LocalRootSourcePath, sourceAbsPath) if err != nil { return fmt.Errorf("failed to get relative source path: %w", err) } } _, err = modConf.Source. WithName(moduleName). WithSDK(sdk).
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
WithSourceSubpath(moduleSourcePath). ResolveFromCaller(). AsModule(). GeneratedContextDiff(). Export(ctx, modConf.LocalContextPath) if err != nil { return fmt.Errorf("failed to generate code: %w", err) } if err := findOrCreateLicense(ctx, modConf.LocalRootSourcePath); err != nil { return err } fmt.Fprintln(cmd.OutOrStdout(), "Initialized module", moduleName, "in", srcRootPath) return nil }) }, } var moduleInstallCmd = &cobra.Command{ Use: "install [flags] MODULE", Aliases: []string{"use"}, Short: "Add a new dependency to a Dagger module", Long: "Add a Dagger module as a dependency of a local module.", Example: "dagger install github.com/shykes/daggerverse/ttlsh@16e40ec244966e55e36a13cb6e1ff8023e1e1473", GroupID: moduleGroup.ID, Annotations: map[string]string{ "experimental": "true", }, Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, extraArgs []string) (rerr error) { ctx := cmd.Context()
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
return withEngineAndTUI(ctx, client.Params{}, func(ctx context.Context, engineClient *client.Client) (err error) { dag := engineClient.Dagger() modConf, err := getDefaultModuleConfiguration(ctx, dag, false) if err != nil { return fmt.Errorf("failed to get configured module: %w", err) } if modConf.SourceKind != dagger.LocalSource { return fmt.Errorf("module must be local") } if !modConf.FullyInitialized() { return fmt.Errorf("module must be fully initialized") } depRefStr := extraArgs[0] depSrc := dag.ModuleSource(depRefStr) depSrcKind, err := depSrc.Kind(ctx) if err != nil { return fmt.Errorf("failed to get module ref kind: %w", err) } if depSrcKind == dagger.LocalSource { depAbsPath, err := filepath.Abs(depRefStr) if err != nil { return fmt.Errorf("failed to get dep absolute path for %s: %w", depRefStr, err) } depRelPath, err := filepath.Rel(modConf.LocalRootSourcePath, depAbsPath) if err != nil { return fmt.Errorf("failed to get dep relative path: %w", err) } depSrc = dag.ModuleSource(depRelPath) }
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
dep := dag.ModuleDependency(depSrc, dagger.ModuleDependencyOpts{ Name: installName, }) modSrc := modConf.Source. WithDependencies([]*dagger.ModuleDependency{dep}). ResolveFromCaller() _, err = modSrc. AsModule(). GeneratedContextDiff(). Export(ctx, modConf.LocalContextPath) if err != nil { return fmt.Errorf("failed to generate code: %w", err) } depSrc = modSrc.ResolveDependency(depSrc) name, err := depSrc.ModuleName(ctx) if err != nil { return err } sdk, err := depSrc.AsModule().SDK(ctx) if err != nil { return err } depRootSubpath, err := depSrc.SourceRootSubpath(ctx) if err != nil { return err } if depSrcKind == dagger.GitSource { git := depSrc.AsGitSource() gitURL, err := git.CloneURL(ctx) if err != nil {
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
return err } gitVersion, err := git.Version(ctx) if err != nil { return err } gitCommit, err := git.Commit(ctx) if err != nil { return err } analytics.Ctx(ctx).Capture(ctx, "module_install", map[string]string{ "module_name": name, "install_name": installName, "module_sdk": sdk, "source_kind": "git", "git_symbolic": filepath.Join(gitURL, depRootSubpath), "git_clone_url": gitURL, "git_subpath": depRootSubpath, "git_version": gitVersion, "git_commit": gitCommit, }) } else if depSrcKind == dagger.LocalSource { analytics.Ctx(ctx).Capture(ctx, "module_install", map[string]string{ "module_name": name, "install_name": installName, "module_sdk": sdk, "source_kind": "local", "local_subpath": depRootSubpath, }) }
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
return nil }) }, } var moduleDevelopCmd = &cobra.Command{ Use: "develop", Short: "Setup or update all the resources needed to develop on a module locally", Long: `Setup or update all the resources needed to develop on a module locally. This command re-regerates the module's generated code based on dependencies and the current state of the module's source code. If --sdk is set, the config file and generated code will be updated with those values reflected. It currently can only be used to set the SDK of a module that does not have one already. --source allows controlling the directory in which the actual module source code is stored. By default, it will be stored in a directory named "dagger". :::note If not updating source or SDK, this is only required for IDE auto-completion/LSP purposes. ::: `, GroupID: moduleGroup.ID, Annotations: map[string]string{ "experimental": "true", }, RunE: func(cmd *cobra.Command, extraArgs []string) (rerr error) { ctx := cmd.Context() return withEngineAndTUI(ctx, client.Params{}, func(ctx context.Context, engineClient *client.Client) (err error) { dag := engineClient.Dagger() modConf, err := getDefaultModuleConfiguration(ctx, dag, false) if err != nil { return fmt.Errorf("failed to get configured module: %w", err) } if modConf.SourceKind != dagger.LocalSource { return fmt.Errorf("module must be local")
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
} src := modConf.Source modConf.Source = modConf.Source.ResolveFromCaller() modSDK, err := modConf.Source.AsModule().SDK(ctx) if err != nil { return fmt.Errorf("failed to get module SDK: %w", err) } if developSDK != "" { if modSDK != "" && modSDK != developSDK { return fmt.Errorf("cannot update module SDK that has already been set to %q", modSDK) } modSDK = developSDK src = src.WithSDK(modSDK) } modSourcePath, err := modConf.Source.SourceSubpath(ctx) if err != nil { return fmt.Errorf("failed to get module source subpath: %w", err) } if modSDK != "" && modSourcePath == "" && developSourcePath == "" { developSourcePath = filepath.Join(modConf.LocalRootSourcePath, defaultModuleSourceDirName) } if modSDK == "" && developSourcePath == "" { return fmt.Errorf("dagger develop on a module without an SDK requires either --sdk or --source") }
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
if developSourcePath != "" { sourceAbsPath, err := filepath.Abs(developSourcePath) if err != nil { return fmt.Errorf("failed to get absolute source path for %s: %w", developSourcePath, err) } developSourcePath, err = filepath.Rel(modConf.LocalRootSourcePath, sourceAbsPath) if err != nil { return fmt.Errorf("failed to get relative source path: %w", err) } if modSourcePath != "" && modSourcePath != developSourcePath { return fmt.Errorf("cannot update module source path that has already been set to %q", modSourcePath) } modSourcePath = developSourcePath src = src.WithSourceSubpath(modSourcePath) } _, err = src.ResolveFromCaller(). AsModule(). GeneratedContextDiff(). Export(ctx, modConf.LocalContextPath) if err != nil { return fmt.Errorf("failed to generate code: %w", err) } return nil }) }, } const daDaggerverse = "https:daggerverse.dev" var modulePublishCmd = &cobra.Command{ Use: "publish",
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
Hidden: true, Short: "Publish a Dagger module to the Daggerverse", Long: fmt.Sprintf(`Publish a local module to the Daggerverse (%s). The module needs to be committed to a git repository and have a remote configured with name "origin". The git repository must be clean (unless forced), to avoid mistakingly depending on uncommitted files. `, daDaggerverse, ), GroupID: moduleGroup.ID, Annotations: map[string]string{ "experimental": "true", }, RunE: func(cmd *cobra.Command, extraArgs []string) (rerr error) { ctx := cmd.Context() return withEngineAndTUI(ctx, client.Params{}, func(ctx context.Context, engineClient *client.Client) (err error) { rec := progrock.FromContext(ctx) vtx := rec.Vertex(idtui.PrimaryVertex, cmd.CommandPath()) defer func() { vtx.Done(err) }() setCmdOutput(cmd, vtx) dag := engineClient.Dagger() modConf, err := getDefaultModuleConfiguration(ctx, dag, true) if err != nil { return fmt.Errorf("failed to get configured module: %w", err) } if modConf.SourceKind != dagger.LocalSource { return fmt.Errorf("module must be local") } if !modConf.FullyInitialized() { return fmt.Errorf("module must be fully initialized")
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
} repo, err := git.PlainOpenWithOptions(modConf.LocalRootSourcePath, &git.PlainOpenOptions{ DetectDotGit: true, }) if err != nil { return fmt.Errorf("failed to open git repo: %w", err) } wt, err := repo.Worktree() if err != nil { return fmt.Errorf("failed to get git worktree: %w", err) } st, err := wt.Status() if err != nil { return fmt.Errorf("failed to get git status: %w", err) } head, err := repo.Head() if err != nil { return fmt.Errorf("failed to get git HEAD: %w", err) } commit := head.Hash() rec.Debug("git commit", progrock.Labelf("commit", commit.String())) orig, err := repo.Remote("origin") if err != nil { return fmt.Errorf("failed to get git remote: %w", err) } refPath, err := originToPath(orig.Config().URLs[0]) if err != nil { return fmt.Errorf("failed to get module path: %w", err) }
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
gitRoot := wt.Filesystem.Root() pathFromRoot, err := filepath.Rel(gitRoot, modConf.LocalRootSourcePath) if err != nil { return fmt.Errorf("failed to get path from git root: %w", err) } if !st.IsClean() && !force { cmd.Println(st) return fmt.Errorf("git repository is not clean; run with --force to ignore") } refStr := fmt.Sprintf("%s@%s", path.Join(refPath, pathFromRoot), commit) crawlURL, err := url.JoinPath(daDaggerverse, "crawl") if err != nil { return fmt.Errorf("failed to get module URL: %w", err) } data := url.Values{} data.Add("ref", refStr) req, err := http.NewRequest(http.MethodPut, crawlURL, strings.NewReader(data.Encode())) if err != nil { return fmt.Errorf("failed to create request: %w", err) } req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
res, err := http.DefaultClient.Do(req) if err != nil { return fmt.Errorf("failed to get module: %w", err) } cmd.Println("Publishing", refStr, "to", daDaggerverse+"...") cmd.Println() cmd.Println("You can check on the crawling status here:") cmd.Println() cmd.Println(" " + res.Request.URL.String()) modURL, err := url.JoinPath(daDaggerverse, "mod", refStr) if err != nil { return fmt.Errorf("failed to get module URL: %w", err) } cmd.Println() cmd.Println("Once the crawl is complete, you can view your module here:") cmd.Println() cmd.Println(" " + modURL) return res.Body.Close() }) }, } func originToPath(origin string) (string, error) { url, err := gitutil.ParseURL(origin) if err != nil { return "", fmt.Errorf("failed to parse git remote origin URL: %w", err) } return strings.TrimSuffix(path.Join(url.Host, url.Path), ".git"), nil } type configuredModule struct {
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
Source *dagger.ModuleSource SourceKind dagger.ModuleSourceKind LocalContextPath string LocalRootSourcePath string ModuleSourceConfigExists bool } func (c *configuredModule) FullyInitialized() bool { return c.ModuleSourceConfigExists } func getDefaultModuleConfiguration(
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
ctx context.Context, dag *dagger.Client, resolveFromCaller bool, ) (*configuredModule, error) { srcRefStr := moduleURL if srcRefStr == "" { if v, ok := os.LookupEnv("DAGGER_MODULE"); ok { srcRefStr = v } if srcRefStr == "" { srcRefStr = moduleURLDefault } } return getModuleConfigurationForSourceRef(ctx, dag, srcRefStr, resolveFromCaller) } func getModuleConfigurationForSourceRef(
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
ctx context.Context, dag *dagger.Client, srcRefStr string, resolveFromCaller bool, ) (*configuredModule, error) { conf := &configuredModule{} conf.Source = dag.ModuleSource(srcRefStr) var err error conf.SourceKind, err = conf.Source.Kind(ctx) if err != nil { return nil, fmt.Errorf("failed to get module ref kind: %w", err) } if conf.SourceKind == dagger.LocalSource { cwd, err := os.Getwd() if err != nil { return nil, fmt.Errorf("failed to get current working directory: %w", err)
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
} defaultConfigDir, foundDefaultConfig, err := findUp(cwd) if err != nil { return nil, fmt.Errorf("error trying to find config path for %s: %s", cwd, err) } if foundDefaultConfig { configPath := filepath.Join(defaultConfigDir, modules.Filename) contents, err := os.ReadFile(configPath) if err != nil { return nil, fmt.Errorf("failed to read %s: %w", configPath, err) } var modCfg modules.ModuleConfig if err := json.Unmarshal(contents, &modCfg); err != nil { return nil, fmt.Errorf("failed to unmarshal %s: %s", configPath, err) } if namedDep, ok := modCfg.DependencyByName(srcRefStr); ok { src := dag.ModuleSource(namedDep.Source) kind, err := src.Kind(ctx) if err != nil { return nil, err } if kind == dagger.GitSource { return getModuleConfigurationForSourceRef(ctx, dag, namedDep.Source, resolveFromCaller) } depPath := filepath.Join(defaultConfigDir, namedDep.Source) srcRefStr = depPath } } conf.LocalRootSourcePath, err = filepath.Abs(srcRefStr) if err != nil {
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
return nil, fmt.Errorf("failed to get absolute path for %s: %w", srcRefStr, err) } if filepath.IsAbs(srcRefStr) { srcRefStr, err = filepath.Rel(cwd, srcRefStr) if err != nil { return nil, fmt.Errorf("failed to get relative path for %s: %w", srcRefStr, err) } } if err := os.MkdirAll(srcRefStr, 0755); err != nil { return nil, fmt.Errorf("failed to create directory for %s: %w", srcRefStr, err) } conf.Source = dag.ModuleSource(srcRefStr) conf.LocalContextPath, err = conf.Source.ResolveContextPathFromCaller(ctx) if err != nil { return nil, fmt.Errorf("failed to get local root path: %w", err) } _, err = os.Lstat(filepath.Join(conf.LocalRootSourcePath, modules.Filename)) conf.ModuleSourceConfigExists = err == nil if resolveFromCaller { conf.Source = conf.Source.ResolveFromCaller() } } else { conf.ModuleSourceConfigExists, err = conf.Source.ConfigExists(ctx) if err != nil { return nil, fmt.Errorf("failed to check if module config exists: %w", err) } } return conf, nil } func findUp(curDirPath string) (string, bool, error) {
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
if !filepath.IsAbs(curDirPath) { return "", false, fmt.Errorf("path is not absolute: %s", curDirPath) } configPath := filepath.Join(curDirPath, modules.Filename) stat, err := os.Lstat(configPath) switch { case os.IsNotExist(err): case err == nil: if !stat.Mode().IsRegular() { return "", false, fmt.Errorf("expected %s to be a file", configPath) } return curDirPath, true, nil default: return "", false, fmt.Errorf("failed to lstat %s: %s", configPath, err) } if curDirPath == "/" { return curDirPath, false, nil } _, err = os.Lstat(filepath.Join(curDirPath, ".git")) if err == nil { return curDirPath, false, nil } parentDirPath := filepath.Dir(curDirPath) return findUp(parentDirPath) } func optionalModCmdWrapper(
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
fn func(context.Context, *client.Client, *dagger.Module, *cobra.Command, []string) error, presetSecretToken string, ) func(*cobra.Command, []string) error { return func(cmd *cobra.Command, cmdArgs []string) error { return withEngineAndTUI(cmd.Context(), client.Params{ SecretToken: presetSecretToken, }, func(ctx context.Context, engineClient *client.Client) (err error) { modConf, err := getDefaultModuleConfiguration(ctx, engineClient.Dagger(), true) if err != nil { return fmt.Errorf("failed to get configured module: %w", err) } var loadedMod *dagger.Module if modConf.FullyInitialized() { loadedMod = modConf.Source.AsModule().Initialize() _, err := loadedMod.Serve(ctx) if err != nil { return fmt.Errorf("failed to serve module: %w", err) } } return fn(ctx, engineClient, loadedMod, cmd, cmdArgs) }) } } func loadModTypeDefs(ctx context.Context, dag *dagger.Client, mod *dagger.Module) (*moduleDef, error) { var res struct {
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
TypeDefs []*modTypeDef } const query = ` fragment TypeDefRefParts on TypeDef { kind optional asObject { name } asInterface { name } asInput { name } asList { elementTypeDef { kind asObject { name } asInterface { name }
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
asInput { name } } } } fragment FunctionParts on Function { name description returnType { ...TypeDefRefParts } args { name description defaultValue typeDef { ...TypeDefRefParts } } } fragment FieldParts on FieldTypeDef { name description typeDef { ...TypeDefRefParts } } query TypeDefs($module: ModuleID!) { typeDefs: currentTypeDefs {
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
kind optional asObject { name sourceModuleName constructor { ...FunctionParts } functions { ...FunctionParts } fields { ...FieldParts } } asInterface { name sourceModuleName functions { ...FunctionParts } } asInput { name fields { ...FieldParts } } } }
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
` err := dag.Do(ctx, &dagger.Request{ Query: query, Variables: map[string]interface{}{ "module": mod, }, }, &dagger.Response{ Data: &res, }) if err != nil { return nil, fmt.Errorf("query module objects: %w", err) } name, err := mod.Name(ctx) if err != nil { return nil, fmt.Errorf("get module name: %w", err) } modDef := &moduleDef{Name: name} for _, typeDef := range res.TypeDefs { switch typeDef.Kind { case dagger.ObjectKind: modDef.Objects = append(modDef.Objects, typeDef) case dagger.InterfaceKind: modDef.Interfaces = append(modDef.Interfaces, typeDef) case dagger.InputKind: modDef.Inputs = append(modDef.Inputs, typeDef) } } return modDef, nil } type moduleDef struct {
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
Name string Objects []*modTypeDef Interfaces []*modTypeDef Inputs []*modTypeDef } func (m *moduleDef) AsFunctionProviders() []functionProvider { providers := make([]functionProvider, 0, len(m.Objects)+len(m.Interfaces)) for _, obj := range m.AsObjects() { providers = append(providers, obj) } for _, iface := range m.AsInterfaces() { providers = append(providers, iface) } return providers } func (m *moduleDef) AsObjects() []*modObject { var defs []*modObject for _, typeDef := range m.Objects { if typeDef.AsObject != nil { defs = append(defs, typeDef.AsObject) } } return defs } func (m *moduleDef) AsInterfaces() []*modInterface { var defs []*modInterface
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
for _, typeDef := range m.Interfaces { if typeDef.AsInterface != nil { defs = append(defs, typeDef.AsInterface) } } return defs } func (m *moduleDef) AsInputs() []*modInput { var defs []*modInput for _, typeDef := range m.Inputs { if typeDef.AsInput != nil { defs = append(defs, typeDef.AsInput) } } return defs } func (m *moduleDef) GetObject(name string) *modObject { for _, obj := range m.AsObjects() { if gqlObjectName(obj.Name) == gqlObjectName(name) { return obj } } return nil } func (m *moduleDef) GetInterface(name string) *modInterface { for _, iface := range m.AsInterfaces() { if gqlObjectName(iface.Name) == gqlObjectName(name) { return iface
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
} } return nil } func (m *moduleDef) GetFunctionProvider(name string) functionProvider { if obj := m.GetObject(name); obj != nil { return obj } if iface := m.GetInterface(name); iface != nil { return iface } return nil } func (m *moduleDef) GetInput(name string) *modInput { for _, input := range m.AsInputs() { if gqlObjectName(input.Name) == gqlObjectName(name) { return input } } return nil } func (m *moduleDef) GetMainObject() *modObject { return m.GetObject(m.Name) } func (m *moduleDef) LoadTypeDef(typeDef *modTypeDef) { if typeDef.AsObject != nil && typeDef.AsObject.Functions == nil && typeDef.AsObject.Fields == nil { obj := m.GetObject(typeDef.AsObject.Name) if obj != nil { typeDef.AsObject = obj
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
} } if typeDef.AsInterface != nil && typeDef.AsInterface.Functions == nil { iface := m.GetInterface(typeDef.AsInterface.Name) if iface != nil { typeDef.AsInterface = iface } } if typeDef.AsInput != nil && typeDef.AsInput.Fields == nil { input := m.GetInput(typeDef.AsInput.Name) if input != nil { typeDef.AsInput = input } } if typeDef.AsList != nil { m.LoadTypeDef(typeDef.AsList.ElementTypeDef) } } type modTypeDef struct { Kind dagger.TypeDefKind Optional bool AsObject *modObject AsInterface *modInterface AsInput *modInput AsList *modList } type functionProvider interface { ProviderName() string GetFunctions() []*modFunction GetFunction(name string) (*modFunction, error)
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
} func (t *modTypeDef) Name() string { if t.AsObject != nil { return t.AsObject.Name } if t.AsInterface != nil { return t.AsInterface.Name } return "" } func (t *modTypeDef) AsFunctionProvider() functionProvider { if t.AsObject != nil { return t.AsObject } if t.AsInterface != nil { return t.AsInterface } return nil } type modObject struct { Name string Functions []*modFunction Fields []*modField Constructor *modFunction SourceModuleName string } var _ functionProvider = (*modObject)(nil) func (o *modObject) ProviderName() string { return o.Name }
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
func (o *modObject) GetFunctions() []*modFunction { fns := make([]*modFunction, 0, len(o.Functions)+len(o.Fields)) for _, f := range o.Fields { fns = append(fns, &modFunction{ Name: f.Name, Description: f.Description, ReturnType: f.TypeDef, }) } fns = append(fns, o.Functions...) return fns } func (o *modObject) GetFunction(name string) (*modFunction, error) { for _, fn := range o.Functions { if fn.Name == name || cliName(fn.Name) == name { return fn, nil } } for _, f := range o.Fields { if f.Name == name || cliName(f.Name) == name { return &modFunction{ Name: f.Name, Description: f.Description, ReturnType: f.TypeDef, }, nil } } return nil, fmt.Errorf("no function '%s' in object type '%s'", name, o.Name) } type modInterface struct {
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
Name string Functions []*modFunction } var _ functionProvider = (*modInterface)(nil) func (o *modInterface) ProviderName() string { return o.Name } func (o *modInterface) GetFunctions() []*modFunction { fns := make([]*modFunction, 0, len(o.Functions)) fns = append(fns, o.Functions...) return fns } func (o *modInterface) GetFunction(name string) (*modFunction, error) { for _, fn := range o.Functions { if fn.Name == name || cliName(fn.Name) == name { return fn, nil } } return nil, fmt.Errorf("no function '%s' in interface type '%s'", name, o.Name) } type modInput struct {
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
Name string Fields []*modField } type modList struct { ElementTypeDef *modTypeDef } type modField struct { Name string Description string TypeDef *modTypeDef } type modFunction struct { Name string Description string ReturnType *modTypeDef Args []*modFunctionArg } type modFunctionArg struct {
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
cmd/dagger/module.go
Name string Description string TypeDef *modTypeDef DefaultValue dagger.JSON flagName string } func (r *modFunctionArg) FlagName() string { if r.flagName == "" { r.flagName = cliName(r.Name) } return r.flagName } func getDefaultValue[T any](r *modFunctionArg) (T, error) { var val T err := json.Unmarshal([]byte(r.DefaultValue), &val) return val, err } func gqlObjectName(name string) string { return strcase.ToCamel(name) } func gqlFieldName(name string) string { return strcase.ToLowerCamel(name) } func gqlArgName(name string) string { return strcase.ToLowerCamel(name) } func cliName(name string) string { return strcase.ToKebab(name) }
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
core/integration/module_test.go
package core import ( "context" _ "embed" "encoding/json" "fmt" "go/format" "os" "os/exec" "path/filepath" "strings" "testing" "time" "github.com/MakeNowJust/heredoc/v2" "github.com/dagger/dagger/core/modules" "github.com/dagger/dagger/dagql/idproto" "github.com/iancoleman/strcase" "github.com/moby/buildkit/identity" "github.com/stretchr/testify/require" "github.com/tidwall/gjson" "golang.org/x/sync/errgroup" "dagger.io/dagger" "github.com/dagger/dagger/cmd/codegen/introspection" ) func TestModuleGoInit(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
core/integration/module_test.go
t.Parallel() t.Run("from scratch", func(t *testing.T) { t.Parallel() c, ctx := connect(t) modGen := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). With(daggerExec("init", "--name=bare", "--sdk=go")) out, err := modGen. With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)). Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out) }) t.Run("reserved go.mod name", func(t *testing.T) { t.Parallel() c, ctx := connect(t) modGen := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). With(daggerExec("init", "--name=go", "--sdk=go")) out, err := modGen. With(daggerQuery(`{go{containerEcho(stringArg:"hello"){stdout}}}`)). Stdout(ctx)
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
core/integration/module_test.go
require.NoError(t, err) require.JSONEq(t, `{"go":{"containerEcho":{"stdout":"hello\n"}}}`, out) }) t.Run("uses expected Go module name, camel-cases Dagger module name", func(t *testing.T) { t.Parallel() c, ctx := connect(t) modGen := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). With(daggerExec("init", "--source=.", "--name=My-Module", "--sdk=go")) out, err := modGen. With(daggerQuery(`{myModule{containerEcho(stringArg:"hello"){stdout}}}`)). Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"myModule":{"containerEcho":{"stdout":"hello\n"}}}`, out) generated, err := modGen.File("go.mod").Contents(ctx) require.NoError(t, err) require.Contains(t, generated, "module main") }) t.Run("creates go.mod beneath an existing go.mod if context is beneath it", func(t *testing.T) { t.Parallel() c, ctx := connect(t) modGen := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). WithNewFile("/work/go.mod", dagger.ContainerWithNewFileOpts{ Contents: "module example.com/test\n", }). WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
core/integration/module_test.go
Contents: "package foo\n", }). WithWorkdir("/work/ci"). With(daggerExec("init", "--name=beneathGoMod", "--sdk=go")) out, err := modGen. With(daggerQuery(`{beneathGoMod{containerEcho(stringArg:"hello"){stdout}}}`)). Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"beneathGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out) t.Run("names Go module after Dagger module", func(t *testing.T) { generated, err := modGen.Directory("dagger").File("go.mod").Contents(ctx) require.NoError(t, err) require.Contains(t, generated, "module main") }) }) t.Run("respects existing go.mod", func(t *testing.T) { t.Parallel() c, ctx := connect(t) modGen := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). WithExec([]string{"go", "mod", "init", "example.com/test"}). With(daggerExec("init", "--name=hasGoMod", "--sdk=go")) out, err := modGen. With(daggerQuery(`{hasGoMod{containerEcho(stringArg:"hello"){stdout}}}`)). Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"hasGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out) t.Run("preserves module name", func(t *testing.T) { generated, err := modGen.File("go.mod").Contents(ctx)
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
core/integration/module_test.go
require.NoError(t, err) require.Contains(t, generated, "module example.com/test") }) }) t.Run("respects existing go.work", func(t *testing.T) { t.Parallel() c, ctx := connect(t) modGen := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). WithExec([]string{"go", "mod", "init", "example.com/test"}). WithExec([]string{"go", "work", "init"}). WithExec([]string{"go", "work", "use", "."}). With(daggerExec("init", "--name=hasGoMod", "--sdk=go")) out, err := modGen. With(daggerQuery(`{hasGoMod{containerEcho(stringArg:"hello"){stdout}}}`)). Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"hasGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out) t.Run("go.work is edited", func(t *testing.T) { generated, err := modGen.File("go.work").Contents(ctx) require.NoError(t, err) require.Contains(t, generated, "\t.\n") require.Contains(t, generated, "\t./dagger\n") }) }) t.Run("respects existing go.work for top-level source", func(t *testing.T) { t.Parallel() c, ctx := connect(t) modGen := c.Container().From(golangImage).
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
core/integration/module_test.go
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). WithExec([]string{"go", "mod", "init", "example.com/test"}). WithExec([]string{"go", "work", "init"}). With(daggerExec("init", "--name=hasGoMod", "--sdk=go", "--source=.")) out, err := modGen. With(daggerQuery(`{hasGoMod{containerEcho(stringArg:"hello"){stdout}}}`)). Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"hasGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out) t.Run("go.work is edited", func(t *testing.T) { generated, err := modGen.File("go.work").Contents(ctx) require.NoError(t, err) require.Contains(t, generated, "use .\n") }) }) t.Run("ignores go.work for subdir", func(t *testing.T) { t.Parallel() c, ctx := connect(t) modGen := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). WithExec([]string{"go", "mod", "init", "example.com/test"}). WithExec([]string{"go", "work", "init"}). WithExec([]string{"go", "work", "use", "."}). With(daggerExec("init", "--name=hasGoMod", "--sdk=go", "subdir")) out, err := modGen.
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
core/integration/module_test.go
WithWorkdir("./subdir"). With(daggerQuery(`{hasGoMod{containerEcho(stringArg:"hello"){stdout}}}`)). Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"hasGoMod":{"containerEcho":{"stdout":"hello\n"}}}`, out) t.Run("go.work is unedited", func(t *testing.T) { generated, err := modGen.File("go.work").Contents(ctx) require.NoError(t, err) require.Contains(t, generated, "use .\n") }) }) t.Run("respects parent go.mod if root points to it", func(t *testing.T) { t.Parallel() c, ctx := connect(t) generated := goGitBase(t, c). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). WithExec([]string{"go", "mod", "init", "example.com/test"}). WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{ Contents: "package foo\n", }). With(daggerExec("init", "--name=child", "--sdk=go", "./child")). WithWorkdir("/work/child"). With(daggerExec("develop")). Directory("/work") parentEntries, err := generated.Entries(ctx) require.NoError(t, err) require.Equal(t, []string{".git", "child", "foo.go", "go.mod", "go.sum"}, parentEntries) childEntries, err := generated.Directory("child").Entries(ctx)
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
core/integration/module_test.go
require.NoError(t, err) require.NotContains(t, childEntries, "go.mod") t.Run("preserves parent module name", func(t *testing.T) { goMod, err := generated.File("go.mod").Contents(ctx) require.NoError(t, err) require.Contains(t, goMod, "module example.com/test") }) }) t.Run("respects existing go.mod even if root points to parent that has go.mod", func(t *testing.T) { t.Parallel() c, ctx := connect(t) generated := goGitBase(t, c). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). WithExec([]string{"git", "init"}). WithExec([]string{"go", "mod", "init", "example.com/test"}). WithNewFile("/work/foo.go", dagger.ContainerWithNewFileOpts{ Contents: "package foo\n", }). WithWorkdir("/work/child"). WithExec([]string{"go", "mod", "init", "my-mod"}). WithWorkdir("/work"). With(daggerExec("init", "--source=./child", "--name=child", "--sdk=go", "./child")). WithWorkdir("/work/child"). With(daggerExec("develop")). Directory("/work") parentEntries, err := generated.Entries(ctx) require.NoError(t, err)
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
core/integration/module_test.go
require.Equal(t, []string{".git", "child", "foo.go", "go.mod"}, parentEntries) childEntries, err := generated.Directory("child").Entries(ctx) require.NoError(t, err) require.Contains(t, childEntries, "go.mod") require.Contains(t, childEntries, "go.sum") }) t.Run("respects existing main.go", func(t *testing.T) { t.Parallel() c, ctx := connect(t) modGen := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{ Contents: ` package main type HasMainGo struct {} func (m *HasMainGo) Hello() string { return "Hello, world!" } `, }). With(daggerExec("init", "--name=hasMainGo", "--sdk=go", "--source=.")) out, err := modGen. With(daggerQuery(`{hasMainGo{hello}}`)). Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"hasMainGo":{"hello":"Hello, world!"}}`, out) }) t.Run("respects existing main.go even if it uses types not generated yet", func(t *testing.T) { t.Parallel() c, ctx := connect(t) modGen := c.Container().From(golangImage).
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
core/integration/module_test.go
WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). WithNewFile("/work/main.go", dagger.ContainerWithNewFileOpts{ Contents: ` package main type HasDaggerTypes struct {} func (m *HasDaggerTypes) Hello() *Container { return dag.Container(). From("` + alpineImage + `"). WithExec([]string{"echo", "Hello, world!"}) } `, }). With(daggerExec("init", "--source=.", "--name=hasDaggerTypes", "--sdk=go")) out, err := modGen. With(daggerQuery(`{hasDaggerTypes{hello{stdout}}}`)). Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"hasDaggerTypes":{"hello":{"stdout":"Hello, world!\n"}}}`, out) }) t.Run("respects existing package without creating main.go", func(t *testing.T) { t.Parallel() c, ctx := connect(t) modGen := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). WithNewFile("/work/notmain.go", dagger.ContainerWithNewFileOpts{ Contents: `package main type HasNotMainGo struct {} func (m *HasNotMainGo) Hello() string { return "Hello, world!" }
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
core/integration/module_test.go
`, }). With(daggerExec("init", "--source=.", "--name=hasNotMainGo", "--sdk=go")) out, err := modGen. With(daggerQuery(`{hasNotMainGo{hello}}`)). Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"hasNotMainGo":{"hello":"Hello, world!"}}`, out) }) t.Run("with source", func(t *testing.T) { t.Parallel() c, ctx := connect(t) modGen := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). With(daggerExec("init", "--name=bare", "--sdk=go", "--source=some/subdir")) out, err := modGen. With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)). Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out) sourceSubdirEnts, err := modGen.Directory("/work/some/subdir").Entries(ctx) require.NoError(t, err) require.Contains(t, sourceSubdirEnts, "main.go") sourceRootEnts, err := modGen.Directory("/work").Entries(ctx) require.NoError(t, err) require.NotContains(t, sourceRootEnts, "main.go") }) } func TestModuleInitLICENSE(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
core/integration/module_test.go
t.Run("bootstraps Apache-2.0 LICENSE file if none found", func(t *testing.T) { t.Parallel() c, ctx := connect(t) modGen := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go")) content, err := modGen.File("LICENSE").Contents(ctx) require.NoError(t, err) require.Contains(t, content, "Apache License, Version 2.0") }) t.Run("creates LICENSE file in the directory specified by arg", func(t *testing.T) { t.Parallel() c, ctx := connect(t) modGen := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go", "./mymod")) content, err := modGen.File("mymod/LICENSE").Contents(ctx) require.NoError(t, err) require.Contains(t, content, "Apache License, Version 2.0") }) t.Run("does not bootstrap LICENSE file if it exists in the parent dir", func(t *testing.T) { t.Parallel() c, ctx := connect(t)
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
core/integration/module_test.go
modGen := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). WithNewFile("/work/LICENSE", dagger.ContainerWithNewFileOpts{ Contents: "doesnt matter", }). WithWorkdir("/work/sub"). With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go")) _, err := modGen.File("LICENSE").Contents(ctx) require.Error(t, err) }) t.Run("bootstraps a LICENSE file when requested, even if it exists in the parent dir", func(t *testing.T) { t.Parallel() c, ctx := connect(t) modGen := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). WithNewFile("/work/LICENSE", dagger.ContainerWithNewFileOpts{ Contents: "doesnt matter", }). WithWorkdir("/work/sub"). With(daggerExec("init", "--name=licensed-to-ill", "--sdk=go", "--license=MIT")) content, err := modGen.File("LICENSE").Contents(ctx) require.NoError(t, err) require.Contains(t, content, "MIT License") }) } func TestModuleGit(t *testing.T) { t.Parallel() type testCase struct {
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
core/integration/module_test.go
sdk string gitGeneratedFiles []string gitIgnoredFiles []string } for _, tc := range []testCase{ { sdk: "go", gitGeneratedFiles: []string{ "/dagger.gen.go", "/internal/dagger/**", "/internal/querybuilder/**", }, }, { sdk: "python", gitGeneratedFiles: []string{ "/sdk/**", }, gitIgnoredFiles: []string{
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
core/integration/module_test.go
"/sdk", }, }, { sdk: "typescript", gitGeneratedFiles: []string{ "/sdk/**", }, gitIgnoredFiles: []string{ "/sdk", }, }, } { tc := tc t.Run(fmt.Sprintf("module %s git", tc.sdk), func(t *testing.T) { t.Parallel() c, ctx := connect(t) modGen := goGitBase(t, c). With(daggerExec("init", "--name=bare", "--sdk="+tc.sdk)) out, err := modGen. With(daggerQuery(`{bare{containerEcho(stringArg:"hello"){stdout}}}`)). Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"bare":{"containerEcho":{"stdout":"hello\n"}}}`, out) t.Run("configures .gitattributes", func(t *testing.T) { ignore, err := modGen.File("dagger/.gitattributes").Contents(ctx) require.NoError(t, err) for _, fileName := range tc.gitGeneratedFiles { require.Contains(t, ignore, fmt.Sprintf("%s linguist-generated\n", fileName)) }
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
core/integration/module_test.go
}) if len(tc.gitIgnoredFiles) > 0 { t.Run("configures .gitignore", func(t *testing.T) { ignore, err := modGen.File("dagger/.gitignore").Contents(ctx) require.NoError(t, err) for _, fileName := range tc.gitIgnoredFiles { require.Contains(t, ignore, fileName) } }) } }) } } var goSignatures string func TestModuleGoSignatures(t *testing.T) { t.Parallel() c, ctx := connect(t) modGen := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). With(daggerExec("init", "--source=.", "--name=minimal", "--sdk=go")). WithNewFile("main.go", dagger.ContainerWithNewFileOpts{ Contents: goSignatures, }) t.Run("func Hello() string", func(t *testing.T) { out, err := modGen.With(daggerQuery(`{minimal{hello}}`)).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"hello":"hello"}}`, out) }) t.Run("func Echo(string) string", func(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
core/integration/module_test.go
out, err := modGen.With(daggerQuery(`{minimal{echo(msg: "hello")}}`)).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"echo":"hello...hello...hello..."}}`, out) }) t.Run("func EchoPointer(*string) string", func(t *testing.T) { out, err := modGen.With(daggerQuery(`{minimal{echoPointer(msg: "hello")}}`)).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"echoPointer":"hello...hello...hello..."}}`, out) }) t.Run("func EchoPointerPointer(**string) string", func(t *testing.T) { out, err := modGen.With(daggerQuery(`{minimal{echoPointerPointer(msg: "hello")}}`)).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"echoPointerPointer":"hello...hello...hello..."}}`, out) }) t.Run("func EchoOptional(string) string", func(t *testing.T) { out, err := modGen.With(daggerQuery(`{minimal{echoOptional(msg: "hello")}}`)).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"echoOptional":"hello...hello...hello..."}}`, out) out, err = modGen.With(daggerQuery(`{minimal{echoOptional}}`)).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"echoOptional":"default...default...default..."}}`, out) }) t.Run("func EchoOptionalPointer(string) string", func(t *testing.T) { out, err := modGen.With(daggerQuery(`{minimal{echoOptionalPointer(msg: "hello")}}`)).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"echoOptionalPointer":"hello...hello...hello..."}}`, out) out, err = modGen.With(daggerQuery(`{minimal{echoOptionalPointer}}`)).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"echoOptionalPointer":"default...default...default..."}}`, out) })
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
core/integration/module_test.go
t.Run("func EchoOptionalSlice([]string) string", func(t *testing.T) { out, err := modGen.With(daggerQuery(`{minimal{echoOptionalSlice(msg: ["hello", "there"])}}`)).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"echoOptionalSlice":"hello+there...hello+there...hello+there..."}}`, out) out, err = modGen.With(daggerQuery(`{minimal{echoOptionalSlice}}`)).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"echoOptionalSlice":"foobar...foobar...foobar..."}}`, out) }) t.Run("func Echoes([]string) []string", func(t *testing.T) { out, err := modGen.With(daggerQuery(`{minimal{echoes(msgs: ["hello"])}}`)).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"echoes":["hello...hello...hello..."]}}`, out) }) t.Run("func EchoesVariadic(...string) string", func(t *testing.T) { out, err := modGen.With(daggerQuery(`{minimal{echoesVariadic(msgs: ["hello"])}}`)).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"echoesVariadic":"hello...hello...hello..."}}`, out) }) t.Run("func HelloContext(context.Context) string", func(t *testing.T) { out, err := modGen.With(daggerQuery(`{minimal{helloContext}}`)).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"helloContext":"hello context"}}`, out) }) t.Run("func EchoContext(context.Context, string) string", func(t *testing.T) { out, err := modGen.With(daggerQuery(`{minimal{echoContext(msg: "hello")}}`)).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"echoContext":"ctx.hello...ctx.hello...ctx.hello..."}}`, out) }) t.Run("func HelloStringError() (string, error)", func(t *testing.T) { out, err := modGen.With(daggerQuery(`{minimal{helloStringError}}`)).Stdout(ctx)
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
core/integration/module_test.go
require.NoError(t, err) require.JSONEq(t, `{"minimal":{"helloStringError":"hello i worked"}}`, out) }) t.Run("func HelloVoid()", func(t *testing.T) { out, err := modGen.With(daggerQuery(`{minimal{helloVoid}}`)).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"helloVoid":null}}`, out) }) t.Run("func HelloVoidError() error", func(t *testing.T) { out, err := modGen.With(daggerQuery(`{minimal{helloVoidError}}`)).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"helloVoidError":null}}`, out) }) t.Run("func EchoOpts(string, string, int) error", func(t *testing.T) { out, err := modGen.With(daggerQuery(`{minimal{echoOpts(msg: "hi")}}`)).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"echoOpts":"hi"}}`, out) out, err = modGen.With(daggerQuery(`{minimal{echoOpts(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"echoOpts":"hi!hi!"}}`, out) }) t.Run("func EchoOptsInline(struct{string, string, int}) error", func(t *testing.T) { out, err := modGen.With(daggerQuery(`{minimal{echoOptsInline(msg: "hi")}}`)).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"echoOptsInline":"hi"}}`, out) out, err = modGen.With(daggerQuery(`{minimal{echoOptsInline(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"echoOptsInline":"hi!hi!"}}`, out) }) t.Run("func EchoOptsInlinePointer(*struct{string, string, int}) error", func(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
core/integration/module_test.go
out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlinePointer(msg: "hi")}}`)).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"echoOptsInlinePointer":"hi"}}`, out) out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlinePointer(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"echoOptsInlinePointer":"hi!hi!"}}`, out) }) t.Run("func EchoOptsInlineCtx(ctx, struct{string, string, int}) error", func(t *testing.T) { out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlineCtx(msg: "hi")}}`)).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"echoOptsInlineCtx":"hi"}}`, out) out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlineCtx(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"echoOptsInlineCtx":"hi!hi!"}}`, out) }) t.Run("func EchoOptsInlineTags(struct{string, string, int}) error", func(t *testing.T) { out, err := modGen.With(daggerQuery(`{minimal{echoOptsInlineTags(msg: "hi")}}`)).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"echoOptsInlineTags":"hi"}}`, out) out, err = modGen.With(daggerQuery(`{minimal{echoOptsInlineTags(msg: "hi", suffix: "!", times: 2)}}`)).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"echoOptsInlineTags":"hi!hi!"}}`, out) }) t.Run("func EchoOptsPragmas(string, string, int) error", func(t *testing.T) { out, err := modGen.With(daggerQuery(`{minimal{echoOptsPragmas(msg: "hi")}}`)).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"echoOptsPragmas":"hi...hi...hi..."}}`, out) }) } func TestModuleGoSignaturesBuiltinTypes(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
core/integration/module_test.go
t.Parallel() c, ctx := connect(t) modGen := c.Container().From(golangImage). WithMountedFile(testCLIBinPath, daggerCliFile(t, c)). WithWorkdir("/work"). With(daggerExec("init", "--name=minimal", "--sdk=go")). WithNewFile("dagger/main.go", dagger.ContainerWithNewFileOpts{ Contents: `package main import "context" type Minimal struct {} func (m *Minimal) Read(ctx context.Context, dir Directory) (string, error) { return dir.File("foo").Contents(ctx) } func (m *Minimal) ReadPointer(ctx context.Context, dir *Directory) (string, error) { return dir.File("foo").Contents(ctx) } func (m *Minimal) ReadSlice(ctx context.Context, dir []Directory) (string, error) { return dir[0].File("foo").Contents(ctx) } func (m *Minimal) ReadVariadic(ctx context.Context, dir ...Directory) (string, error) { return dir[0].File("foo").Contents(ctx) } func (m *Minimal) ReadOptional( ctx context.Context,
closed
dagger/dagger
https://github.com/dagger/dagger
6,640
🐞 CLI: dagger listen --disable-host-read-write fails in v0.9.9
### What is the issue? There is a regression on dagger v0.9.9 with the dagger listen command when the flag `--disable-host-read-write` is specified. Prior to v0.9.8 this was working correctly. Since v0.9.9 it fails with: ``` Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ``` If you run this command inside a module it also fails with the same error: ``` $ dagger mod init --name test --sdk go $ dagger listen --disable-host-read-write β”œ [0.01s] loading module ✘ directory ERROR [0.01s] β–Ά directory β–Ά host.directory /home/matipan/bin/test ✘ upload /home/matipan/bin/test from pop-os (client id: 09oib86lak5rdy6j1tbxf2gbu) ERROR [0.01s] β”œ [0.00s] transferring /home/matipan/bin/test: β€’ Engine: 6241366fb45d (version v0.9.7) β§— 1.97s βœ” 6 ✘ 3 Error: failed to get loaded module ID: input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled input: resolve: host: directory: host directory /home/matipan/bin/test: no local sources enabled ``` ### Dagger version dagger v0.9.9 ([registry.dagger.io/engine](http://registry.dagger.io/engine)) linux/amd64 ### Steps to reproduce ``` $ dagger listen --progress plain --disable-host-read-write ``` ### Log output ``` Connected to engine 5c478db0e017 (version v0.9.9) Error: failed to get configured module: failed to get local root path: input: resolve: moduleSource: resolveContextPathFromCaller: failed to stat source root: failed to receive file bytes message: rpc error: code = Unimplemented desc = unknown service moby.filesync.v1.FileSync ```
https://github.com/dagger/dagger/issues/6640
https://github.com/dagger/dagger/pull/6732
b966257dbc24b714e6ee39f01158f10f8fa24fd3
ca447cd4d7ca6d25e62008d3e1f87100111709df
"2024-02-09T14:29:11Z"
go
"2024-02-26T17:12:49Z"
core/integration/module_test.go
dir *Directory, // +optional ) (string, error) { if dir != nil { return dir.File("foo").Contents(ctx) } return "", nil } `, }) out, err := modGen.With(daggerQuery(`{directory{withNewFile(path: "foo", contents: "bar"){id}}}`)).Stdout(ctx) require.NoError(t, err) dirID := gjson.Get(out, "directory.withNewFile.id").String() t.Run("func Read(ctx, Directory) (string, error)", func(t *testing.T) { out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{read(dir: "%s")}}`, dirID))).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"read":"bar"}}`, out) }) t.Run("func ReadPointer(ctx, *Directory) (string, error)", func(t *testing.T) { out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readPointer(dir: "%s")}}`, dirID))).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"readPointer":"bar"}}`, out) }) t.Run("func ReadSlice(ctx, []Directory) (string, error)", func(t *testing.T) { out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readSlice(dir: ["%s"])}}`, dirID))).Stdout(ctx) require.NoError(t, err) require.JSONEq(t, `{"minimal":{"readSlice":"bar"}}`, out) }) t.Run("func ReadVariadic(ctx, ...Directory) (string, error)", func(t *testing.T) { out, err := modGen.With(daggerQuery(fmt.Sprintf(`{minimal{readVariadic(dir: ["%s"])}}`, dirID))).Stdout(ctx) require.NoError(t, err)