summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/rangehttpserver
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2023-07-31 18:56:19 +0200
committerRobert Hensing <robert@roberthensing.nl>2023-07-31 18:56:19 +0200
commite6e16bc11843045aa95dbe1194f9bf0cbb083e0e (patch)
tree2ea83018b8dd8c70d8d911ecf566a4fbb76a640e /pkgs/development/python-modules/rangehttpserver
parent470d17ea5d8f6f9f3035bbaaa6d5123352d9b0ed (diff)
lib.getExe: Do not make assumptions about the main program
Before this commit, getExe assumes that if `meta.mainProgram` is unset, it has a main program that's named after the package name. While this is probable, it leads to a bad error when the assumption does not hold. If the user called `getExe` themselves, they might narrow down the location of the assumption quite easily, but if that's not the case, they'll have to go down the rabbit hole to figure out what went wrong. For example, a NixOS module may use `lib.getExe` on a package-typed option which is then used in the system configuration. This then typically leads to a failure *after* deployment, which is bad, and it's quite likely that the user will debug the package output contents before digging through the NixOS module, which is bad. Furthermore the `getExe` call is rather inconspicuous as it does not contain something like "/bin/foo", which is bad. Also modules can be hard to read for a newbie, which is bad. All of this can be avoided by requiring `meta.mainProgram`. Many packages already have the attribute, and I would expect 80% of `getExe` usages to be covered by 20% of packages, because plenty of packages aren't used with `getExe` anyway. Finally we could make an effort to set `mainProgram` semi-automatically using `nix-index`.
Diffstat (limited to 'pkgs/development/python-modules/rangehttpserver')
0 files changed, 0 insertions, 0 deletions