···11791180### `wrapProgram` \<executable\> \<makeWrapperArgs\> {#fun-wrapProgram}
11811182-Convenience function for `makeWrapper` that replaces `<\executable\>` with a wrapper that executes the original program. It takes all the same arguments as `makeWrapper`, except for `--inherit-argv0` (used by the `makeBinaryWrapper` implementation) and `--argv0` (used by both `makeWrapper` and `makeBinaryWrapper` wrapper implementations).
11831184If you will apply it multiple times, it will overwrite the wrapper file and you will end up with double wrapping, which should be avoided.
1185
···11791180### `wrapProgram` \<executable\> \<makeWrapperArgs\> {#fun-wrapProgram}
11811182+Convenience function for `makeWrapper` that replaces `<executable>` with a wrapper that executes the original program. It takes all the same arguments as `makeWrapper`, except for `--inherit-argv0` (used by the `makeBinaryWrapper` implementation) and `--argv0` (used by both `makeWrapper` and `makeBinaryWrapper` wrapper implementations).
11831184If you will apply it multiple times, it will overwrite the wrapper file and you will end up with double wrapping, which should be avoided.
1185
+5
nixos/doc/manual/release-notes/rl-2311.section.md
···53- [Honk](https://humungus.tedunangst.com/r/honk), a complete ActivityPub server with minimal setup and support costs.
54 Available as [services.honk](#opt-services.honk.enable).
550056## Backward Incompatibilities {#sec-release-23.11-incompatibilities}
5758- The `boot.loader.raspberryPi` options have been marked deprecated, with intent for removal for NixOS 24.11. They had a limited use-case, and do not work like people expect. They required either very old installs ([before mid-2019](https://github.com/NixOS/nixpkgs/pull/62462)) or customized builds out of scope of the standard and generic AArch64 support. That option set never supported the Raspberry Pi 4 family of devices.
···115- PHP now defaults to PHP 8.2, updated from 8.1.
116117- The ISC DHCP package and corresponding module have been removed, because they are end of life upstream. See https://www.isc.org/blogs/isc-dhcp-eol/ for details and switch to a different DHCP implementation like kea or dnsmasq.
000118119- `odoo` now defaults to 16, updated from 15.
120
···53- [Honk](https://humungus.tedunangst.com/r/honk), a complete ActivityPub server with minimal setup and support costs.
54 Available as [services.honk](#opt-services.honk.enable).
5556+- [NNCP](http://www.nncpgo.org/). Added nncp-daemon and nncp-caller services. Configuration is set with [programs.nncp.settings](#opt-programs.nncp.settings) and the daemons are enabled at [services.nncp](#opt-services.nncp.caller.enable).
57+58## Backward Incompatibilities {#sec-release-23.11-incompatibilities}
5960- The `boot.loader.raspberryPi` options have been marked deprecated, with intent for removal for NixOS 24.11. They had a limited use-case, and do not work like people expect. They required either very old installs ([before mid-2019](https://github.com/NixOS/nixpkgs/pull/62462)) or customized builds out of scope of the standard and generic AArch64 support. That option set never supported the Raspberry Pi 4 family of devices.
···117- PHP now defaults to PHP 8.2, updated from 8.1.
118119- The ISC DHCP package and corresponding module have been removed, because they are end of life upstream. See https://www.isc.org/blogs/isc-dhcp-eol/ for details and switch to a different DHCP implementation like kea or dnsmasq.
120+121+- `prometheus-unbound-exporter` has been replaced by the Let's Encrypt maintained version, since the previous version was archived. This requires some changes to the module configuration, most notable `controlInterface` needs migration
122+ towards `unbound.host` and requires either the `tcp://` or `unix://` URI scheme.
123124- `odoo` now defaults to 16, updated from 15.
125
···85#[cfg(test)]
86mod tests {
87 use crate::check_nixpkgs;
088 use anyhow::Context;
89 use std::env;
90 use std::fs;
91- use std::path::PathBuf;
09293 #[test]
94- fn test_cases() -> anyhow::Result<()> {
95- let extra_nix_path = PathBuf::from("tests/mock-nixpkgs.nix");
96-97- // We don't want coloring to mess up the tests
98- env::set_var("NO_COLOR", "1");
99-100- for entry in PathBuf::from("tests").read_dir()? {
101 let entry = entry?;
102 let path = entry.path();
103 let name = entry.file_name().to_string_lossy().into_owned();
104105- if !entry.path().is_dir() {
106 continue;
107 }
108109- // This test explicitly makes sure we don't add files that would cause problems on
110- // Darwin, so we cannot test it on Darwin itself
111- #[cfg(not(target_os = "linux"))]
112- if name == "case-sensitive-duplicate-package" {
113- continue;
114- }
115-116- let mut writer = vec![];
117- check_nixpkgs(&path, vec![&extra_nix_path], &mut writer)
118- .context(format!("Failed test case {name}"))?;
119-120- let actual_errors = String::from_utf8_lossy(&writer);
121 let expected_errors =
122 fs::read_to_string(path.join("expected")).unwrap_or(String::new());
123124- if actual_errors != expected_errors {
125- panic!(
126- "Failed test case {name}, expected these errors:\n\n{}\n\nbut got these:\n\n{}",
127- expected_errors, actual_errors
128- );
129- }
130 }
131 Ok(())
0000000000000000000000000000000000000000000000000000000000132 }
133}
···85#[cfg(test)]
86mod tests {
87 use crate::check_nixpkgs;
88+ use crate::structure;
89 use anyhow::Context;
90 use std::env;
91 use std::fs;
92+ use std::path::Path;
93+ use tempfile::{tempdir, tempdir_in};
9495 #[test]
96+ fn tests_dir() -> anyhow::Result<()> {
97+ for entry in Path::new("tests").read_dir()? {
0000098 let entry = entry?;
99 let path = entry.path();
100 let name = entry.file_name().to_string_lossy().into_owned();
101102+ if !path.is_dir() {
103 continue;
104 }
105000000000000106 let expected_errors =
107 fs::read_to_string(path.join("expected")).unwrap_or(String::new());
108109+ test_nixpkgs(&name, &path, &expected_errors)?;
00000110 }
111 Ok(())
112+ }
113+114+ // We cannot check case-conflicting files into Nixpkgs (the channel would fail to
115+ // build), so we generate the case-conflicting file instead.
116+ #[test]
117+ fn test_case_sensitive() -> anyhow::Result<()> {
118+ let temp_nixpkgs = tempdir()?;
119+ let path = temp_nixpkgs.path();
120+121+ if is_case_insensitive_fs(&path)? {
122+ eprintln!("We're on a case-insensitive filesystem, skipping case-sensitivity test");
123+ return Ok(());
124+ }
125+126+ let base = path.join(structure::BASE_SUBPATH);
127+128+ fs::create_dir_all(base.join("fo/foo"))?;
129+ fs::write(base.join("fo/foo/package.nix"), "{ someDrv }: someDrv")?;
130+131+ fs::create_dir_all(base.join("fo/foO"))?;
132+ fs::write(base.join("fo/foO/package.nix"), "{ someDrv }: someDrv")?;
133+134+ test_nixpkgs(
135+ "case_sensitive",
136+ &path,
137+ "pkgs/by-name/fo: Duplicate case-sensitive package directories \"foO\" and \"foo\".\n",
138+ )?;
139+140+ Ok(())
141+ }
142+143+ fn test_nixpkgs(name: &str, path: &Path, expected_errors: &str) -> anyhow::Result<()> {
144+ let extra_nix_path = Path::new("tests/mock-nixpkgs.nix");
145+146+ // We don't want coloring to mess up the tests
147+ env::set_var("NO_COLOR", "1");
148+149+ let mut writer = vec![];
150+ check_nixpkgs(&path, vec![&extra_nix_path], &mut writer)
151+ .context(format!("Failed test case {name}"))?;
152+153+ let actual_errors = String::from_utf8_lossy(&writer);
154+155+ if actual_errors != expected_errors {
156+ panic!(
157+ "Failed test case {name}, expected these errors:\n\n{}\n\nbut got these:\n\n{}",
158+ expected_errors, actual_errors
159+ );
160+ }
161+ Ok(())
162+ }
163+164+ /// Check whether a path is in a case-insensitive filesystem
165+ fn is_case_insensitive_fs(path: &Path) -> anyhow::Result<bool> {
166+ let dir = tempdir_in(path)?;
167+ let base = dir.path();
168+ fs::write(base.join("aaa"), "")?;
169+ Ok(base.join("AAA").exists())
170 }
171}