NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.29k stars 14.27k forks source link

Package request: Zen Browser #327982

Open BlueFox1616 opened 4 months ago

BlueFox1616 commented 4 months ago

Zen zen-browser

Project description

User-friendly, useful, mods that increase usability can be added from the zen-mods mod store, a customizable browser, features that can be searched for in a browser for the end user, easy to use thanks to the shortcut key assignment feature, theme-store, frequently used progressive web apps, add-on apps, websites can be easily accessed thanks to the sidebar feature, can be viewed as a mobile page. container, work spaces, zen-mods, window management by creating multiple tab sections in a window, sidebar feature.

Metadata

MaxistheSpy commented 2 months ago

ation here to tide you over if desired: https://github.com/heywoodlh/flakes/tree/main/zen-browser

I plan on contributing MacOS support to the very nice Zen-Browser flake

Huge thanks for this, your a lifesaver im relatively new to all this so its helpful to see an example and to not have to worry about setting up the browser. some of your other flakes are very helpful. didn't know you could configure 1password app settings like that.

heywoodlh commented 2 months ago

@MaxistheSpy glad you find it useful. Please note that as other comments have said my flake isn't ideal as it doesn't build the app from source, it merely extracts the release provided by the Zen Browser project.

However, I'm not extremely concerned in that regard -- I'd rather Nix do the fetching and extracting of the archive until the process of building from source with Nix is more ironed out 😄

JohnRTitor commented 2 months ago

Can we not skip the hard part and let buildMozillaMach handle this like https://github.com/NixOS/nixpkgs/pull/332242/files?

jalil-salame commented 2 months ago

Zen doesn't use the same build system as Firefox, it uses a wrapper on top of it(? as I understand) called surfer.

AFAIK buildMozillaMach won't work without re-implementing surfer or patching it heavily

JosueGalRe commented 2 months ago

But I keep getting a compile error:

00:22:03 21:46.07 error: failed to run custom build command for `webrender v0.62.0 (/build/source/engine/gfx/wr/webrender)`
00:22:03 21:46.07 note: To improve backtraces for build dependencies, set the CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.
00:22:03 21:46.07 Caused by:
00:22:03 21:46.07   process didn't exit successfully: `/build/source/engine/obj-x86_64-pc-linux-gnu/instrumented/release/build/webrender-b970e3a2973cd0b8/build-script-build` (signal: 4, SIGILL: illegal instruction)

It seems https://github.com/zen-browser/desktop/blob/1.0.0-a.32/src/gfx/wr/webrender/src/picture-rs.patch causes build failure. I'v opened an issue in Zen Browser repo: zen-browser/desktop#1070

Update: Error disappears once I bumped to 1.0.0-a.34. But I get into a new trouble now.

With my new drv, build will stucks with following logs:

