-
-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
cargo-tauri.hook: init #335751
base: master
Are you sure you want to change the base?
cargo-tauri.hook: init #335751
Conversation
I will look into documenting this as this will help build Tauri apps on nix |
And soon bun I am looking to make a hook |
They seem good. I don't have time unfortunately to review and help with the rest of the PR :/, so I'm unsubscribing myself. |
Editorconfig check is failing Apart from that this looks good. |
because of newer rust version, I got an error when testing treedome. I can make a fix and a quick release, can the new release be in this PR? |
Not really sure what to do there as it's failing due to an icon file
As said in the original comment, this is due to the
Once the update for treedome is merged into master, you can run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The editorconfig CI test giving an error is the canary in the coalmine. nixpkgs should have as little vendored code as possible, and it's quite easy to make a repository for this example app.
aa6497a
to
3b40326
Compare
I will look into using this once I have a bun install/config hook. |
3b40326
to
4ada60a
Compare
Fixed merge conflict with #335795. Treedome should build now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm out of my depth on the actual content of this PR (the hook creation and use). I do like this PR and hope to learn more.
Here's a review of the content as I read through it this morning.
# Tauri doesn't respect $CARGO_TARGET_DIR, but does respect the cargo | ||
# argument...but that doesn't respect `--target`, so we have to use the | ||
# config file | ||
# https://github.com/tauri-apps/tauri/issues/10190 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closed as "completed" on July 10th 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, --target-dir
is respected now. What I'm trying to explain here though is that when it's used alongside the target --target
argument, it still tries to use target/<release type>
as the target directory even though cargo
will actually output to target/<target triple>/<release type>
I should probably make a patch/issue for this at some point, I just haven't had the time lol
pkgs/by-name/ca/cargo-tauri/hook.sh
Outdated
@@ -0,0 +1,125 @@ | |||
# shellcheck shell=bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CC @tie for bash review (I'm slowly building my skills but they are a master)
I'm currently updating Initially, I just overwrote it locally: |
Shouldn't this be fixed as well? tauri-apps/tauri#8679 |
I think that would be something more for upstream, as the only way we can "fix" this is by applying the patch linked in the issue to each package. I wouldn't consider that in scope for this PR though, and probably not a good idea to do across the board as messing with vendored deps should generally be avoided. For packages that need the patch, they should be able to use it in |
d88a68a
to
f85bef5
Compare
Looks like #335619 sniped you. Mind rebasing? |
also we should make this a generic or something as there is dev version of cargo tauri cli. |
And we should start supporting it as it's in rc. |
Not sure how well that would work given the breaking changes now (and possibly in the future) in Tauri v2 from v1. I would consider these hooks to be pretty flexible though, so if there aren't that many breaking changes related to the build I doubt it would be hard to implement
That would be best in another PR |
https://v2.tauri.app/blog/tauri-2-0-0-release-candidate/ There won't be any breaking changes in RC according to this so I think it's best to do it in this pr tbh |
I'm talking about the breaking changes from Tauri v1 -> Tauri v2, not breaking changes from the v2 RC to stable
Setting up the v2 packaging here initially is definitely out of scope IMO given how large this PR already is. The hooks created here will -- at the very least -- require changes to most dependencies like using GTK4 over 3, a newer webkitgtk ABI, etc. I think it would be much better to make those changes later on once we get this merged and actually package v2 |
Specifically: - Tighten dependencies by only listing what's needed to build - Better sorting things - Adding `meta.changelog`
f85bef5
to
993d64b
Compare
Description of changes
With Tauri apps getting more popular and added to nixpkgs, I believe it's time we share the tedious setup required to build them. This PR introduces a new hook in
cargo-tauri.hook
that builds on top ofrustPlatform.buildRustPackage
(or more acurately, its hooks) to leverage Tauri's bundling feature in creating packages. It is compatible with the two primary targets we share with Tauri -- Linux and macOS -- and meant to be used alongside pre-existing tools for package managers such as npm, pnpm, and yarnSupersedes #318117
CC @doronbehar for changes made to
yarnConfigHook
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Result of
nixpkgs-review
run on x86_64-linux 15 packages failed to build:
24 packages built:
powerdns-admin
has been broken since 574c80aThe remaining packages fail with the now infamous
Add a 👍 reaction to pull requests you find important.