#How can I debug why "prepare" is taking so long (~30s)?
1 messages · Page 1 of 1 (latest)
I think dagger.json supports an exclude setting. Let me check.
Yeah I've tried it but it doesn't seem to help.
Under prepare I see ModuleSoruce@[...].resolveDirectoryFromCaller(path: "."): Directory! = [...] taking a long time!
Does your call involve some sort of Directory?
Hmmm just passing --source="."
Okay, cool.
There exists a workaround solution for that using what's called views. That workaround solution will be depreciated and ceased soon when the upcoming solution is merged. For now, you can use that.
I will link the explanation here.
Oh I'll look it up, thank you!
For the record I've been following Mark's example here: https://github.com/openmeterio/openmeter/blob/1bcbd70d7b0bbe84fdf3ef80cd480d3f56240747/ci/main.go#L30-L60.
There you go: #1251260501426442290 message
Alright. You can use it with --source=.:default
👀
You should use only includes if you want the most performant solution. It is generally easier to do any way.
{
"name": "m",
"sdk": "go",
"source": "dagger",
"engineVersion": "v0.11.6",
"views": [
{
"name": "view",
"patterns": [
"Cargo.toml",
"Cargo.lock",
"src/**/*.rs",
"migrations/*.sql"
]
}
]
}
This is an old configuration of mine that I was using to test the Go sdk.
You see it doesn't have any ! marks. That means it is include-by-default.
(Which acts like a whitelist/allowlist)
Useful, I'll give it a try!
For a Rust project, it is generally all you need.
But your project layout is probably different because of go. In that case, having something like **/*.go will work, along with go.mod and such.
Cool, thank you so much. Just found another example of views here: https://github.com/dagger/dagger/blob/60412516e9eda010fe4e022f9f9a5a6b27013499/dev/dagger.json#L32-L44
Yup. That uses allow-by-default. I like the deny-by-default approach.