| 18 Jul 2025 |
emily | here's the relevant pieces of code https://docs.rs/pkg-config/0.3.32/src/pkg_config/lib.rs.html#638-659, https://docs.rs/pkg-config/0.3.32/src/pkg_config/lib.rs.html#606-630, https://docs.rs/pkg-config/0.3.32/src/pkg_config/lib.rs.html#672-679 | 20:49:06 |
emily | is it a sign of maturity in my cross-compilation journey that my typical reaction has gone from "I'm confused" to "the people who wrote this build logic are confused" | 20:49:48 |
dramforever | to confuse your enemies you must first confuse yourself | 20:50:16 |
dramforever | so is this for everything? or just for rust? | 20:50:44 |
emily | we're just doing Rust here | 20:52:21 |
emily | but we're setting it in the pkg-config hook to accommodate the Rust thing | 20:52:28 |
emily | which uses variables nobody else does, for fun | 20:52:36 |
emily | and I think assigns different semantics to them than others, for fun | 20:52:44 |
dramforever | okay so HOST_PKG_CONFIG is just doing nothing...? | 20:52:49 |
emily | well it's doing the same thing as PKG_CONFIG in non-cross builds | 20:53:03 |
emily | for cross builds it's never used, I guess. | 20:53:11 |
emily | or well | 20:53:21 |
dramforever | ah | 20:53:22 |
emily | it's used in the build scripts | 20:53:23 |
emily | or, uh | 20:53:27 |
emily | I mean, it's used when targeting … augh | 20:53:35 |
emily | you know what I mean. hopefully | 20:53:41 |
dramforever | wanna get angry? linux makefiles take HOSTPKG_CONFIG | 20:53:56 |
emily | it seems like the library will fundamentally only think about the host ("target") platform | 20:54:22 |
emily | when run in a build script for a package targeting that host platform | 20:54:30 |
emily | even though there seems like reason you might want to care about build platform deps in such a build script too | 20:54:42 |
dramforever | wait so if i'm building a build script dep | 20:55:04 |
dramforever | what do i get for "HOST" and "TARGET" | 20:55:16 |
emily | the same thing | 20:55:20 |
emily | the build platform | 20:55:25 |
emily | so it will notice they're the same and look at HOST_PKG_CONFIG and PKG_CONFIG_[buildPlatform] | 20:55:38 |
emily | I really need to find the person who came up with build/host/target and take them to the Hague or something | 20:56:03 |
emily | I don't care what they call build and host as long as they rename target to like if-you-are-not-writing-a-compiler-and-you-say-this-word-you-have-made-a-mistake | 20:56:37 |
dramforever | so if non-cross, it looks at HOST_PKG_CONFIG and PKG_CONFIG_underscored_triple | 20:57:12 |
emily | (dashed triple too! but yes) | 20:57:26 |