Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to pass anonymous option as argument #67

Closed
coryb opened this issue Apr 9, 2020 · 0 comments · Fixed by #70
Closed

unable to pass anonymous option as argument #67

coryb opened this issue Apr 9, 2020 · 0 comments · Fixed by #70
Labels
bug Something isn't working needs test

Comments

@coryb
Copy link
Contributor

coryb commented Apr 9, 2020

fs foo(option::run opts) {
	image "busybox"
	run "echo hi" with opts
}

fs default() {
	foo option::run {
		mount fs { local "."; } "/foo"
	}
}

error:

$ hlb run -t default ./bugs.hlb
#1 compiling [default]
panic: call stmt does not support options

goroutine 1 [running]:
github.com/openllb/hlb/codegen.(*CodeGen).EmitOptions(0xc000128f80, 0x5102020, 0xc0003c8540, 0xc0004d21c0, 0x0, 0x0, 0xc00069a8b0, 0x1, 0x1, 0x4f75f78, ...)
	/go/src/github.com/openllb/hlb/codegen/codegen.go:881 +0xb41
github.com/openllb/hlb/codegen.(*CodeGen).EmitFuncLit(0xc000128f80, 0x5102020, 0xc0003c8540, 0xc0004d21c0, 0xc000128540, 0x0, 0x0, 0x4f75f78, 0x0, 0x1, ...)
	/go/src/github.com/openllb/hlb/codegen/codegen.go:295 +0x3a8
github.com/openllb/hlb/codegen.(*CodeGen).EmitOptionExpr(0xc000128f80, 0x5102020, 0xc0003c8540, 0xc0004d21c0, 0x0, 0x0, 0xc000112eb0, 0xc000231560, 0x8, 0xc0002de2d8, ...)
	/go/src/github.com/openllb/hlb/codegen/expr.go:151 +0xae
github.com/openllb/hlb/codegen.(*CodeGen).ParameterizedScope(0xc000128f80, 0x5102020, 0xc0003c8540, 0xc0004d21c0, 0xc0001e29a0, 0x0, 0x0, 0xc00050e840, 0xc00069a7c0, 0x1, ...)
	/go/src/github.com/openllb/hlb/codegen/decl.go:138 +0x5f9
github.com/openllb/hlb/codegen.(*CodeGen).EmitFuncDecl(0xc000128f80, 0x5102020, 0xc0003c8540, 0xc0004d21c0, 0xc00050e840, 0xc0001e29a0, 0x0, 0x0, 0x4f75f78, 0x0, ...)
	/go/src/github.com/openllb/hlb/codegen/decl.go:22 +0xe8
github.com/openllb/hlb/codegen.(*CodeGen).EmitFilesystemChainStmt(0xc000128f80, 0x5102020, 0xc0003c8540, 0xc0004d21c0, 0x4f127ac, 0x2, 0xc0001e29a0, 0x4f75f78, 0x4ef7080, 0xc000129000, ...)
	/go/src/github.com/openllb/hlb/codegen/codegen.go:822 +0x516
github.com/openllb/hlb/codegen.(*CodeGen).EmitChainStmt(0xc000128f80, 0x5102020, 0xc0003c8540, 0xc0004d21c0, 0x4f127ac, 0x2, 0xc0001e29a0, 0x4f75f78, 0x0, 0xc0002decb0, ...)
	/go/src/github.com/openllb/hlb/codegen/codegen.go:184 +0x9f
github.com/openllb/hlb/codegen.(*CodeGen).EmitBlock(0xc000128f80, 0x5102020, 0xc0003c8540, 0xc0004d21c0, 0x4f127ac, 0x2, 0xc00069a8a8, 0x1, 0x1, 0x4f75f78, ...)
	/go/src/github.com/openllb/hlb/codegen/codegen.go:156 +0x1c5
github.com/openllb/hlb/codegen.(*CodeGen).EmitFilesystemBlock(0xc000128f80, 0x5102020, 0xc0003c8540, 0xc0004d21c0, 0xc00069a8a8, 0x1, 0x1, 0x4f75f78, 0x0, 0x0, ...)
	/go/src/github.com/openllb/hlb/codegen/codegen.go:271 +0xd7
github.com/openllb/hlb/codegen.(*CodeGen).EmitFuncDecl(0xc000128f80, 0x5102020, 0xc0003c8540, 0xc0004d2140, 0xc0002314a0, 0xc0001e2af0, 0x0, 0x0, 0x4f75f78, 0xc000299902, ...)
	/go/src/github.com/openllb/hlb/codegen/decl.go:45 +0x2ac
github.com/openllb/hlb/codegen.(*CodeGen).EmitFilesystemFuncDecl(0xc000128f80, 0x5102020, 0xc0003c8540, 0xc0004d2140, 0xc0002314a0, 0xc0001e2af0, 0x4f75f78, 0x0, 0x0, 0x0, ...)
	/go/src/github.com/openllb/hlb/codegen/decl.go:56 +0xba
github.com/openllb/hlb/codegen.(*CodeGen).Generate(0xc000128f80, 0x5102020, 0xc0003c8540, 0xc00068f630, 0xc00069a898, 0x1, 0x1, 0x405efa0, 0xc0000a6ae0, 0xc0002df308, ...)
	/go/src/github.com/openllb/hlb/codegen/codegen.go:94 +0x3fb
github.com/openllb/hlb.Compile.func1(0xc0000a6ae0, 0xc0002df380)
	/go/src/github.com/openllb/hlb/hlb.go:136 +0xd9
github.com/docker/buildx/util/progress.Write(0x50f6be0, 0xc0004d2300, 0xc0003eb580, 0x13, 0xc0002df798)
	/go/pkg/mod/github.com/docker/buildx@v0.3.1/util/progress/writer.go:32 +0x257
github.com/openllb/hlb.Compile(0x5102020, 0xc0003c8540, 0xc00069a2d8, 0xc00026aa80, 0xc000699e60, 0x1, 0x1, 0x50cf3e0, 0xc00069a2b0, 0x0, ...)
	/go/src/github.com/openllb/hlb/hlb.go:148 +0x962
github.com/openllb/hlb/cmd/hlb/command.Run(0x5102020, 0xc0003c8540, 0xc00069a2d8, 0x50e4ae0, 0xc00069a2b0, 0x0, 0xc00046e340, 0x1, 0x1, 0x0, ...)
	/go/src/github.com/openllb/hlb/cmd/hlb/command/run.go:148 +0x6bc
github.com/openllb/hlb/cmd/hlb/command.glob..func5(0xc0003c84c0, 0x0, 0x0)
	/go/src/github.com/openllb/hlb/cmd/hlb/command/run.go:55 +0x415
github.com/urfave/cli/v2.(*Command).Run(0x59bfbc0, 0xc0003c80c0, 0x0, 0x0)
	/go/pkg/mod/github.com/urfave/cli/v2@v2.1.1/command.go:161 +0x4e0
github.com/urfave/cli/v2.(*App).RunContext(0xc000622300, 0x5102060, 0xc00019e008, 0xc0001a2000, 0x5, 0x5, 0x0, 0x0)
	/go/pkg/mod/github.com/urfave/cli/v2@v2.1.1/app.go:302 +0x814
github.com/urfave/cli/v2.(*App).Run(...)
	/go/pkg/mod/github.com/urfave/cli/v2@v2.1.1/app.go:211
main.main()
	/go/src/github.com/openllb/hlb/cmd/hlb/main.go:12 +0x67
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs test
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants