Hi Tollef, On Tue, Jan 05, 2016 at 09:16:17AM +0100, Tollef Fog Heen wrote: > An easier way here seems to be to either ask dpkg what architecture > pkg-config has (dpkg -s pkg-config | awk '$1 == "Architecture:" { print > $2 }') or teach pkg-config to report its own architecture. The latter > is a bit more work, but quite doable, the former seems quite easy, and I > think, pretty robust?
I respectfully disagree with that assessment. Running dpkg and awk in the cross wrapper adds considerable complexity at runtime. A failure in this mode of operation will be very hard to diagnose whereas a failure to produce a cross wrapper that knows pkg-config's architecture is easy to diagnose (by looking at the generated file). Can we please not add this complexity to the runtime? As a compromise, we could move such parsing into the dpkg hook, where it still could break at installation time, but could not incur weired failure modes at runtime. We need to be careful here as pkg-config is usually not configured when the dpkg hook is run. Given that you can immediately see when something went wrong by looking at the binary package with my patch applied, I believe that it is more robust than both aforementioned approaches. Yet, if robustness is not the aim, we can go another route. I was initially optimizing for two goals: technical correctness and keeping the run time complexity low. What are your goals? Helmut