The following warning should be looked in to
```
CMake Warning at CMakeLists.txt:9 (message):
In 1.11 releases, we are releasing experimental alternative building
mode.By setting -DLEGACY_MODE=OFF you can test our advances in modern CMake
building and provide early feedback. The legacy support is set by default
in 1.11, when you complete build updating scripts please update the build
flags as mentioned in README.md and set -DLEGACY_BUILD=OFF. The legacy
support will be removed at 1.12.0 release.
```
Co-authored-by: Tobias Mayer <tobim@fastmail.fm>
with structuredAttrs lists will be bash arrays which cannot be exported
which will be a issue with some patches and some wrappers like cc-wrapper
this makes it clearer that NIX_CFLAGS_COMPILE must be a string as lists
in env cause a eval failure
`-Werror` flag usually causes build failures due to minor changes in
compiler versions. They might be useful for developers themselves but
are rarely useful for distributions.
For example right now `aws-sdk-cpp` fails to compile on `gcc-13` due to
a `gcc` infelicity: https://gcc.gnu.org/PR107488
While this concrete instance is a compiler bug generally `-Werror` makes
users' lives harder. Specific `-Werror=<foo>` are better way to prevent
certain classes of bugs.
The change removes blanket `-Werror` with a `substituteInPlace` call.
After update in PR #169281 (commit f394cc6c5) it won't build:
https://hydra.nixos.org/build/174323623
It's still unreliable, as even the i686 builds that succeeded on Hydra
won't build for me locally, shooting over the 32-bit memory limit.
But I trust this will unblock the nixos-unstable channel on Hydra.
The TARGET_ARCH cmake variable is used to specify the host OS, which if
unspecified defaults to the same as the build OS. So to crosscompile
aws-sdk-cpp to another OS, the TARGET_ARCH variable must be specified.
Example hydra failure: https://hydra.nixos.org/build/149290553/nixlog/3
We need to propagate the Security framework to avoid getting
ld: file not found: /System/Library/Frameworks/Security.framework/Versions/A/Security for architecture x86_64
on linking aws-sdk-cpp libraries.
AWS's SDK by default tries to prepend its install root to each of the
library paths; this obviously fails with the absolute paths that Nix
gives it. Worse, it computes the installation root by walking up the
filesystem from its cmake file, so even if the AWSSDK_ROOT_DIR is
explicitly set to the root directory, it gets replaced with the path
to the derivation's dev output.
This is all fixed with a patch to the cmake files that generate the
installed configuration.
Once this is fixed, it *still* doesn't work because the export
generator built into cmake insists on adding `$out/include` to the
header search path; when importing this configuration in another
package, cmake will fail because `$out/include` doesn't exist (After
all, it was relocated by a fixup hook). A small postFixupHook will
recreate the directory and make cmake happy.
Removing debug info to fix hydra build.
The debug symbols alone are around ~1.8GB in size, which
makes the closure combined with the other two outputs
too large.