00:26:16 console.warn: services.settings: Ignoring preference override of remote settings server
00:26:16 console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
00:26:17 Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libEGL missing (t=0.407796) [GFX1-]: glxtest: libEGL missing
00:26:17 Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libEGL missing (t=0.407796) |[1][GFX1-]: glxtest: libGL.so.1 missing (t=0.407796) [GFX1-]: glxtest: libGL.so.1 missing
00:26:17 Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libEGL missing (t=0.407796) |[1][GFX1-]: glxtest: libGL.so.1 missing (t=0.407796) |[2][GFX1-]: No GPUs detected via PCI
00:26:17  (t=0.407796) [GFX1-]: No GPUs detected via PCI
00:26:17 console.error: (new TypeError("NetworkError: Network request failed", "resource://services-settings/Utils.sys.mjs", 236))
00:26:17 console.error: (new TypeError("NetworkError: Network request failed", "resource://services-settings/Utils.sys.mjs", 236))
00:26:17 JavaScript error: resource://gre/modules/ShortcutUtils.sys.mjs, line 142: TypeError: keyAttribute is null
00:26:17 console.info: "ZenThemeImporter: Initiating Zen theme importer"
00:26:17 console.info: "ZenThemeImporter: Zen theme imported"
00:26:17 console.info: "ZenWorkspaces: Initializing ZenWorkspaces..."
00:26:17 JavaScript error: chrome://browser/content/tabbrowser/tabbrowser.js, line 6115: TypeError: this.selectedBrowser is undefined
00:26:17 JavaScript error: , line 0: uncaught exception: undefined
00:26:17 JavaScript error: , line 0: uncaught exception: undefined
00:26:17 JavaScript error: , line 0: TypeError: NetworkError when attempting to fetch resource.
00:26:17 JavaScript error: , line 0: TypeError: NetworkError when attempting to fetch resource.
00:26:17 JavaScript error: , line 0: TypeError: NetworkError when attempting to fetch resource.
00:26:17 JavaScript error: , line 0: TypeError: NetworkError when attempting to fetch resource.
00:26:17 JavaScript error: , line 0: TypeError: NetworkError when attempting to fetch resource.
00:26:17 JavaScript error: resource:///modules/sessionstore/SessionStore.sys.mjs, line 2749: TypeError: browser is undefined
00:26:17 console.info: "ZenThemeModifier: init browser layout"
00:26:17 console.info: "Zen CKS: Initializing shortcuts"
00:26:17 console.info: "Zen CKS: Shortcut changed"
00:26:17 JavaScript error: chrome://browser/content/tabbrowser/tabbrowser.js, line 6122: TypeError: this.selectedTab is undefined
00:26:17 Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libEGL missing (t=0.407796) |[1][GFX1-]: glxtest: libGL.so.1 missing (t=0.407796) |[2][GFX1-]: No GPUs detected via PCI
00:26:17  (t=0.407796) |[3][GFX1-]: Failed GL context creation for WebRender: 0 (t=0.94779) [GFX1-]: Failed GL context creation for WebRender: 0
00:26:17 Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libEGL missing (t=0.407796) |[1][GFX1-]: glxtest: libGL.so.1 missing (t=0.407796) |[2][GFX1-]: No GPUs detected via PCI
00:26:17  (t=0.407796) |[3][GFX1-]: Failed GL context creation for WebRender: 0 (t=0.94779) |[4][GFX1-]: FEATURE_FAILURE_WEBRENDER_INITIALIZE_UNSPECIFIED (t=0.94779) [GFX1-]: FEATURE_FAILURE_WEBRENDER_INITIALIZE_UNSPECIFIED
00:26:17 Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libEGL missing (t=0.407796) |[1][GFX1-]: glxtest: libGL.so.1 missing (t=0.407796) |[2][GFX1-]: No GPUs detected via PCI
00:26:17  (t=0.407796) |[3][GFX1-]: Failed GL context creation for WebRender: 0 (t=0.94779) |[4][GFX1-]: FEATURE_FAILURE_WEBRENDER_INITIALIZE_UNSPECIFIED (t=0.94779) |[5][GFX1-]: Failed to connect WebRenderBridgeChild. isParent=true (t=0.94779) [GFX1-]: Failed to connect WebRenderBridgeChild. isParent=true
00:26:17 Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libEGL missing (t=0.407796) |[1][GFX1-]: glxtest: libGL.so.1 missing (t=0.407796) |[2][GFX1-]: No GPUs detected via PCI
00:26:17  (t=0.407796) |[3][GFX1-]: Failed GL context creation for WebRender: 0 (t=0.94779) |[4][GFX1-]: FEATURE_FAILURE_WEBRENDER_INITIALIZE_UNSPECIFIED (t=0.94779) |[5][GFX1-]: Failed to connect WebRenderBridgeChild. isParent=true (t=0.94779) |[6][GFX1-]: Fallback WR to SW-WR (t=0.94879) [GFX1-]: Fallback WR to SW-WR
00:26:17 JavaScript error: resource:///modules/ReportBrokenSite.sys.mjs, line 389: TypeError: tabbrowser.selectedBrowser is undefined
00:26:17 JavaScript error: chrome://browser/content/tabbrowser/tabbrowser.js, line 6115: TypeError: this.selectedBrowser is undefined
00:26:17 JavaScript error: , line 0: TypeError: NetworkError when attempting to fetch resource.
00:26:17 JavaScript error: , line 0: TypeError: NetworkError when attempting to fetch resource.
00:26:17 JavaScript error: , line 0: TypeError: NetworkError when attempting to fetch resource.
00:26:17 JavaScript error: , line 0: TypeError: NetworkError when attempting to fetch resource.
00:26:17 JavaScript error: , line 0: TypeError: NetworkError when attempting to fetch resource.
00:26:17 JavaScript error: resource:///modules/UrlbarInput.sys.mjs, line 1987: TypeError: WeakMap key undefined must be an object
00:26:18 console.info: "ZenThemeModifier: set tabs max-height to" "378px"

