Skip to content

Darwin package update support #513

Description

@eclairevoyant

Downloading src and updating it should generally be system-agnostic, and we should try to run automatic updates even if the target package is not for a linux platform.
Example: https://nixpkgs-update-logs.nix-community.org/itsycal/ never updates because:

Details
Running nixpkgs-update (https://nix-community.org/update-bot/) with UPDATE_INFO: itsycal 0 -> 1
attrpath: itsycal
Checking auto update branch...
[version] 
[version] skipping because derivation has updateScript
[rustCrateVersion] 
[rustCrateVersion] No cargoHash found
[golangModuleVersion] 
[golangModuleVersion] Not a buildGoModule package with vendorHash
[npmDepsVersion] 
[npmDepsVersion] No npmDepsHash
[updateScript] 
[updateScript] Success
[updateScript] 
Going to be running update for following packages:
 - itsycal-0.15.8

Press Enter key to continue...
Running update for:
Enqueuing group of 1 packages
 - itsycal-0.15.8: UPDATING ...
 - itsycal-0.15.8: DONE.

Packages updated!

Diff after rewrites:
diff --git a/pkgs/by-name/it/itsycal/package.nix b/pkgs/by-name/it/itsycal/package.nix
index a2473445bedf..2f6941f9d4d5 100644
--- a/pkgs/by-name/it/itsycal/package.nix
+++ b/pkgs/by-name/it/itsycal/package.nix
@@ -6,11 +6,11 @@
 
 stdenvNoCC.mkDerivation (finalAttrs: {
   pname = "itsycal";
-  version = "0.15.8";
+  version = "0.15.10";
 
   src = fetchzip {
     url = "https://itsycal.s3.amazonaws.com/Itsycal-${finalAttrs.version}.zip";
-    hash = "sha256-zo77yCfIzb2ZmExJslQ64GPQqakXtiRmm0UYEgj+3eM=";
+    hash = "sha256-6+E/4SbRIChJMc2VDMNYongsAWRtcFxtIj6lvTiexrU=";
   };
 
   installPhase = ''

No auto update branch exists
Received ExitFailure 1 when running
Raw command: nix-build --option sandbox true --arg config "{ allowUnfree = true; allowAliases = false; }" --arg overlays "[ ]" -A itsycal
Received ExitFailure 1 when running
Raw command: nix --extra-experimental-features nix-command log -f . itsycal --arg config "{ allowUnfree = true; allowAliases = false; }" --arg overlays "[ ]"
Standard output:

error:
       � in the condition of the assert statement
         at /var/cache/nixpkgs-update/worker/worktree/itsycal/lib/customisation.nix:447:9:
          446|       drvPath =
          447|         assert condition;
             |         ^
          448|         drv.drvPath;

       � while evaluating the attribute 'handled'
         at /var/cache/nixpkgs-update/worker/worktree/itsycal/pkgs/stdenv/generic/check-meta.nix:737:9:
          736|         valid = "no";
          737|         handled = handled;
             |         ^
          738|       };

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: Package �itsycal-0.15.10� in /var/cache/nixpkgs-update/worker/worktree/itsycal/pkgs/by-name/it/itsycal/package.nix:31 is not available on the requested hostPlatform:
         hostPlatform.system = "x86_64-linux"
         package.meta.platforms = [
           "x86_64-darwin"
           "aarch64-darwin"
         ]
         package.meta.badPlatforms = [ ]
       , refusing to evaluate.

       a) To temporarily allow packages that are unsupported for this system, you can use an environment variable
          for a single invocation of the nix tools.

            $ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1

          Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake,
                then pass `--impure` in order to allow use of environment variables.

       b) For `nixos-rebuild` you can set
         { nixpkgs.config.allowUnsupportedSystem = true; }
       in configuration.nix to override this.

       c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
         { allowUnsupportedSystem = true; }
       to ~/.config/nixpkgs/config.nix.

This forced me to create this PR: NixOS/nixpkgs#482647

This is distinct from #390 which asks for a darwin package directly exposed in this project's flake.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions