-
Notifications
You must be signed in to change notification settings - Fork 277
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
Add support for local Wasm plugins #3349
Changes from 8 commits
6cd7178
a17f1c1
58c9e6f
ccdb801
1fb09fe
4084811
cc42495
5cd84ca
0b4321b
ce2c42a
8ef1070
fa26987
9429c87
9634e9d
3498241
767897e
a69da63
87676c0
e42f48d
88ffcb7
85c7fbc
6a45022
41f8127
2be37aa
0aacd54
a073aed
e3c329d
e1c589b
f035402
4e161a6
cec3d6d
64764cc
75fe87e
a5e1c43
799658a
41705f9
4bfc10c
d09ddbf
2fc5bf6
1415eea
dc11fe5
086a6ce
6ab5dcb
5e8e9d9
1866ce1
ef0d8a8
6c4030a
bf634a5
423e044
ef1a275
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,6 +103,10 @@ var ( | |
// | ||
// Normalized. | ||
v3CacheModuleLockRelDirPath = normalpath.Join("v3", "modulelocks") | ||
// v3CachePluginsRelDirPath is the relative path to the plugins cache directory in its newest iteration. | ||
// | ||
// Normalized. | ||
v3CachePluginsRelDirPath = normalpath.Join("v3", "plugins") | ||
) | ||
|
||
// NewModuleDataProvider returns a new ModuleDataProvider while creating the | ||
|
@@ -135,6 +139,17 @@ func NewCommitProvider(container appext.Container) (bufmodule.CommitProvider, er | |
) | ||
} | ||
|
||
// CreatePluginCacheDir creates the cache directory for plugins. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't seem correct. See above. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Renamed to |
||
// | ||
// This is used by the [bufwasm.WithLocalCacheDir] option. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed |
||
func CreatePluginCacheDir(container appext.Container) (string, error) { | ||
if err := createCacheDir(container.CacheDirPath(), v3CachePluginsRelDirPath); err != nil { | ||
return "", err | ||
} | ||
fullCacheDirPath := normalpath.Join(container.CacheDirPath(), v3CachePluginsRelDirPath) | ||
return fullCacheDirPath, nil | ||
} | ||
|
||
// newWKTStore returns a new bufwktstore.Store while creating the required cache directories. | ||
func newWKTStore(container appext.Container) (bufwktstore.Store, error) { | ||
if err := createCacheDir(container.CacheDirPath(), v3CacheWKTRelDirPath); err != nil { | ||
|
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.
This documentation isn't really accurate. If you dive down into the code, it appears you are passing this to the
bufwasm.Runtime
, which then happens to use this as a cache for some WASM compilation that is happening. Given the naming, and the documentation here, I would expect this to be a cache of downloaded plugins from the BSR, which it is not. This is effectively an implementation-specific cache.This should be
v3/wasmruntime
or the like, whatever makes sense, and the documentation should reflect what this is specifically used for.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.
Renamed and updated the docs to the
v3/wasmruntime
dir.