#I am trying to install a toolchain in my

1 messages ยท Page 1 of 1 (latest)

runic dome
#

Are you in a dagger module to install it to? can you share some of the dagger.json?

formal nimbus
#

And I do have a .env in the root

#
{
  "name": "MyModule",
  "engineVersion": "v0.19.10",
  "sdk": {
    "source": "go"
  },
  "dependencies": [
    {
   ...
    },
    {
   ...
    },
    {
   ...
    },
  ],
  "source": "dagger",
  "disableDefaultFunctionCaching": true
}
runic dome
#

Hm, I guess can you try renaming the .env to rule it out? I assume the toolchain repo is private? I'm wondering if that could be related. I don't know why it would be, I just haven't tested that

formal nimbus
#

the toolchain repo is not private. It's actually open internally.

#

let me try renaming the .env

#

Removing the .env didnt' change things ๐Ÿ™

#

I assume the toolchain repo is private?
It's private in the sense it needs auth, yes. But all other dependencies to too and they work fine. They are all in the same repo too.

What baffles me is that it works locally. Exact same repo.

runic dome
#

oh I missed that this was only happening in CI ๐Ÿค”

ember edge
#

I think dagger check doesn't work with -m REMOTE its a bug

#

doesn't work on our repo either

formal nimbus
#

I don't use check or have +check pragma on any of the functions in the module.

formal nimbus
#

I need some help with this. I spent a ton of time trying to figure it out but I can't install the toolchain on my CI but I can do it on my local! Local and CI, same engine version, same commands (dagger init followed by dagger toolchain install [module]) The one difference I see is:

On my local machine after a cache prune and the engine is connected (progress=plain) I see the following.

 : connect DONE [0.3s]

8   : moduleSource(refString: ".", requireKind: LOCAL_SOURCE): ModuleSource!
8   : moduleSource DONE [0.1s]

The same stage in my CI

23:04:07  1   : connect DONE [0.3s]
23:04:07  
23:04:07  8   : moduleSource(refString: "github.com/[redacted]/testmod@pull/121/head", requireKind: LOCAL_SOURCE): ModuleSource!
23:04:07  8   : moduleSource ERROR [0.0s]
23:04:07  8   : ! module source "github.com/[redacted]/testmod@pull/121/head" kind must be "local", got "git"

Why is the refString different? @glass zinc sorry for the ping but do you have any ideas?

glass zinc
formal nimbus
#

Repo is in github. CI is Jenkins

#

We don't use any kind of local storage in Jenkins. Everything starts from fresh. So I tried to mimic that in local too by pruning the cache and removing the image. Still same behavior. If it matters, my local is a arm64 mac, Jenkins is amd64

#

I also tried dagger toolchain install module@main as well as dagger toolchain install module and dagger toolchain install module --name modulename

#

This is a private repo, so requires auth.

glass zinc
formal nimbus
#

after dagger init?

glass zinc
# formal nimbus after `dagger init`?

Yes

I think I reproduced this locally in a fresh /tmp module. The failure is not cache/arch-related; it happens when the target module is resolved as Git instead of local, and the obvious thing, given the context is an environment overwrite

By any changce does your pipeline inject a DAGGER_MODULE env var ?

formal nimbus
#

hm, it does not

glass zinc
formal nimbus
#

omg I think that worked

glass zinc
# formal nimbus omg I think that worked

Yeah, auth should be unrelated, it happens technically after.

I think there's a DAGGER_MODULE env var that's injected in your context. Could you please check ? ๐Ÿ™

formal nimbus
#

and oh boy. I lied. we DO have a DAGGER_MODULE env var in the pipeline ( i was only checking local)

#

I do! you are spot on

glass zinc
#

At least, I'm glad you're unlocked, it's a bit surprising as a UX

formal nimbus
#

Yeah it is an innocuous assignment. We just used that variable to specify the module name, but we don't use it as an env var. We pass it to a function. I can rename that var

#

Thank you so much!!!! I spent many hours pulling my hair for this and I'm already almost bald ๐Ÿ˜„

glass zinc
formal nimbus
#

I can sleep in peace now ๐Ÿ™‚

glass zinc
formal nimbus
#

ty again! โค๏ธ

glass zinc
ember edge