It just keep stuck and doing nothing, I don't know how to deal with this yet.

Did you try to run sh ./scripts/update-en-US-packs.sh, and after that building?

The pipeline should look like this:

pnpm run init (or pnpm bootstrap && pnpm import) && sh ./scripts/update-en-US-packs.sh && pnpm build

Eveeifyeve commented 2 months ago

Zen doesn't use the same build system as Firefox, it uses a wrapper on top of it(? as I understand) called surfer.

AFAIK buildMozillaMach won't work without re-implementing surfer or patching it heavily

But even then you don't need surfer for all of this as it basicly a cli to download firefox to certain paths and build it. with patches, so can't this be implemented without surfer?

FilipeS0usa commented 2 months ago

If someone wants to use zen-browser while the nix package is not developed and deployed, you can use flatpak. I put it running in no time. Just install flatpak on your nixos (documentation).

Here is an example on how to implement flatpak in nixos.

Then do the following command:

flatpak install flathub io.github.zen_browser.zen

After installing you can logout and log back in. And you should have ZenBrowser on your system.

PS: Reminder that this is just a workaround while the package is not done.

kolaente commented 2 months ago

The appimage also works surprisingly well with appimage-run.

While not as clean, maybe a quick way to get this packaged would be to patch the appimage or flatpack and add a package for that?

youwen5 commented 2 months ago

You can already run Zen on NixOS with this flake https://github.com/MarceColl/zen-browser-flake. It runs and patches the binary release. Initially I tried packaging it with the appimage with wrapType2 but it had serious performance issues for me, borderline unusable.

Eveeifyeve commented 2 months ago

I will look into make a package soon!

Eveeifyeve commented 2 months ago

And a PR that should fix this.

Zh40Le1ZOOB commented 2 months ago

But I keep getting a compile error:

00:22:03 21:46.07 error: failed to run custom build command for `webrender v0.62.0 (/build/source/engine/gfx/wr/webrender)`
00:22:03 21:46.07 note: To improve backtraces for build dependencies, set the CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.
00:22:03 21:46.07 Caused by:
00:22:03 21:46.07   process didn't exit successfully: `/build/source/engine/obj-x86_64-pc-linux-gnu/instrumented/release/build/webrender-b970e3a2973cd0b8/build-script-build` (signal: 4, SIGILL: illegal instruction)

It seems https://github.com/zen-browser/desktop/blob/1.0.0-a.32/src/gfx/wr/webrender/src/picture-rs.patch causes build failure. I'v opened an issue in Zen Browser repo: zen-browser/desktop#1070

Update: Error disappears once I bumped to 1.0.0-a.34. But I get into a new trouble now. With my new drv, build will stucks with following logs:

