Missing $GOPATH drives me crazy!

Hi everybody !

I’m currently trying to package Dex software (https://dexidp.io).
That software is based on Go, so I have decided to use the experimental go helper.

I am facing a crazy problem and have tried to solve it for days without success…

  • When I install my dex app from the command line, everything works smoothly and perfectly
  • Same from the CI server
  • But when I install my dex app from the web UI, I get a Missing $GOPATH error which makes the build fail

Anybody would have some guidance about what could be my issue and how to solve it ?
Many thanks in advance !

(You can try using my testing branch here : GitHub - YunoHost-Apps/dex_ynh at testing)

In the install script

source /usr/share/yunohost/helpers


Sorry I didn’t understand your reply ?
That line is pretty standard and required for all Yunohost packages I guess ?

I’m just learning packaging
I searched some apps based on go and noticed that line.
Can you provide the install log?

Nice ! Which package are you building ?

Sure, here you are (I think it was with the current testing branch)

I tried x-prober but failed. It doesn’t work in private mode. And I helped a little in joomla. Nothing great till now.

That’s indeed very weird. Can you try force-loading the path?

So make build 2>&1 would become $ynh_go_load_path make build 2>&1

I tried it and didn’t work

2022-03-25 22:42:43,956: DEBUG - /opt/yunohost/dex /var/cache/yunohost/**********_tmp_work_dirs/**********_1aww56bn/scripts
2022-03-25 22:42:43,957: DEBUG - + PATH=/opt/goenv/versions/1.18.0/bin:/opt/goenv/shims:/opt/goenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin make build
2022-03-25 22:42:43,979: DEBUG - ./install: ligne 121: PATH=/opt/goenv/versions/1.18.0/bin:/opt/goenv/shims:/opt/goenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin: Aucun fichier ou dossier de ce type
2022-03-25 22:42:43,981: DEBUG - + ynh_exit_properly
2022-03-25 22:42:43,982: DEBUG - + local exit_code=127

Yes I confirm !
I have tried and got the exact same error

Any idea from an experienced Go user on how to solve that problem ?

I have no idea about go, but I read this last time we talked about it

The “new way” link says that gopath is not needed anymore since 1.11. I don’t understand but it may help you

Yes I’ve read that too.
But to do as they propose, the “new way”, would require some big changes since I would have to download the source, and then move it to the “go” location before building. Probably not ideal for a Yunohost app.

Bad news is that the Missing $GOPATH error also happens on Bullseye, and even worse : it happens in command line, which is not the case for Buster

My problem has just been fixed by @yalh76

Thank you so much :pray: !

1 Like