-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws-sdk-cpp does not work with cmake's find_package() #70075
Comments
Thank you for your contributions.
|
This is still important to me. I have this error when trying to package https://github.com/aws/amazon-s3-plugin-for-pytorch which relies on aws-sdk-cpp:
generated by { buildPythonPackage
, fetchFromGitHub
, lib
, cmake
, aws-sdk-cpp
}:
let
custom-aws-sdk-cpp = (aws-sdk-cpp.override {
apis = ["s3" "transfer"];
customMemoryManagement = false;
});
in
buildPythonPackage rec {
pname = "amazon-s3-plugin-for-pytorch";
version = "0.0.1";
src = fetchFromGitHub {
owner = "aws";
repo = pname;
rev = "38284c8a5e92be3bbf47b08e8c90d94be0cb79e7";
sha256 = "0lww4y3mq854za95hi4y441as4r3h3q0nyrpgj4j6kjk58gijbx9";
};
nativeBuildInputs = [
cmake
];
buildInputs = [
custom-aws-sdk-cpp
];
checkInputs = [
];
propagatedBuildInputs = [
];
meta = with lib; {
description = "S3-plugin is a high performance PyTorch dataset library to efficiently access datasets stored in S3 buckets.";
homepage = "https://github.com/aws/amazon-s3-plugin-for-pytorch";
license = licenses.asl20;
maintainers = with maintainers; [];
};
} |
This is a workaround I found that fixes the issue: let
aws-sdk-cpp-s3-transfer = (aws-sdk-cpp.override {
apis = ["s3" "transfer"];
}).overrideAttrs (oldAttrs: {
# Fixes cmake issue in dependent packages (see https://github.com/NixOS/nixpkgs/issues/70075)
postPatch = oldAttrs.postPatch + ''
substituteInPlace cmake/AWSSDKConfig.cmake \
--replace "\''${AWSSDK_DEFAULT_ROOT_DIR}/\''${AWSSDK_INSTALL_INCLUDEDIR}" "\''${AWSSDK_INSTALL_INCLUDEDIR}"
'';
});
in
mkDerivation { ... } Hence, it should be possible to trace back to the root problem from here: if (AWSSDK_ROOT_DIR)
find_file(AWSSDK_CORE_HEADER_FILE Aws.h
"${AWSSDK_ROOT_DIR}/${AWSSDK_INSTALL_INCLUDEDIR}/aws/core"
"${AWSSDK_DEFAULT_ROOT_DIR}/${AWSSDK_INSTALL_INCLUDEDIR}/aws/core"
)
else()
find_file(AWSSDK_CORE_HEADER_FILE Aws.h
"${AWSSDK_DEFAULT_ROOT_DIR}/${AWSSDK_INSTALL_INCLUDEDIR}/aws/core"
"/usr/${AWSSDK_INSTALL_INCLUDEDIR}/aws/core"
"/usr/local/${AWSSDK_INSTALL_INCLUDEDIR}/aws/core"
"C:/Progra~1/AWSSDK/${AWSSDK_INSTALL_INCLUDEDIR}/aws/core"
"C:/Program Files/AWSSDK/${AWSSDK_INSTALL_INCLUDEDIR}/aws/core"
"C:/Program Files/aws-cpp-sdk-all/${AWSSDK_INSTALL_INCLUDEDIR}/aws/core"
"C:/Program Files (x86)/aws-cpp-sdk-all/${AWSSDK_INSTALL_INCLUDEDIR}/aws/core"
"C:/AWSSDK/${AWSSDK_INSTALL_INCLUDEDIR}/aws/core"
)
endif() I'm not clear as to why/how these variables end up different when using |
Seems like ff3f5bb#diff-bb198faaa0e40668ef72c8354e3e431dfd37426d45229c6f3c6fa3174652d570 removes the code in Partially rolling back this change appears as though it might solve the problem. |
@jmklix does your aws/aws-sdk-cpp#2630 make the patch unnecessary? After comparing yes it does |
Describe the bug
Attempting to use aws-sdk-cpp in nix-shell for development of a cmake-based project causes the build to fail with the following error:
To Reproduce
Steps to reproduce the behavior:
CMakeLists.txt
with the following contents:nix-shell && mkdir build && cd build && cmake ..
Expected behavior
Cmake would complete without error
Metadata
Please run
nix run nixpkgs.nix-info -c nix-info -m
and paste the result.Maintainer information:
The text was updated successfully, but these errors were encountered: