|
3 | 3 | // https://opensource.org/licenses/Apache-2.0
|
4 | 4 |
|
5 | 5 | #include "server.h"
|
| 6 | +#include "workerd-api.h" |
6 | 7 |
|
7 | 8 | #include <workerd/io/compatibility-date.capnp.h>
|
| 9 | +#include <workerd/io/compatibility-date.h> |
8 | 10 | #include <workerd/io/supported-compatibility-date.capnp.h>
|
9 | 11 | #include <workerd/jsg/setup.h>
|
10 | 12 | #include <workerd/rust/cxx-integration/lib.rs.h>
|
|
15 | 17 |
|
16 | 18 | #include <fcntl.h>
|
17 | 19 | #include <openssl/rand.h>
|
18 |
| -#include <pyodide/generated/pyodide_extra.capnp.h> |
19 | 20 | #include <sys/stat.h>
|
20 | 21 |
|
21 | 22 | #include <capnp/dynamic.h>
|
@@ -807,7 +808,24 @@ class CliMain final: public SchemaFileImpl::ErrorReporter {
|
807 | 808 | context, getVersionString(), "Outputs the package lock file used by Pyodide.");
|
808 | 809 | return builder
|
809 | 810 | .callAfterParsing([]() -> kj::MainBuilder::Validity {
|
810 |
| - printf("%s\n", PYODIDE_LOCK->cStr()); |
| 811 | + static const PythonConfig config{ |
| 812 | + .packageDiskCacheRoot = kj::none, |
| 813 | + .pyodideDiskCacheRoot = kj::none, |
| 814 | + .createSnapshot = false, |
| 815 | + .createBaselineSnapshot = false, |
| 816 | + }; |
| 817 | + |
| 818 | + capnp::MallocMessageBuilder message; |
| 819 | + // TODO(EW-8977): Implement option to specify python worker flags. |
| 820 | + auto features = message.getRoot<CompatibilityFlags>(); |
| 821 | + features.setPythonWorkers(true); |
| 822 | + auto pythonRelease = KJ_ASSERT_NONNULL(getPythonSnapshotRelease(features)); |
| 823 | + auto version = getPythonBundleName(pythonRelease); |
| 824 | + KJ_ASSERT_NONNULL(fetchPyodideBundle(config, version), "Failed to get Pyodide bundle"); |
| 825 | + |
| 826 | + auto lock = KJ_ASSERT_NONNULL(config.pyodideBundleManager.getPyodideLock(pythonRelease)); |
| 827 | + |
| 828 | + printf("%s\n", lock.cStr()); |
811 | 829 | fflush(stdout);
|
812 | 830 | return true;
|
813 | 831 | }).build();
|
|
0 commit comments