00:26:16 console.warn: services.settings: Ignoring preference override of remote settings server
00:26:16 console.warn: services.settings: Allow by setting MOZ_REMOTE_SETTINGS_DEVTOOLS=1 in the environment
00:26:17 Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libEGL missing (t=0.407796) [GFX1-]: glxtest: libEGL missing
00:26:17 Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libEGL missing (t=0.407796) |[1][GFX1-]: glxtest: libGL.so.1 missing (t=0.407796) [GFX1-]: glxtest: libGL.so.1 missing
00:26:17 Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libEGL missing (t=0.407796) |[1][GFX1-]: glxtest: libGL.so.1 missing (t=0.407796) |[2][GFX1-]: No GPUs detected via PCI
00:26:17  (t=0.407796) [GFX1-]: No GPUs detected via PCI
00:26:17 console.error: (new TypeError("NetworkError: Network request failed", "resource://services-settings/Utils.sys.mjs", 236))
00:26:17 console.error: (new TypeError("NetworkError: Network request failed", "resource://services-settings/Utils.sys.mjs", 236))
00:26:17 JavaScript error: resource://gre/modules/ShortcutUtils.sys.mjs, line 142: TypeError: keyAttribute is null
00:26:17 console.info: "ZenThemeImporter: Initiating Zen theme importer"
00:26:17 console.info: "ZenThemeImporter: Zen theme imported"
00:26:17 console.info: "ZenWorkspaces: Initializing ZenWorkspaces..."
00:26:17 JavaScript error: chrome://browser/content/tabbrowser/tabbrowser.js, line 6115: TypeError: this.selectedBrowser is undefined
00:26:17 JavaScript error: , line 0: uncaught exception: undefined
00:26:17 JavaScript error: , line 0: uncaught exception: undefined
00:26:17 JavaScript error: , line 0: TypeError: NetworkError when attempting to fetch resource.
00:26:17 JavaScript error: , line 0: TypeError: NetworkError when attempting to fetch resource.
00:26:17 JavaScript error: , line 0: TypeError: NetworkError when attempting to fetch resource.
00:26:17 JavaScript error: , line 0: TypeError: NetworkError when attempting to fetch resource.
00:26:17 JavaScript error: , line 0: TypeError: NetworkError when attempting to fetch resource.
00:26:17 JavaScript error: resource:///modules/sessionstore/SessionStore.sys.mjs, line 2749: TypeError: browser is undefined
00:26:17 console.info: "ZenThemeModifier: init browser layout"
00:26:17 console.info: "Zen CKS: Initializing shortcuts"
00:26:17 console.info: "Zen CKS: Shortcut changed"
00:26:17 JavaScript error: chrome://browser/content/tabbrowser/tabbrowser.js, line 6122: TypeError: this.selectedTab is undefined
00:26:17 Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libEGL missing (t=0.407796) |[1][GFX1-]: glxtest: libGL.so.1 missing (t=0.407796) |[2][GFX1-]: No GPUs detected via PCI
00:26:17  (t=0.407796) |[3][GFX1-]: Failed GL context creation for WebRender: 0 (t=0.94779) [GFX1-]: Failed GL context creation for WebRender: 0
00:26:17 Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libEGL missing (t=0.407796) |[1][GFX1-]: glxtest: libGL.so.1 missing (t=0.407796) |[2][GFX1-]: No GPUs detected via PCI
00:26:17  (t=0.407796) |[3][GFX1-]: Failed GL context creation for WebRender: 0 (t=0.94779) |[4][GFX1-]: FEATURE_FAILURE_WEBRENDER_INITIALIZE_UNSPECIFIED (t=0.94779) [GFX1-]: FEATURE_FAILURE_WEBRENDER_INITIALIZE_UNSPECIFIED
00:26:17 Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libEGL missing (t=0.407796) |[1][GFX1-]: glxtest: libGL.so.1 missing (t=0.407796) |[2][GFX1-]: No GPUs detected via PCI
00:26:17  (t=0.407796) |[3][GFX1-]: Failed GL context creation for WebRender: 0 (t=0.94779) |[4][GFX1-]: FEATURE_FAILURE_WEBRENDER_INITIALIZE_UNSPECIFIED (t=0.94779) |[5][GFX1-]: Failed to connect WebRenderBridgeChild. isParent=true (t=0.94779) [GFX1-]: Failed to connect WebRenderBridgeChild. isParent=true
00:26:17 Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libEGL missing (t=0.407796) |[1][GFX1-]: glxtest: libGL.so.1 missing (t=0.407796) |[2][GFX1-]: No GPUs detected via PCI
00:26:17  (t=0.407796) |[3][GFX1-]: Failed GL context creation for WebRender: 0 (t=0.94779) |[4][GFX1-]: FEATURE_FAILURE_WEBRENDER_INITIALIZE_UNSPECIFIED (t=0.94779) |[5][GFX1-]: Failed to connect WebRenderBridgeChild. isParent=true (t=0.94779) |[6][GFX1-]: Fallback WR to SW-WR (t=0.94879) [GFX1-]: Fallback WR to SW-WR
00:26:17 JavaScript error: resource:///modules/ReportBrokenSite.sys.mjs, line 389: TypeError: tabbrowser.selectedBrowser is undefined
00:26:17 JavaScript error: chrome://browser/content/tabbrowser/tabbrowser.js, line 6115: TypeError: this.selectedBrowser is undefined
00:26:17 JavaScript error: , line 0: TypeError: NetworkError when attempting to fetch resource.
00:26:17 JavaScript error: , line 0: TypeError: NetworkError when attempting to fetch resource.
00:26:17 JavaScript error: , line 0: TypeError: NetworkError when attempting to fetch resource.
00:26:17 JavaScript error: , line 0: TypeError: NetworkError when attempting to fetch resource.
00:26:17 JavaScript error: , line 0: TypeError: NetworkError when attempting to fetch resource.
00:26:17 JavaScript error: resource:///modules/UrlbarInput.sys.mjs, line 1987: TypeError: WeakMap key undefined must be an object
00:26:18 console.info: "ZenThemeModifier: set tabs max-height to" "378px"

