20 Dec 2024 |
zowoq | Not sure why but the package updateScript thinks the current version is the newest version. | 04:56:30 |
SymphonySimper | Thanks a ton!, other methods do seem easy compared to nixpkgs-update. | 05:03:33 |
SymphonySimper | * Thanks a ton! other methods do seem easy compared to nixpkgs-update. | 05:03:43 |
Perchun Pak | In reply to @zowoq:matrix.org Not sure why but the package updateScript thinks the current version is the newest version. Isn't it a bug? | 07:24:50 |
zowoq | It isn't a nixpkgs-update bug. | 09:27:36 |
22 Dec 2024 |
| Dimitar joined the room. | 04:58:13 |
23 Dec 2024 |
| 🐰 xiaoxiangmoe joined the room. | 17:00:54 |
🐰 xiaoxiangmoe | Is there any way to trigger r-ryantm bot manually if I know some package has a update recently?
| 17:02:17 |
zowoq | No, it can't be triggered manually. | 22:20:35 |
24 Dec 2024 |
🐰 xiaoxiangmoe | What should I do if I known some package can update? | 18:07:32 |
🐰 xiaoxiangmoe | * What should I do if I know some package can update? | 18:08:38 |
Perchun Pak | In reply to @xiaoxiangmoe:matrix.org What should I do if I know some package can update? You can run its passthru.updateScript manually. Just look at what its value using repl | 18:13:06 |
25 Dec 2024 |
| CJ joined the room. | 14:39:38 |
🐰 xiaoxiangmoe | It seems that nix-update-script will not update GIT_REVISION | 15:57:14 |
🐰 xiaoxiangmoe |  Download image.png | 15:58:09 |
🐰 xiaoxiangmoe | I need get GIT_REVISION in compile | 15:58:22 |
🐰 xiaoxiangmoe | Here | 16:02:45 |
🐰 xiaoxiangmoe | * Here is my pkg definition | 16:02:56 |
🐰 xiaoxiangmoe | * Here is my pkg definition
{
buildGoModule,
fetchFromGitHub,
lib,
nix-update-script,
}:
buildGoModule rec {
pname = "lipo-go";
version = "0.9.3";
src = fetchFromGitHub {
owner = "konoui";
repo = "lipo";
rev = "b7b34565565e3cde8037d1b5ee95dd2bb3579ef1";
# tag = "v${version}";
hash = "sha256-mDx1kQ5FzM4b/1LWccRbaGAt68ez4Bs+7N04aQUUaQg=";
};
env = {
GIT_VERSION = version;
GIT_REVISION = "b7b34565565e3cde8037d1b5ee95dd2bb3579ef1";
};
passthru.updateScript = nix-update-script { };
vendorHash = "sha256-7M6CRxJd4fgYQLJDkNa3ds3f7jOp3dyloOZtwMtCBQk=";
postPatch = ''
# remove the test that requires access permit to /bin
sed -i '/bin := filepath.Join/a info, err := os.Stat(bin);if err != nil || info.Mode().Perm()&0444 != 0444 { continue }' pkg/lipo/archs_test.go
'';
buildPhase = ''
make build VERSION=$GIT_VERSION REVISION=$GIT_REVISION BINARY=$out/bin/lipo
'';
meta = {
description = "This lipo is designed to be compatible with macOS lipo, written in golang.";
homepage = "https://github.com/konoui/lipo";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ xiaoxiangmoe ];
};
}
| 16:03:07 |
Perchun Pak | it is much easier to just set GIT_REVISION to an empty string or a git tag. in case if you want to do it the perfect way, you can write your own update script which calls nix-update and then replaces the GIT_REVISION to the correct one | 18:23:55 |
🐰 xiaoxiangmoe | I found a workaround for this
{
buildGoModule,
fetchFromGitHub,
lib,
nix-update-script,
}:
buildGoModule rec {
pname = "lipo-go";
version = "0.9.3";
src = fetchFromGitHub {
owner = "konoui";
repo = "lipo";
rev = "refs/tags/v${version}";
hash = "sha256-lZgOoN+oibo2h6bw5KHXuiwQvQecTQiqu400sGfaMi0=";
# populate values that require us to use git. By doing this in postFetch we
# can delete .git afterwards and maintain better reproducibility of the src.
leaveDotGit = true;
postFetch = ''
cd "$out"
git rev-parse --short HEAD > "$out/CI_COMMIT_SHORT_SHA"
find "$out" -name .git -print0 | xargs -0 rm -rf
'';
};
passthru.updateScript = nix-update-script { };
vendorHash = "sha256-7M6CRxJd4fgYQLJDkNa3ds3f7jOp3dyloOZtwMtCBQk=";
postPatch = ''
# remove the test that requires access permit to /bin
sed -i '/bin := filepath.Join/a info, err := os.Stat(bin);if err != nil || info.Mode().Perm()&0444 != 0444 { continue }' pkg/lipo/archs_test.go
'';
buildPhase = ''
make build VERSION=${version} REVISION=$(<CI_COMMIT_SHORT_SHA) BINARY=$out/bin/lipo
'';
meta = {
description = "This lipo is designed to be compatible with macOS lipo, written in golang.";
homepage = "https://github.com/konoui/lipo";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ xiaoxiangmoe ];
};
}
| 18:33:14 |
K900 | Absolutely do not do that | 18:33:56 |
K900 | leaveDotGit is not reproducible | 18:34:00 |
K900 | And not consistent | 18:34:02 |
🐰 xiaoxiangmoe | But I must get CI_COMMIT_SHORT_SHA for build | 18:34:24 |
K900 | Get it from the update script then | 18:34:35 |
🐰 xiaoxiangmoe | find "$out" -name .git -print0 | xargs -0 rm -rf
Will keep it reproducible
| 18:34:39 |
K900 | Not guaranteed, technically | 18:35:09 |
🐰 xiaoxiangmoe | Okay | 18:35:19 |
🐰 xiaoxiangmoe | Maybe I should create a PR for fetchFromGitHub to support update both CI_COMMIT_SHA and version ? | 18:36:57 |