CreateDirectoriesRecursive with budged#17530
Closed
carlopi wants to merge 4 commits intoduckdb:v1.3-ossivalisfrom
Closed
CreateDirectoriesRecursive with budged#17530carlopi wants to merge 4 commits intoduckdb:v1.3-ossivalisfrom
carlopi wants to merge 4 commits intoduckdb:v1.3-ossivalisfrom
Conversation
…g too deep Also move error from looking up home folder to actually creating directories in the home folder. Basically listing extensions will now succeed even with non-existing home folder or with explicit extension_directory set in a non-existing folder, while INSTALL of extension will not fail avoiding to create the relevant directory structure.
…existing home directory
Mytherin
reviewed
May 19, 2025
Collaborator
Mytherin
left a comment
There was a problem hiding this comment.
Thanks for the PR!
I think the code in its current state seems like a bit of a band-aid fix that is not very readable. Let's try to avoid pushing changes into the file system unnecessarily and leave CreateDirectoriesRecursive alone - I think we can handle this in a cleaner way in the extension helper. My suggestion would be as follows:
| } | ||
|
|
||
| duckdb::string ExtensionHelper::DefaultExtensionFolder(FileSystem &fs) { | ||
| duckdb::pair<duckdb::string, idx_t> ExtensionHelper::DefaultExtensionFolder(FileSystem &fs) { |
Collaborator
There was a problem hiding this comment.
Perhaps instead of tracking a "how_deep" variable, we can decompose the extension folder we return here:
struct ExtensionFolder {
string base_directory;
vector<string> components;
string GetPath(); // join the components together
};Then we can call CreateDirectoriesRecursive on the components later on in the process.
Contributor
Author
|
This is now outdated, and need some adjusting. If the need arise it can be picked up again. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Currently:
fails like:
while after this PR it succeeds in listing extensions.
This is handy in the context of DuckDB-Wasm, where some custom code-path can be simplified (concept of home_directory is somewhat different).
LOAD and INSTALL path remains similar, in the sense that it needs a valid extension_directory OR a valid home-directory to be set, but now message is not thrown by DefaultExtensionFolder but by CreateDirectoriesRecursive.
Relevant functionality was added in #17316.