It just keep stuck and doing nothing, I don't know how to deal with this yet.

Did you try to run sh ./scripts/update-en-US-packs.sh, and after that building?

The pipeline should look like this:

pnpm run init (or pnpm bootstrap && pnpm import) && sh ./scripts/update-en-US-packs.sh && pnpm build

It works, but there are still some problems. I don't know how to write installPhase for Zen Browser 🫤. I'm busy and not at home now but I'll try to copy Firefox's derivation for Zen Browser on my phone.

Zh40Le1ZOOB commented 2 months ago

I successfully built it. Now there are only some small problems (multi language support). I'll open a PR later.

The13Bot commented 2 months ago

I've been waiting 2 weeks for the flake to be updated, really hope either the flake gets updated or Zen becomes a Nixpkg

Daholli commented 2 months ago

I've been waiting 2 weeks for the flake to be updated, really hope either the flake gets updated or Zen becomes a Nixpkg

You do know that you can just fork it and update it yourself it is too slow paced for you? Using your own flake as input is not that hard

ch4og commented 2 months ago

I've been waiting 2 weeks for the flake to be updated, really hope either the flake gets updated or Zen becomes a Nixpkg

There is a PR that is open for more than a week and you can use it as your input

deftdawg commented 2 months ago

I've been waiting 2 weeks for the flake to be updated, really hope either the flake gets updated or Zen becomes a Nixpkg

There is a PR that is open for more than a week and you can use it as your input

Quick install into nix profile to play with it:

nix profile install github:ch4og/zen-browser-flake
zen

The Zen folks release fast, the PRs already out of date :fast_forward: , but thanks. :beer:

nezia1 commented 2 months ago

I've been waiting 2 weeks for the flake to be updated, really hope either the flake gets updated or Zen becomes a Nixpkg

There is a PR that is open for more than a week and you can use it as your input

Quick install into nix profile to play with it:


nix profile install github:ch4og/zen-browser-flake

zen

The Zen folks release fast, the PRs already out of date :fast_forward: , but thanks. :beer:

It just got updated by the person who made the PR! Try using this fork as your input: https://github.com/ch4og/zen-browser-flake

In the future, if the release is too slow for you, it's very simple to update:

  1. Fork the flake
  2. Update the version to its new version number
  3. Update the hash using nix-prefetch tools

You can see how they did it in the PR. It's a few lines to change :)

EDIT: That is of course implying that the build system didn't change in the mean-time. If it does, you'd have to obviously rewrite it but for 99% of cases it should be just fine.

Zh40Le1ZOOB commented 1 month ago

I successfully built it. Now there are only some small problems (multi language support). I'll open a PR later.

I need help for multi locale support. With my latest drv, Zen Browser can be build successfully and install correctly, but doesn't support any locale than en_US. By looking at Zen's CI Workflow code and Surfer's source code, I found that Surfer may merges locales in package command.

// Merge language packs
for (const locale of await getLocales()) {
  const arguments_ = ["build", `merge-${locale}`]

  log.info(
    `Packaging \`${config.binaryName}\` with args ${JSON.stringify(
      arguments_.slice(1, 0)
    )}...`
  )

  await dispatch(machPath, arguments_, ENGINE_DIR, true)
}

https://github.com/zen-browser/surfer/blob/main/src/commands/package.ts#L63-L74

But when I run surfer package in derivation, Mach reports error below.

