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

Package request: gg #299856

Open
colemickens opened this issue Mar 28, 2024 · 3 comments
Open

Package request: gg #299856

colemickens opened this issue Mar 28, 2024 · 3 comments

Comments

@colemickens
Copy link
Member

Project description

gg is a GUI for jj users. It is a Tauri app.

I believe that @khionu is working on some stuff to assist packaging Tauri apps in nixpkgs. I wanted to open a 'tracking' issue, maybe to coordinate efforts and keep an eye on things, rather than constantly bugging them in the JJ Discord.

(jj is awesome, if you're reading this, you might find it neat to checkout!)

Metadata


Add a 👍 reaction to issues you find important.

@chewblacka
Copy link
Contributor

chewblacka commented Apr 5, 2024

New version 0.16.0 has just come out. But my build still fails with:

error: failed to run custom build command for `jj-cli v0.16.0`

Caused by:
  process didn't exit successfully: `/build/source/src-tauri/target/release/build/jj-cli-28b6a5107c2375a4/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at /build/cargo-vendor-dir/jj-cli-0.16.0/build.rs:30:10:
  called `Result::unwrap()` on an `Err` value: CargoMetadata { stderr: "error: failed to get `chrono` as a dependency of package `jj-cli v0.16.0 (/build/cargo-vendor-dir/jj-cli-0.16.0)`
Caused by:  failed to load source for dependency `chrono`
Caused by: Unable to update registry `crates-io`
Caused by: failed to update replaced source registry `crates-io`
Caused by: failed to read root of directory source: /build/cargo-vendor-dir/cargo-vendor-dir
Caused by: No such file or directory (os error 2)

Anyone got any ideas?

@scoiatael
Copy link

I ran into similar problem when trying to add build gg using buildRustPackage.

FWIW I believe problem is in the duplicate cargo-vendor-dir (i.e. /build/cargo-vendor-dir/ is a valid directory, /build/cargo-vendor-dir/cargo-vendor-dir is not).

This is caused by paths in cargo config being relative to config itself (https://doc.rust-lang.org/cargo/reference/config.html#config-relative-paths).

Temporary fix is to patch directory in .cargo/config with an absolute path, but a long-term solution would be to fix

directory = "cargo-vendor-dir"


(Incomplete) solution can be found at https://github.com/scoiatael/dotfiles/blob/master/packages/gg/default.nix - I'm right now stuck at building frontend part, due to problems with rollup missing its native dependencies:

Executing npmBuildHook

> gg@0.15.3 build
> vite build

/private/tmp/nix-build-gg-ui-unstable-0.15.3.drv-22/source/node_modules/rollup/dist/native.js:87
                throw new Error(
                      ^

Error: Cannot find module @rollup/rollup-darwin-arm64. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.

which I believe is tracked here.

@scoiatael
Copy link

Update: I have a working build for 0.15.3 in https://github.com/scoiatael/dotfiles/blob/d5b31462aa930e0d337b80a8aa69382f2496e884/packages/gg/default.nix if anyone needs inspiration.

Unfortunately it took some tweaking of package-lock.json by hand to make it build and so it probably won't work on anything other than darwin-arm64. Probably next step would be to stop using fetchNpmDeps and instead let npm correctly resolve all the dependencies by itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants