-
Notifications
You must be signed in to change notification settings - Fork 107
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
Extension installation rework #4066
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
4d4941a
update
acquamarin 628e6e7
update1
acquamarin 0eec0a8
update
acquamarin 0d464e8
update
acquamarin cf1eacc
update
acquamarin 8ca03b7
update
acquamarin 44ae72f
update
acquamarin 1d89c55
Fix CI build and upload process (#4110)
mewim c66fad7
Add Windows path for DuckDB
mewim 1112e09
Turn off static libs for DuckDB
mewim 9092090
update
acquamarin 22d2471
Fix dlopen functions
acquamarin e5a6510
Run clang-format
acquamarin 31c8e5c
update
acquamarin 7e4dd06
update
acquamarin 896a049
update
acquamarin a657933
update
acquamarin ed81116
update
acquamarin bb4fb2e
change makefile
acquamarin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include "duckdb_installer.h" | ||
|
||
extern "C" { | ||
// Because we link against the static library on windows, we implicitly inherit KUZU_STATIC_DEFINE, | ||
// which cancels out any exporting, so we can't use KUZU_API. | ||
#if defined(_WIN32) | ||
#define INIT_EXPORT __declspec(dllexport) | ||
#else | ||
#define INIT_EXPORT __attribute__((visibility("default"))) | ||
#endif | ||
INIT_EXPORT void install(kuzu::main::ClientContext* context) { | ||
kuzu::duckdb_extension::DuckDBInstaller installer{"duckdb"}; | ||
installer.install(context); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include "duckdb_installer.h" | ||
|
||
#include "common/file_system/virtual_file_system.h" | ||
#include "duckdb_extension.h" | ||
#include "main/client_context.h" | ||
|
||
namespace kuzu { | ||
namespace duckdb_extension { | ||
|
||
void DuckDBInstaller::install(main::ClientContext* context) { | ||
auto loaderFileRepoInfo = extension::ExtensionUtils::getExtensionLoaderRepoInfo(extensionName); | ||
auto localLoaderFilePath = | ||
extension::ExtensionUtils::getLocalPathForExtensionLoader(context, extensionName); | ||
tryDownloadExtensionFile(context, loaderFileRepoInfo, localLoaderFilePath); | ||
|
||
for (auto& dependencyLib : DuckDBExtension::DEPENDENCY_LIB_FILES) { | ||
auto dependencyLibWithSuffix = extension::ExtensionUtils::appendLibSuffix(dependencyLib); | ||
auto localDependencyLibPath = | ||
extension::ExtensionUtils::getLocalPathForSharedLib(context, dependencyLibWithSuffix); | ||
if (!context->getVFSUnsafe()->fileOrPathExists(localDependencyLibPath)) { | ||
auto dependencyLibRepoInfo = | ||
extension::ExtensionUtils::getSharedLibRepoInfo(dependencyLibWithSuffix); | ||
tryDownloadExtensionFile(context, dependencyLibRepoInfo, localDependencyLibPath); | ||
} | ||
} | ||
} | ||
|
||
} // namespace duckdb_extension | ||
} // namespace kuzu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include "duckdb_loader.h" | ||
|
||
#include "duckdb_extension.h" | ||
|
||
namespace kuzu { | ||
namespace duckdb_extension { | ||
|
||
void DuckDBLoader::loadDependency(main::ClientContext* context) { | ||
for (auto& dependencyLib : DuckDBExtension::DEPENDENCY_LIB_FILES) { | ||
auto dependencyLibWithSuffix = extension::ExtensionUtils::appendLibSuffix(dependencyLib); | ||
auto dependencyLibPath = | ||
extension::ExtensionUtils::getLocalPathForSharedLib(context, dependencyLibWithSuffix); | ||
auto dependencyLoader = extension::ExtensionLibLoader(extensionName, dependencyLibPath); | ||
} | ||
} | ||
|
||
} // namespace duckdb_extension | ||
} // namespace kuzu | ||
|
||
extern "C" { | ||
// Because we link against the static library on windows, we implicitly inherit KUZU_STATIC_DEFINE, | ||
// which cancels out any exporting, so we can't use KUZU_API. | ||
#if defined(_WIN32) | ||
#define INIT_EXPORT __declspec(dllexport) | ||
#else | ||
#define INIT_EXPORT __attribute__((visibility("default"))) | ||
#endif | ||
INIT_EXPORT void load(kuzu::main::ClientContext* context) { | ||
kuzu::duckdb_extension::DuckDBLoader loader{"duckdb"}; | ||
loader.loadDependency(context); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#pragma once | ||
#include "extension/extension_installer.h" | ||
|
||
namespace kuzu { | ||
namespace duckdb_extension { | ||
|
||
class DuckDBInstaller : public extension::ExtensionInstaller { | ||
public: | ||
explicit DuckDBInstaller(const std::string extensionName) | ||
: ExtensionInstaller{std::move(extensionName)} {} | ||
|
||
void install(main::ClientContext* context) override; | ||
}; | ||
|
||
} // namespace duckdb_extension | ||
} // namespace kuzu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#pragma once | ||
#include "extension/extension_loader.h" | ||
|
||
namespace kuzu { | ||
namespace duckdb_extension { | ||
|
||
class DuckDBLoader final : public extension::ExtensionLoader { | ||
public: | ||
explicit DuckDBLoader(std::string extensionName) | ||
: extension::ExtensionLoader{std::move(extensionName)} {} | ||
|
||
void loadDependency(main::ClientContext* context) override; | ||
}; | ||
|
||
} // namespace duckdb_extension | ||
} // namespace kuzu |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove asan from extension test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duckdb doesn't compile with asan, if we compile with asan linking with duckdb will cause a linking error in windows.