Skip to content
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

Update pyodide and OTIO #19

Merged
merged 27 commits into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e5caabe
Update pyodide and OTIO
JeanChristopheMorinPerso Nov 23, 2024
e241c54
Set include dir and correct pyodide CLI args
JeanChristopheMorinPerso Nov 23, 2024
0ed32c2
Fix wheel path
JeanChristopheMorinPerso Nov 23, 2024
82857a1
Try with sysconfig for python path
JeanChristopheMorinPerso Nov 23, 2024
4186cb9
Try with scikit-build-core branch
JeanChristopheMorinPerso Nov 24, 2024
f1a227b
Try with -fwasm-exceptions
JeanChristopheMorinPerso Nov 24, 2024
4cb9cea
Update pyodide in HTML files
JeanChristopheMorinPerso Nov 24, 2024
5d1b9bd
Remove patch
JeanChristopheMorinPerso Nov 24, 2024
afecb5a
Try with pyinit instead of whole_archive
JeanChristopheMorinPerso Nov 24, 2024
afd6081
revert to whole_archive
JeanChristopheMorinPerso Nov 24, 2024
3251d26
Fix bad compiler flags
JeanChristopheMorinPerso Nov 24, 2024
c6b5f0f
Try with -Wl,--whole-archive explicitly
JeanChristopheMorinPerso Nov 24, 2024
979ba98
Remove -fvisibility=hidden and -fvisibility-inlines-hidden flags
JeanChristopheMorinPerso Nov 24, 2024
fea9618
Try with side module
JeanChristopheMorinPerso Nov 24, 2024
0931e34
Try without --whole-archive and with pyinit
JeanChristopheMorinPerso Nov 24, 2024
95a4b88
Add back whole_archive arg to pyodide
JeanChristopheMorinPerso Nov 24, 2024
fbbe439
With with RelWithDebInfo
JeanChristopheMorinPerso Nov 24, 2024
36bb017
Try again with pyinit
JeanChristopheMorinPerso Nov 24, 2024
bf30b33
Try with debug and no hidden symbols
JeanChristopheMorinPerso Nov 24, 2024
65d556c
Go full circle. Come back to whole_archive. Maybe this will work
JeanChristopheMorinPerso Nov 24, 2024
a2e773a
Try with whole_archive again but with -fexceptions maybe?
JeanChristopheMorinPerso Nov 24, 2024
34038f2
Alright. Almost works. Now I need to fix Cannot set type record on in…
JeanChristopheMorinPerso Nov 24, 2024
807f34f
Adapt to new pyodide and OTIO
JeanChristopheMorinPerso Nov 24, 2024
abd9b00
Add fix for https://github.com/pyodide/pyodide/pull/4836
JeanChristopheMorinPerso Nov 24, 2024
2092ae9
Try in release mode
JeanChristopheMorinPerso Nov 24, 2024
e4ab003
Cleanup
JeanChristopheMorinPerso Nov 24, 2024
7f7b74d
Only deply on main
JeanChristopheMorinPerso Nov 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 22 additions & 26 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,56 +18,52 @@ jobs:
- uses: actions/checkout@v3

- name: Clone OpenTimelineIO
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: AcademySoftwareFoundation/OpenTimelineIO
repository: JeanChristopheMorinPerso/OpenTimelineIO
ref: switch_to_scikit_build_core
path: OpenTimelineIO
submodules: 'recursive'

- uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.12'

- run: |
pip install pyodide-build==0.22.1
echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV

- uses: mymindstorm/setup-emsdk@v12
- uses: pypa/[email protected]
with:
version: ${{ env.EMSCRIPTEN_VERSION }}

- run: git apply < ../patch.patch
working-directory: OpenTimelineIO

- run: pyodide build --exports pyinit
working-directory: OpenTimelineIO
package-dir: OpenTimelineIO
output-dir: dist
env:
VERBOSE: '1'
OTIO_CXX_BUILD_TYPE: RelWithDebInfo

- uses: actions/upload-artifact@v3
CIBW_PLATFORM: pyodide
# whole_archive is needed to make all symbols available.
CIBW_BUILD_FRONTEND: 'build; args: --exports=whole_archive'
# Note that -fwasm-exceptions doesn't work right now. It'll cause
# a bunch of issues with symbols not found. Quite weird.
CIBW_ENVIRONMENT: LDFLAGS="-fexceptions" CXXFLAGS="-fexceptions"

- uses: actions/upload-artifact@v4
name: Upload wheel artifact
with:
name: wheel
path: OpenTimelineIO/dist/*.whl
path: dist/*.whl

- name: Generate HTML
run: |
set -ex
python -m pip install packaging jinja2
python generateHtml.py OpenTimelineIO/dist/*.whl pages
python generateHtml.py dist/*.whl pages

cp OpenTimelineIO/dist/*.whl pages/
cp dist/*.whl pages/
find public -mindepth 1 -not -name "*.in" -exec cp -v {} pages/ \;

- name: Upload pages artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3
with:
path: pages

deploy:
needs: ['build']

if: github.ref_name == 'main'
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
Expand All @@ -81,8 +77,8 @@ jobs:

steps:
- name: Setup Pages
uses: actions/configure-pages@v3
uses: actions/configure-pages@v5

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4
87 changes: 0 additions & 87 deletions patch.patch

This file was deleted.

2 changes: 1 addition & 1 deletion public/console.html.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
href="https://cdn.jsdelivr.net/npm/[email protected]/css/jquery.terminal.min.css"
rel="stylesheet"
/>
<script src="https://cdn.jsdelivr.net/pyodide/v0.21.3/full/pyodide.js"></script>
<script src="https://cdn.jsdelivr.net/pyodide/v0.26.4/full/pyodide.js"></script>
<style>
.terminal {
--size: 1.5;
Expand Down
13 changes: 10 additions & 3 deletions public/index.html.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://cdn.jsdelivr.net/pyodide/v0.21.3/full/pyodide.js"></script>
<script src="https://cdn.jsdelivr.net/pyodide/v0.26.4/full/pyodide.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2" crossorigin="anonymous"></script>
Expand Down Expand Up @@ -80,8 +80,15 @@
document.getElementById('spinner-message').innerHTML = "Loading Pyodide... UI will be blocked until it finishes loading";
let pyodide = await loadPyodide();

document.getElementById('spinner-message').innerHTML = "Loading OpenTimelineIO {{ version }} ({{ commit }})...";
await pyodide.loadPackage('https://jcmorin.dev/otio-wasm/{{ wheel }}');
document.getElementById('spinner-message').innerHTML = "Loading micropip";
await pyodide.loadPackage("micropip");

document.getElementById('spinner-message').innerHTML = "Loading OpenTimelineIO {{ version }} ({{ commit }}) and otio-svg-adapter...";
const micropip = pyodide.pyimport("micropip");
await micropip.install(['https://jcmorin.dev/otio-wasm/{{ wheel }}', 'otio-svg-adapter']);

// This is a hack. See https://github.com/pyodide/pyodide/pull/4836
pyodide._module.reportUndefinedSymbols();

document.getElementById('spinner-group').hidden = true;

Expand Down
Loading