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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interfacer won't build #515

Open
martin-braun opened this issue Feb 12, 2024 · 5 comments
Open

Interfacer won't build #515

martin-braun opened this issue Feb 12, 2024 · 5 comments

Comments

@martin-braun
Copy link

I'm trying to build the interfacer under Debian Bookworm with latest available Go 1.19.8.

 ~/.workspaces/browsh/browsh/interfacer 1 > go build -o browsh cmd/browsh/main.go
src/browsh/firefox.go:26:12: pattern browsh.xpi: no matching files found
src/browsh/browsh.go:7:2: package log/slog is not in GOROOT (/usr/lib/go-1.19/src/log/slog)

Why is my build not working please?

@tombh
Copy link
Member

tombh commented Feb 12, 2024

I'm realising now that I didn't run the latest release process properly. So there's some things missing in the Github Release assets, eg the browsh.xpi file. I've manually added it now. So to get it locally, run:

mkdir webext/dist/web-ext-artifacts
./ctl.sh bundle_production_webextension

@martin-braun
Copy link
Author

martin-braun commented Feb 13, 2024

@tombh Ah now I begin to understand. browsh needs the signed xpi in its build process for auto-installing it when launching Firefox. If I want to build everything, I need to supply such xpi in any case, but I can choose to start Firefox with the dev build of the web extension when using web-ext run, right?

In this case, I'd like to propose to get the browsh build to work without the xpi. It would be nice if I could simply have it compile with a zip that resulted from web-ext build. Surely this dev build would require Firefox to run its extensions in developer mode. Maybe auto-installation could be disabled altogether when the xpi is missing. After all, I can use web-ext run to test working changes on the extension itself.

Having a result of building project A that needs to be signed by a third party as build dependency on project B is such an oddity. It can be blocking, confusing and causes the project to not be fully self-contained. Essentially you can't build the project without Mozilla signing your extension first.

Please correct me, if I'm missing something, still learning.

Also, about this:

src/browsh/browsh.go:7:2: package log/slog is not in GOROOT (/usr/lib/go-1.19/src/log/slog)

The shipped Go version on Debian seems to be too old 1.19.8. log/slog was introduced in 1.21. Unfortunate, given the fact that browsh is most effectively used on a remote machine, building and using it on a stable one would be preferred.

Anyways, I got Go via nix-env, will update the docs and refer this issue as well, soon.

@tombh
Copy link
Member

tombh commented Feb 15, 2024

First let me say that this is the most care somebody has shown about Browsh's code in years! 🥹 So thank you.

Having a result of building project A that needs to be signed by a third party as build dependency on project B is such an oddity. It can be blocking, confusing and causes the project to not be fully self-contained. Essentially you can't build the project without Mozilla signing your extension first.

I totally agree! I'm afraid it's been a long time since I've really looked into all this, so I could be missing something too. I can't ever remember needing to build Browsh with a non-signed webextension, it certainly sounds useful, but I just seem to remember that web-ext run was always enough.

Anyway, ultimately I'd love to actually completely move away from webextensions altogether. Literally the only reason that Browsh uses a webextension is for the fast screenshotting! I don't remember the exact details, but using normal JS to screenshot a webpage is either impossible or impractically inefficient. This is where https://github.com/fathyb/carbonyl wins hands down, it uses the actual browsers internals to get the visuals of the webpage. Maybe Firefox has changed its APIs since I last worked on Browsh? Maybe there are other ways to get a visual snapshot of the page? That would solve soooo many problems.

And regarding Debian's version of Go, sorry about that, I didn't realise. I would have thought twice about introducing slog if I'd know that. Does using Browsh's ./ctl.sh install_golang command install Go okay on your Debian?

Thanks again for your thoughtful comment!

@gl-yziquel
Copy link

I tried to build browsh from source. Experienced the same kind of issues as above. Had to mimick the github actions workflow to get something building. This ticket will likely help, since the out of the box instructions to build browsh do not work. Incidentally, I get a "Webextension not connected. Message not sent" error in the debug logs on my first bootup of browsh. (Firefox is also being built from source).

Wish the build instructions were a bit more explicit. I'll read this ticket in more details to understand what I did wrong.

@gl-yziquel
Copy link

I tried to build browsh from source. Experienced the same kind of issues as above. Had to mimick the github actions workflow to get something building. This ticket will likely help, since the out of the box instructions to build browsh do not work. Incidentally, I get a "Webextension not connected. Message not sent" error in the debug logs on my first bootup of browsh. (Firefox is also being built from source).

Wish the build instructions were a bit more explicit. I'll read this ticket in more details to understand what I did wrong.

OK. This github issue provided the missing information to get it built and running. It now works.

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

3 participants