You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For work, we have some non-conventional build targets including ARMv7 (and soon AArch64), as well as bog-standard i686-linux that we deploy NixOS and Nix closures onto. (I also personally have a nice AArch64 device that could run Nix well.) We just got done doing a big deployment to them, and something like this would have been a nice alternative over nix-copy-closure.
However, the parser implicitly models the operating system (maybe better to say Platform, to follow meta.platform in mkDerivation) as an ADT with only X86_64_Linux and X86_64_Darwin targets.
I think this should be extended at the very least, but here's another hair-brained suggestion: just make it a free form string, and warn on an "unusual" platform target?
For example, you could take a lesson from arcanist from Phabricator, where if an 'unusual' build target does not match a list of known ones, you simply suggest it was mistyped. For extra bonus points, you could also calculate the levenshtein distance to the list of known platforms and assume a typo at some threshold. Assuming a theoretical new --platform flag, maybe something like:
$ nix-delegate --platform x86_64-linux ... # works normally
...
$ nix-delegate --platform armv7l-linux ... # works normally
...
$ nix-delegate --platform ppc64le-linux ... # unknown target?
WARNING: platform 'ppc64le-linux' seems unusual (I have not heard of it), but proceeding anyway...
...
$ nix-delegate --platform aaarch64-linux ... # oops, typo
WARNING: platform 'aaarch64-linux' seems unusual; maybe you meant 'aarch64-linux'? Proceeding anyway...
A default list of built-in recognized platforms might look like:
platforms =
[ "i686-linux"
, "x86_64-linux"
, "x86_64-darwin"
, "armv7l-linux"-- maybe some extras, like 'armv6hf-linux' for raspbian/raspberry pi?
, "aarch64-linux"
]
The text was updated successfully, but these errors were encountered:
I would also of course make nix-delegate output any warnings in LARGE, BOLD letters with an ANSI color code on the platform names, to make it pretty and so the user doesn't miss it.
For work, we have some non-conventional build targets including ARMv7 (and soon AArch64), as well as bog-standard
i686-linux
that we deploy NixOS and Nix closures onto. (I also personally have a nice AArch64 device that could run Nix well.) We just got done doing a big deployment to them, and something like this would have been a nice alternative overnix-copy-closure
.However, the parser implicitly models the operating system (maybe better to say
Platform
, to followmeta.platform
inmkDerivation
) as an ADT with onlyX86_64_Linux
andX86_64_Darwin
targets.I think this should be extended at the very least, but here's another hair-brained suggestion: just make it a free form string, and warn on an "unusual" platform target?
For example, you could take a lesson from
arcanist
from Phabricator, where if an 'unusual' build target does not match a list of known ones, you simply suggest it was mistyped. For extra bonus points, you could also calculate the levenshtein distance to the list of known platforms and assume a typo at some threshold. Assuming a theoretical new--platform
flag, maybe something like:A default list of built-in recognized platforms might look like:
The text was updated successfully, but these errors were encountered: