Commit Graph

6 Commits

Author SHA1 Message Date
Archit Gupta
d75cae80fa makeBinaryWrapper: fix read past NUL
When setting a prefix for a path-like environment variable, the
deduplication code in set_env_prefix reads past the NUL byte at the end
of the env val and into the next entry. This corrupts the resultant env
value with data from the next env var, or other data sitting after it.
2026-08-04 17:46:56 -07:00
Arne Keller
74ebbfaf0b make{Script; Binary}Wrapper: log if target file does not exist (#384765) 2026-07-04 10:59:59 +00:00
Martino Fontana
5a23a56feb makeBinaryWrapper: If prefix/suffix already exists, remove the original
This is mostly meant for `wrapQtApps`, which is why it's implemented only for `makeBinaryWrapper`.
Qt apps are often launched on top of each other, creating a problem: many of the paths in `XDG_DATA_PATHS`, `QT_PLUGIN_PATH` and `NIXPKGS_QT6_QML_IMPORT_PATH` become duplicated, and these envars are already massive by themselves without this problem.
Starting KDE Plasma, and most paths are seen twice. Open Konsole, and it becomes three times. If it was opened with CTRL+ALT+T, four times.
Why is this a problem?
- The more these paths are duplicated, the slower it becomes to copy the envars, and for the programs to parse them.
- Some programs are buggy and malfunction if the environment variable block is too big. For instance, the EA App (via Wine) is unable to launch games if there are more than 32768 characters in the block, a number easily surpassable due to this problem.
- It's ugly typing `env` and seeing this massive wall of duplicated paths.

Because there is no reason for the same path to appear multiple times, this change removes a path if it's already in the list, adding it back to the start or the end.
2025-10-11 17:09:23 +02:00
BirdeeHub
7b9c6346ff makeWrapper: --add-flag and --append-flag arguments
also:

manual: differences in makeWrapper implementations better explained

Update pkgs/by-name/ma/makeBinaryWrapper/make-binary-wrapper.sh

Co-authored-by: Naïm Camille Favier <n@monade.li>

Update pkgs/by-name/ma/makeBinaryWrapper/make-binary-wrapper.sh

Co-authored-by: Naïm Camille Favier <n@monade.li>

Update pkgs/by-name/ma/makeBinaryWrapper/make-binary-wrapper.sh

Co-authored-by: Naïm Camille Favier <n@monade.li>

Update pkgs/build-support/setup-hooks/make-wrapper.sh

Co-authored-by: Naïm Camille Favier <n@monade.li>

Update pkgs/build-support/setup-hooks/make-wrapper.sh

Co-authored-by: Naïm Camille Favier <n@monade.li>

Update pkgs/build-support/setup-hooks/make-wrapper.sh

Co-authored-by: Naïm Camille Favier <n@monade.li>

Update pkgs/by-name/ma/makeBinaryWrapper/make-binary-wrapper.sh

Co-authored-by: Naïm Camille Favier <n@monade.li>

Update pkgs/build-support/setup-hooks/make-wrapper.sh

Co-authored-by: Naïm Camille Favier <n@monade.li>

Update pkgs/by-name/ma/makeBinaryWrapper/make-binary-wrapper.sh

Co-authored-by: Naïm Camille Favier <n@monade.li>

Update pkgs/build-support/setup-hooks/make-wrapper.sh

Co-authored-by: Naïm Camille Favier <n@monade.li>
2025-04-25 12:57:29 -07:00
Wroclaw
bd17e51cde makeBinaryWrapper: warn if target file does not exist 2025-02-24 14:25:17 +01:00
aleksana
571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00