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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悶 Module names with single-dotted characters cause "main object not found" #7278

Open
SKalt opened this issue May 4, 2024 · 1 comment

Comments

@SKalt
Copy link

SKalt commented May 4, 2024

What is the issue?

I have a go module with a weird name with single dotted characters in it (e.g. "m.a.s.h"). I was running through the setup script when I encountered a weird error, "unable to find main object". I determined this error only occurs when there are single-dotted characters in the name field of dagger.json. I suspect the culprit is a mismatch between the arguments informing the generated go struct name

moduleStructName := strcase.ToCamel(g.Config.ModuleName)

and the gql object name

func gqlObjectName(name string) string {
	return strcase.ToCamel(name)
}

Dagger version

engine 6cf72caa80eb (version v0.11.2)

Steps to reproduce

Full reproduction script at https://github.com/SKalt/weird.name.repro/blob/main/repro.sh. Relevant excerpt:

dagger init --name=w.eird.name.repro
dagger develop --sdk=go
dagger functions

Log output

Full output logs at https://github.com/SKalt/weird.name.repro/blob/main/output.txt. Relevant excerpt:

Error: main object not found
Copy link
Contributor

Yes, that error appears when there's no object in the module's code that match the module's name, taking into consideration naming convention conversions. Safest bet for module names is kebab-case.

However, the error can be improved here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants