#Unfortunately I seem to still be stuck
1 messages · Page 1 of 1 (latest)
@uncut bluff Was just trying supergit locally with latest dev dagger. I think the last problem you're hitting is that you are using ID as a field, which triggers a bug.
Basically, ID is reserved; there's an issue open to actually enforce that with checks+errors but not implemented yet. I'll go squash that quick.
But after pulling down your daggerverse and making this change I could successfully call it from my own module:
diff --git a/supergit/remote.go b/supergit/remote.go
index f447300..714b7a1 100644
--- a/supergit/remote.go
+++ b/supergit/remote.go
@@ -86,7 +86,3 @@ type RemoteTag struct {
Name string `json:"name"`
Commit string `json:"commit"`
}
-
-func (rt *RemoteTag) ID() string {
- return rt.Commit
-}
diff --git a/supergit/repository.go b/supergit/repository.go
index 207bbdb..9729029 100644
--- a/supergit/repository.go
+++ b/supergit/repository.go
@@ -105,20 +105,20 @@ func (t *Tag) Tree() *Directory {
return t.Repository.WithGitCommand([]string{"checkout", t.Name}).Worktree
}
-func (r *Repository) Commit(id string) *Commit {
+func (r *Repository) Commit(sha string) *Commit {
return &Commit{
Repository: r,
- ID: id,
+ Sha: sha,
}
}
type Commit struct {
- ID string `json:"id"`
+ Sha string `json:"sha"`
Repository *Repository `json:"repository"`
}
func (c *Commit) Tree() *Directory {
return c.Repository.
- WithGitCommand([]string{"checkout", c.ID}).
+ WithGitCommand([]string{"checkout", c.Sha}).
Worktree
}
thank you! Will try that after lunch
for posterity, PR w/ fix+test here: https://github.com/dagger/dagger/pull/5995
Quick update on this: removing ID() did seem to unblock me (never would have found it in a million years..). But I'm still hitting a few strange things:
mod sync works fine, but functions blows up:
% dagger mod sync
• Cloud URL: https://dagger.cloud/runs/d9793b79-2adf-4e80-9534-fb90b21d99ee
• Engine: 8875851e414d (version devel ())
⧗ 8.80s ✔ 166 ∅ 3
% dagger functions
✘ load functions ERROR [3.24s]
├ [3.24s] loading module
┃ Error: failed to get loaded module ID: input:1: host.directory.asModule.serve failed t
┃ load module types: failed to call module "dagger" to get functions: failed to get func
┃ on output directory: process "go build -o /runtime ." did not complete successfully: e
┃ t code: 1
✘ serve ERROR [0.84s]
✘ exec go build -o /runtime . ERROR [0.23s]
┃ # dagger
┃ ./dagger.gen.go:4286:12: dag.LoadSupergitCommitFromID undefined (type *Client has no f
┃ ld or method LoadSupergitCommitFromID)
┃ ./dagger.gen.go:4286:37: undefined: SupergitCommitID
┃ ./engine.go:59:63: cannot use Opt("^v[0-9\\.]+") (value of type Optional[string]) as S
┃ ergitRemoteTagsOpts value in argument to dag.Supergit().Remote(engineUpstream).Tags
┃ ./worker.go:222:11: cannot use worker.WithServiceBinding("registry", registrySvc).With
┃ rviceBinding("privateregistry", privateRegistry()).WithExposedPort(devWorkerListenPort
┃ ContainerWithExposedPortOpts{…}).WithMountedCache(workerDefaultStateDir, dag.CacheVolu
┃ ("dagger-dev-engine-test-state")).WithExec(nil, ContainerWithExecOpts{…}).AsService()
┃ alue of type *Service) as *Container value in assignment
┃ ./worker.go:232:26: worker.Endpoint undefined (type *Container has no field or method
┃ dpoint)
┃ ./worker.go:232:40: undefined: ContainerEndpointOpts
┃ ./worker.go:267:39: cannot use worker (variable of type *Container) as *Service value
┃ argument to w.GoBase.WithExec([]string{…}).WithMountedDirectory("/app", dag.Host().Di
┃ ctory(".")).WithMountedDirectory(utilDirPath, testEngineUtils).WithEnvVariable("_DAGGE
┃ TESTS_ENGINE_TAR", filepath.Join(utilDirPath, "engine.tar")).WithWorkdir("/app").WithS
┃ viceBinding
• Cloud URL: https://dagger.cloud/runs/463e102a-0320-4074-a1d3-7ddc76d62081
• Engine: 8875851e414d (version devel ())
⧗ 3.74s ✔ 144 ∅ 3 ✘ 3
I can't repro, pulled down latest change and it works. But I suspect what you're getting may be due to an old dagger.gen.go. We've merged a fix to ignore that to main.
So first try export _EXPERIMENTAL_DAGGER_RUNNER_HOST=docker-image://registry.dagger.io/engine:main@sha256:2e42a1d826de8090825062622a818d27eb4322ff5882d3ac5ef509a43a5eba49, which will get you the latest engine off main.
If that doesn't work, let me know, but you can then try just rm dagger.gen.go as a fallback
(we're doing another release on monday, so that env var nonsense will be gone then)
To be clear, I'm running these commands in the context of the github.com/shykes/daggerverse/dagger module (not supergit)
Ah okay, yeah you still have a stray ID here: https://github.com/shykes/daggerverse/blob/324f4b411d6074d117ec54464eebb1ae73f6a06c/supergit/repository.go#L116
You are still getting incomprehensible errors rather than telling you the ID is wrong because my PR above hasn't gotten a shipit yet. I just tested w/ it though and it does catch the error (attached screenshot)
Still way too long an error message, and would be nice if it told you every problem rather than just the first one it found, but better at least
nice catch thanks
@radiant token does mod sync bump all dependencies?
(looks like no)
No, need an explicit mod use <dep>
I fixed that leftover ID, and bumped dependency, but still getting weird errors...
% dagger -m github.com/shykes/daggerverse/dagger functions
✘ load functions ERROR [5.03s]
├ [5.03s] loading module
┃ Error: failed to get loaded module ID: input:1: git.commit.tree.directory.asModule.serve failed to load mo
┃ le types: failed to call module "dagger" to get functions: failed to get function output directory: proces
┃ "go build -o /runtime ." did not complete successfully: exit code: 1
✘ serve ERROR [0.72s]
✘ exec go build -o /runtime . ERROR [0.31s]
┃ # dagger
┃ ./engine.go:59:63: cannot use Opt("^v[0-9\\.]+") (value of type Optional[string]) as SupergitRemoteTagsOpt
┃ value in argument to dag.Supergit().Remote(engineUpstream).Tags
┃ ./worker.go:230:26: worker.Endpoint undefined (type *Container has no field or method Endpoint)
┃ ./worker.go:230:40: undefined: ContainerEndpointOpts
┃ ./worker.go:266:34: undefined: registrySvc
• Cloud URL: https://dagger.cloud/runs/b3e01674-7347-420b-8178-40048f33f7fe
• Engine: 03dd2c5ecd5b (version devel ())
⧗ 5.45s ✔ 158 ∅ 3 ✘ 3
Those look like legit compilation errors maybe; seems like the breaking changes from services v2
It's this one that stresses me out: ┃ ./engine.go:59:63: cannot use Opt("^v[0-9\\.]+") (value of type Optional[string]) as SupergitRemoteTagsOpt
Since I removed that opt struct from supergit already
Right, we don't have those Opts types in the module code you author anymore, but those are still a part of the Go SDK client codegen (have been from the beginning, since cloak). Any arguments that are marked as optional in graphql get combined into a struct like that.
The remaining errors are just some other updates needed to the dagger module, I'm working through them.
Okay yeah it's just compilation errors due to needing to migrate from the Opts structs -> Optional. I fixed them locally (at least I can call dagger functions) on it now
Do you want me to just push that to your repo?
sorry had to pickup the kids. Yes would love a push of whatever you have. Is it a fix on the supergit or dagger module?
On the dagger module. Will push in a sec
remote: Permission to shykes/daggerverse.git denied to sipsma. lol, I'll open a PR or something