Add lockfileContents option to loadPyodide()#5764
Conversation
02d380a to
7de7090
Compare
And also `packageBaseUrl` option: 1. If `lockfileContents` is provided and not `packageBaseUrl`, then in the browser attempting to load a lock entry with a relative path fails. 2. In Node, `packageBaseUrl` is used in place of jsdelivr as the cdn url if passed.
9613447 to
df050ea
Compare
ryanking13
left a comment
There was a problem hiding this comment.
Thanks. Ideally, I would like to deprecate LockFileURL instead of having two different options doing the same thing. WDYT?
|
Thanks for the review @ryanking13! |
I don't think it's worth the churn to deprecate this since it causes no extra maintenance burden. |
does it mean that with content created via I am trying to implement the dance that must work on any pyodide version and this detail seems to be very important to understand properly ... I am not sure |
|
Here are some changes related to the lockfile.
So...
In Pyodide 0.28.1, no.
|
|
@ryanking13 crystal clear, thank you! |
eee6723 to
f124a78
Compare
ryanking13
left a comment
There was a problem hiding this comment.
Thanks. There is a test failure, otherwise looks good to me.
| options_.cdnUrl = | ||
| options_.packageBaseUrl ?? | ||
| `https://cdn.jsdelivr.net/pyodide/v${version}/full/`; |
There was a problem hiding this comment.
Shouldn't it always be https://cdn.jsdelivr.net/pyodide/v${version}/full/, as we use this only for a fallback?
There was a problem hiding this comment.
I am not sure. But:
- the caching system only works if
file_nameis relative, otherwise we will try to download the url every time and won't do any caching - if the user has a custom lock file, then any additional packages definitely won't be available on jsdelivr
So if they are to have any chance of using the caching mechanism with their own lock file, they need to be able to adjust the cdnURL.
| const emscriptenSettings = createSettings(config); | ||
| const API = emscriptenSettings.API; | ||
| API.lockFilePromise = loadLockFile(config.lockFileURL); | ||
| API.lockFilePromise = Promise.resolve(options_.lockFileContents); |
There was a problem hiding this comment.
It is a bit confusing to have all of config, option, and option_ here. But I guess I'll be able clean it up in #5746.
There was a problem hiding this comment.
Well options_ and options are identical things just with different types.
|
The failing test doesn't actually pass for me on the main branch... |
|
Maybe my micropip is out of date... |
This reverts commit f4939cb.
And also `packageBaseUrl` option: 1. If `lockfileContents` is provided and not `packageBaseUrl`, then in the browser attempting to load a lock entry with a relative path fails. 2. In Node, `packageBaseUrl` is used in place of jsdelivr as the cdn url if passed. See discussion in pyodide#5736.
|
Thanks! |
And also `packageBaseUrl` option: 1. If `lockfileContents` is provided and not `packageBaseUrl`, then in the browser attempting to load a lock entry with a relative path fails. 2. In Node, `packageBaseUrl` is used in place of jsdelivr as the cdn url if passed. See discussion in pyodide#5736.
|
any eta for a new release? we're going on vacation and we'd love to be able to bring in latest Pyodide before doing that, so that anyone playing around our project could benefit from its latest/greatest, thank you! |
And also `packageBaseUrl` option: 1. If `lockfileContents` is provided and not `packageBaseUrl`, then in the browser attempting to load a lock entry with a relative path fails. 2. In Node, `packageBaseUrl` is used in place of jsdelivr as the cdn url if passed. See discussion in pyodide#5736.
And also `packageBaseUrl` option: 1. If `lockfileContents` is provided and not `packageBaseUrl`, then in the browser attempting to load a lock entry with a relative path fails. 2. In Node, `packageBaseUrl` is used in place of jsdelivr as the cdn url if passed. See discussion in pyodide#5736.
And also `packageBaseUrl` option: 1. If `lockfileContents` is provided and not `packageBaseUrl`, then in the browser attempting to load a lock entry with a relative path fails. 2. In Node, `packageBaseUrl` is used in place of jsdelivr as the cdn url if passed. See discussion in pyodide#5736.
And also
packageBaseUrloption:lockfileContentsis provided and notpackageBaseUrl, then in the browser attempting to load a lock entry with a relative path fails.packageBaseUrlis used in place of jsdelivr as the cdn url if passed.See discussion in #5736.