00:00:24 Error running mach:
00:00:24     mach build merge-ar
00:00:24 The error occurred in the implementation of the invoked mach command.
00:00:24 This should never occur and is likely a bug in the implementation of that
00:00:24 command.
00:00:24 You can invoke ``./mach busted`` to check if this issue is already on file. If it
00:00:24 isn't, please use ``./mach busted file build`` to report it. If ``./mach busted`` is
00:00:24 misbehaving, you can also inspect the dependencies of bug 1543241.
00:00:24 If filing a bug, please include the full output of mach, including this error
00:00:24 message.
00:00:24 The details of the failure are as follows:
00:00:24 Exception: Cannot specify targets (['merge-ar']) in MOZ_PGO=1 builds
00:00:24   File "/build/source/engine/python/mozbuild/mozbuild/build_commands.py", line 173, in build
00:00:24     raise Exception("Cannot specify targets (%s) in MOZ_PGO=1 builds" % what)

MOZ_PGO=1 has been written in Zen's build config, but Zen's CI doesn't fail.

Zh40Le1ZOOB commented 1 month ago

I successfully built it. Now there are only some small problems (multi language support). I'll open a PR later.

I need help for multi locale support. With my latest drv, Zen Browser can be build successfully and install correctly, but doesn't support any locale than en_US. By looking at Zen's CI Workflow code and Surfer's source code, I found that Surfer may merges locales in package command.

// Merge language packs
for (const locale of await getLocales()) {
  const arguments_ = ["build", `merge-${locale}`]

  log.info(
    `Packaging \`${config.binaryName}\` with args ${JSON.stringify(
      arguments_.slice(1, 0)
    )}...`
  )

  await dispatch(machPath, arguments_, ENGINE_DIR, true)
}

https://github.com/zen-browser/surfer/blob/main/src/commands/package.ts#L63-L74

But when I run surfer package in derivation, Mach reports error below.

00:00:24 Error running mach:
00:00:24     mach build merge-ar
00:00:24 The error occurred in the implementation of the invoked mach command.
00:00:24 This should never occur and is likely a bug in the implementation of that
00:00:24 command.
00:00:24 You can invoke ``./mach busted`` to check if this issue is already on file. If it
00:00:24 isn't, please use ``./mach busted file build`` to report it. If ``./mach busted`` is
00:00:24 misbehaving, you can also inspect the dependencies of bug 1543241.
00:00:24 If filing a bug, please include the full output of mach, including this error
00:00:24 message.
00:00:24 The details of the failure are as follows:
00:00:24 Exception: Cannot specify targets (['merge-ar']) in MOZ_PGO=1 builds
00:00:24   File "/build/source/engine/python/mozbuild/mozbuild/build_commands.py", line 173, in build
00:00:24     raise Exception("Cannot specify targets (%s) in MOZ_PGO=1 builds" % what)

MOZ_PGO=1 has been written in Zen's build config, but Zen's CI doesn't fail.

Firefox's source code docs already mentioned l10n-merge, but why drv gots errors while Zen's CI success?

Zh40Le1ZOOB commented 1 month ago

I successfully built it. Now there are only some small problems (multi language support). I'll open a PR later.

I need help for multi locale support. With my latest drv, Zen Browser can be build successfully and install correctly, but doesn't support any locale than en_US. By looking at Zen's CI Workflow code and Surfer's source code, I found that Surfer may merges locales in package command.

// Merge language packs
for (const locale of await getLocales()) {
  const arguments_ = ["build", `merge-${locale}`]

  log.info(
    `Packaging \`${config.binaryName}\` with args ${JSON.stringify(
      arguments_.slice(1, 0)
    )}...`
  )

  await dispatch(machPath, arguments_, ENGINE_DIR, true)
}

https://github.com/zen-browser/surfer/blob/main/src/commands/package.ts#L63-L74

But when I run surfer package in derivation, Mach reports error below.

00:00:24 Error running mach:
00:00:24     mach build merge-ar
00:00:24 The error occurred in the implementation of the invoked mach command.
00:00:24 This should never occur and is likely a bug in the implementation of that
00:00:24 command.
00:00:24 You can invoke ``./mach busted`` to check if this issue is already on file. If it
00:00:24 isn't, please use ``./mach busted file build`` to report it. If ``./mach busted`` is
00:00:24 misbehaving, you can also inspect the dependencies of bug 1543241.
00:00:24 If filing a bug, please include the full output of mach, including this error
00:00:24 message.
00:00:24 The details of the failure are as follows:
00:00:24 Exception: Cannot specify targets (['merge-ar']) in MOZ_PGO=1 builds
00:00:24   File "/build/source/engine/python/mozbuild/mozbuild/build_commands.py", line 173, in build
00:00:24     raise Exception("Cannot specify targets (%s) in MOZ_PGO=1 builds" % what)

