Cargo.lock is ignored in repository #6048
-
Hello. I am currently attempting to create reproducible builds for the jan app using nix. This file has become essential for building Rust packages with nix, and Tauri also recommends committing it. @louis-menlo |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi @turtton, we did try adding lock files to the codebase, but then every commit ended up with lock file changes that were irrelevant and made the code change significantly harder to review. However, they're essential for build caching and the issues you mentioned. We're planning to have the CI/DevOps handle this automatically instead of manually pushing the changes. |
Beta Was this translation helpful? Give feedback.
-
I've also been trying to build this from source for NixOS today and, ran into the same problem. I tried to get around it, for now, by generating a Cargo.lock file, but then ran into a further problem with that a MPC server, (rpmpc, something like that) uses a workspace and NixOS had difficulty with that. But, I think if there was a Cargo.lock in the repo a different NixOS build tool would have "just worked" - I'm not very familiar with rust. I can run 0.6.4 using the AppImage, using the below packaging, but it'd be much nicer to build it straight from source. {
lib,
pkgs,
}:
let
pname = "jan";
version = "0.6.4";
src = pkgs.fetchurl {
url = "https://github.com/menloresearch/jan/releases/download/v${version}/Jan_${version}_amd64.AppImage";
hash = "sha256-bMsJtu43UGJQ/ZyFsqTofym3BhT/mjvcnAV13WTXDSI=";
};
appimageContents = pkgs.appimageTools.extractType1 { inherit pname version src; };
in
pkgs.appimageTools.wrapType1 {
inherit pname version src;
extraInstallCommands = ''
install -Dm444 ${appimageContents}/usr/share/applications/Jan.desktop $out/share/applications/jan.desktop
substituteInPlace $out/share/applications/jan.desktop \
--replace-fail 'Exec=Jan' 'Exec=jan'
cp -r ${appimageContents}/usr/share/icons $out/share
'';
meta = {
changelog = "https://github.com/menloresearch/jan/releases/tag/v${version}";
description = "Jan is an open source alternative to ChatGPT that runs 100% offline on your computer";
homepage = "https://github.com/menloresearch/jan";
license = lib.licenses.agpl3only;
mainProgram = "jan";
maintainers = [ ];
platforms = with lib.systems.inspect; patternLogicalAnd patterns.isLinux patterns.isx86_64;
};
} Btw the latest working nixpkg is 0.5.6: https://github.com/NixOS/nixpkgs/blob/nixos-25.05/pkgs/by-name/ja/jan/package.nix; there's an "unstable" one https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/by-name/ja/jan/package.nix but I think these are autogenerated. |
Beta Was this translation helpful? Give feedback.
Hi @turtton, we did try adding lock files to the codebase, but then every commit ended up with lock file changes that were irrelevant and made the code change significantly harder to review. However, they're essential for build caching and the issues you mentioned. We're planning to have the CI/DevOps handle this automatically instead of manually pushing the changes.