MOZ_PGO=1 has been written in Zen's build config, but Zen's CI doesn't fail.

export MOZ_PGO=0 doesn't fix this issue.

youwen5 commented 1 month ago

Can we get this building on aarch64-linux? Apparently some minor changes can be made to get it working.

Eveeifyeve commented 1 month ago

I successfully built it. Now there are only some small problems (multi language support). I'll open a PR later.

I need help for multi locale support. With my latest drv, Zen Browser can be build successfully and install correctly, but doesn't support any locale than en_US. By looking at Zen's CI Workflow code and Surfer's source code, I found that Surfer may merges locales in package command.

// Merge language packs
for (const locale of await getLocales()) {
  const arguments_ = ["build", `merge-${locale}`]

  log.info(
    `Packaging \`${config.binaryName}\` with args ${JSON.stringify(
      arguments_.slice(1, 0)
    )}...`
  )

  await dispatch(machPath, arguments_, ENGINE_DIR, true)
}

https://github.com/zen-browser/surfer/blob/main/src/commands/package.ts#L63-L74

But when I run surfer package in derivation, Mach reports error below.

00:00:24 Error running mach:
00:00:24     mach build merge-ar
00:00:24 The error occurred in the implementation of the invoked mach command.
00:00:24 This should never occur and is likely a bug in the implementation of that
00:00:24 command.
00:00:24 You can invoke ``./mach busted`` to check if this issue is already on file. If it
00:00:24 isn't, please use ``./mach busted file build`` to report it. If ``./mach busted`` is
00:00:24 misbehaving, you can also inspect the dependencies of bug 1543241.
00:00:24 If filing a bug, please include the full output of mach, including this error
00:00:24 message.
00:00:24 The details of the failure are as follows:
00:00:24 Exception: Cannot specify targets (['merge-ar']) in MOZ_PGO=1 builds
00:00:24   File "/build/source/engine/python/mozbuild/mozbuild/build_commands.py", line 173, in build
00:00:24     raise Exception("Cannot specify targets (%s) in MOZ_PGO=1 builds" % what)

MOZ_PGO=1 has been written in Zen's build config, but Zen's CI doesn't fail.

alsa-lib is only available on linux systems

universish commented 1 month ago

@BlueFox1616 , Could you please update the issue content:

**Zen**
zen-browser

**Project description**

User-friendly, useful, mods that increase usability can be added from the zen-mods mod store, a customizable browser, features that can be searched for in a browser for the end user, easy to use thanks to the shortcut key assignment feature, theme-store, frequently used progressive web apps, add-on apps, websites can be easily accessed thanks to the sidebar feature, can be viewed as a mobile page. container, work spaces, zen-mods, window management by creating multiple tab sections in a window, sidebar feature.

**Metadata**

* homepage URL: https://zen-browser.app/
* github homepage URL: https://github.com/zen-browser
* source URL: https://github.com/zen-browser/desktop
* flathub source URL: https://github.com/zen-browser/flatpak
* download URLs: https://github.com/zen-browser/desktop/releases ; flatpak: https://github.com/zen-browser/flatpak/releases ; flathub: https://flathub.org/apps/io.github.zen_browser.zen ; https://zen-browser.app/download
* license: MPL-2, MIT
* platforms: gnu-linux libre, gnu-linux, darwin (apple's), net (ms's)
* OSs: gnu-linux libre distros, gnu-linux distros, windows, macOS
* distribution formats of software: appimage, dmg, exe, flatpak, mar (portable, mozilla archive)
BlueFox1616 commented 3 weeks ago

i just edited it

theotheroracle commented 3 weeks ago

not sure if it's better to ask here or the PR, but will native messaging hosts like firefoxpwa be supported by this ?

mahyarmirrashed commented 4 days ago

Following up on this, does this mean that we need to create a nixpkg for surfer so that we can use that to build Zen? What's the current state of this?

youwen5 commented 4 days ago

@mahyarmirrashed It just means we need to package the surfer tool so that it can be used in the build phase of Zen.

We have actually completed packaging everything over in #347222 and it's just waiting to be merged.