{"owner":"emscripten-core","repo":"emscripten","hasSkills":true,"totalSkillsCount":3,"totalTokensCount":1227,"categories":["plugin-manifest"],"hasMcp":false,"mcpConfig":null,"found":["tools/pylauncher/README.md","tools/ports/contrib/README.md","tools/maint/README.md"],"skills":{"tools/pylauncher/README.md":"# Windows Python Script Launcher\n\nThis directory contains a simple launcher program for Windows which is used to\nexecute the Emscripten compiler entry points using the python interpreter. It\nuses the its own name (the name of the currently running executable) to\ndetermine which python script to run and serves the same purpose as the shell\nscripts (see `run_python.sh` ) do on non-Windows platforms.\n\n## Building\n\nThe primary `build.bat` script uses MSVC and links against `ucrtbase.dll` which\nships as part of the OS since Windows 10 (2015) and is available via\nWindows Update for Vista/7/8/8.1.\n\n`build.sh` cross-compiles with MinGW and links against `msvcrt.dll` (present\non all Windows versions). This script is mostly useful for debugging on Linux.\nThe .exe file that is checked in here, and used in by emsdk is currently always\nbuilt with the `build.bat` script above.\n\n## Related projects\n\n### posy-trampoline\n\nThe posy-trampoline project does something similar:\n\n    https://github.com/njsmith/posy/tree/main/src/trampolines/windows-trampolines/posy-trampoline\n\nHowever, IIRC it also embeds the target python file onto the executable itself\nwhich is not some Emscripten needs (or wants) to do.  Its also written in rust\n(which is not something Emscripten has in any of its dependencies yet).\nThe `uv` tool also embeds a version of this trampiline:\n\n    https://github.com/astral-sh/uv/tree/main/crates/uv-trampoline\n\nThere is also PyInstaller (https://pyinstaller.org/en/stable/), but that seems\nto want to wrap up the whole application into the executable too.\n\nBoth these projects seem to change the way the python code itself is delivered\nto Windows users.  The difference with Emscripten's pylauncher is that\nit leaves the layout of the python files unchanged.  i.e. Its just a launcher,\nnot any kind of bundler.  This means that Windows users can still see, and even\nmodify in place, all the python files just like non-Windows users.  All the\nlauncher does is allows the entry point to be an `.exe`.\n\nThe Emscripten launcher is also very small, coming it at just 5.5k at time of\nwriting.\n\nThe Emscripten launcher also doesn't require any modification of the `.exe` to\ndeploy it.  All one needs to do is copy the unmodified executable alongside a\npython file of the same name, and the launcher will find it and run it based\npurely on the name of the launcher itself (i.e. argv0).\n\n### setuptools\n\nThere is windows launcher that is part of setuptools:\n\n    https://github.com/pypa/setuptools/blob/main/launcher.c\n\nThe code is very similar to Emscripten's launcher.  In fact, perhaps we should\nconsider switch it this in the future?\n\nUnlike Emscripten's laucnher this launcher seems to look for\n`<exe_basename>-script.py` rather than just `<exe_basename>.py`, which is what\nthe Emscripten laucnher uses.\n\nThis laucnher also seem to examine the `#!` line of the target script and\nlocate the python executable somehow based on this.\n","tools/ports/contrib/README.md":"Emscripten \"Contrib\" Ports\n==========================\n\nPorts in this directory are contributed by the wider community and are\nsupported on a \"best effort\" basis.  Since they are not run as part of\nemscripten CI they are not always guaranteed to build or function.\n\nIf you want to add a contrib port, please use another contrib port as \nan example. In particular, each contrib port must provide 3 extra piece\nof information:\n\n* `URL`: the url where the user can find more information about \n  the project/port\n* `DESCRIPTION`: a (short) description of what the project/port \n  is about\n* `LICENSE`: the license used by the project/port\n\nA contrib port can have options using the syntax \n`--use-port=name:opt1=v1:opt2=v2`.\n\nIf you want to support options, then your port needs to provide 2 \nadditional components:\n\n1. A handler function defined this way:\n```python\ndef handle_options(options, error_handler):\n  # options is of type Dict[str, str]\n  # in case of error, use error_handler('error message')\n  # note that error_handler is guaranteed to never return\n```\n2. A dictionary called `OPTIONS` (type `Dict[str, str]`) where each key is the \n   name of the option and the value is a short description of what it does \n\nWhen emscripten detects that options have been provided, it parses them and\ncheck that they are valid option names for this port (using `OPTIONS`). It then\ncalls the handler function with these (valid) options. If you detect an error\nwith a value, you should use the error handler provided to report the \nfailure.\n\nSince emscripten uses `:` as the option separator, `::` is the escape syntax \n(ex: `--use-port=name:opt1=abc::def`)\n\n> ### Note\n> If the options influence the way the library produced by the port is built, \n> you must ensure that the library name accounts for these options. Check \n> `glfw3.py` for an example of ports with options.\n\nAfter adding a contrib port, you should consider modifying the documentation \nunder `site/source/docs/compiling/Contrib-Ports.rst`.","tools/maint/README.md":"Maintenance Scripts for Emscripten Developers\n=============================================\n\nThis directory contains maintenance scripts used by emscripten developers.  For\nmore information see the comments at the top of each script.\n"},"files":{"tools/pylauncher/README.md":"# Windows Python Script Launcher\n\nThis directory contains a simple launcher program for Windows which is used to\nexecute the Emscripten compiler entry points using the python interpreter. It\nuses the its own name (the name of the currently running executable) to\ndetermine which python script to run and serves the same purpose as the shell\nscripts (see `run_python.sh` ) do on non-Windows platforms.\n\n## Building\n\nThe primary `build.bat` script uses MSVC and links against `ucrtbase.dll` which\nships as part of the OS since Windows 10 (2015) and is available via\nWindows Update for Vista/7/8/8.1.\n\n`build.sh` cross-compiles with MinGW and links against `msvcrt.dll` (present\non all Windows versions). This script is mostly useful for debugging on Linux.\nThe .exe file that is checked in here, and used in by emsdk is currently always\nbuilt with the `build.bat` script above.\n\n## Related projects\n\n### posy-trampoline\n\nThe posy-trampoline project does something similar:\n\n    https://github.com/njsmith/posy/tree/main/src/trampolines/windows-trampolines/posy-trampoline\n\nHowever, IIRC it also embeds the target python file onto the executable itself\nwhich is not some Emscripten needs (or wants) to do.  Its also written in rust\n(which is not something Emscripten has in any of its dependencies yet).\nThe `uv` tool also embeds a version of this trampiline:\n\n    https://github.com/astral-sh/uv/tree/main/crates/uv-trampoline\n\nThere is also PyInstaller (https://pyinstaller.org/en/stable/), but that seems\nto want to wrap up the whole application into the executable too.\n\nBoth these projects seem to change the way the python code itself is delivered\nto Windows users.  The difference with Emscripten's pylauncher is that\nit leaves the layout of the python files unchanged.  i.e. Its just a launcher,\nnot any kind of bundler.  This means that Windows users can still see, and even\nmodify in place, all the python files just like non-Windows users.  All the\nlauncher does is allows the entry point to be an `.exe`.\n\nThe Emscripten launcher is also very small, coming it at just 5.5k at time of\nwriting.\n\nThe Emscripten launcher also doesn't require any modification of the `.exe` to\ndeploy it.  All one needs to do is copy the unmodified executable alongside a\npython file of the same name, and the launcher will find it and run it based\npurely on the name of the launcher itself (i.e. argv0).\n\n### setuptools\n\nThere is windows launcher that is part of setuptools:\n\n    https://github.com/pypa/setuptools/blob/main/launcher.c\n\nThe code is very similar to Emscripten's launcher.  In fact, perhaps we should\nconsider switch it this in the future?\n\nUnlike Emscripten's laucnher this launcher seems to look for\n`<exe_basename>-script.py` rather than just `<exe_basename>.py`, which is what\nthe Emscripten laucnher uses.\n\nThis laucnher also seem to examine the `#!` line of the target script and\nlocate the python executable somehow based on this.\n","tools/ports/contrib/README.md":"Emscripten \"Contrib\" Ports\n==========================\n\nPorts in this directory are contributed by the wider community and are\nsupported on a \"best effort\" basis.  Since they are not run as part of\nemscripten CI they are not always guaranteed to build or function.\n\nIf you want to add a contrib port, please use another contrib port as \nan example. In particular, each contrib port must provide 3 extra piece\nof information:\n\n* `URL`: the url where the user can find more information about \n  the project/port\n* `DESCRIPTION`: a (short) description of what the project/port \n  is about\n* `LICENSE`: the license used by the project/port\n\nA contrib port can have options using the syntax \n`--use-port=name:opt1=v1:opt2=v2`.\n\nIf you want to support options, then your port needs to provide 2 \nadditional components:\n\n1. A handler function defined this way:\n```python\ndef handle_options(options, error_handler):\n  # options is of type Dict[str, str]\n  # in case of error, use error_handler('error message')\n  # note that error_handler is guaranteed to never return\n```\n2. A dictionary called `OPTIONS` (type `Dict[str, str]`) where each key is the \n   name of the option and the value is a short description of what it does \n\nWhen emscripten detects that options have been provided, it parses them and\ncheck that they are valid option names for this port (using `OPTIONS`). It then\ncalls the handler function with these (valid) options. If you detect an error\nwith a value, you should use the error handler provided to report the \nfailure.\n\nSince emscripten uses `:` as the option separator, `::` is the escape syntax \n(ex: `--use-port=name:opt1=abc::def`)\n\n> ### Note\n> If the options influence the way the library produced by the port is built, \n> you must ensure that the library name accounts for these options. Check \n> `glfw3.py` for an example of ports with options.\n\nAfter adding a contrib port, you should consider modifying the documentation \nunder `site/source/docs/compiling/Contrib-Ports.rst`.","tools/maint/README.md":"Maintenance Scripts for Emscripten Developers\n=============================================\n\nThis directory contains maintenance scripts used by emscripten developers.  For\nmore information see the comments at the top of each script.\n"},"items":[{"name":"README.md","path":"tools/maint/README.md","rawUrl":"https://raw.githubusercontent.com/emscripten-core/emscripten/HEAD/tools/maint/README.md","title":"maint Documentation","category":"plugin-manifest","format":"markdown","content":"Maintenance Scripts for Emscripten Developers\n=============================================\n\nThis directory contains maintenance scripts used by emscripten developers.  For\nmore information see the comments at the top of each script.\n","isInternal":false,"tokens":39,"sizeBytes":234},{"name":"README.md","path":"tools/ports/contrib/README.md","rawUrl":"https://raw.githubusercontent.com/emscripten-core/emscripten/HEAD/tools/ports/contrib/README.md","title":"contrib Documentation","category":"plugin-manifest","format":"markdown","content":"Emscripten \"Contrib\" Ports\n==========================\n\nPorts in this directory are contributed by the wider community and are\nsupported on a \"best effort\" basis.  Since they are not run as part of\nemscripten CI they are not always guaranteed to build or function.\n\nIf you want to add a contrib port, please use another contrib port as \nan example. In particular, each contrib port must provide 3 extra piece\nof information:\n\n* `URL`: the url where the user can find more information about \n  the project/port\n* `DESCRIPTION`: a (short) description of what the project/port \n  is about\n* `LICENSE`: the license used by the project/port\n\nA contrib port can have options using the syntax \n`--use-port=name:opt1=v1:opt2=v2`.\n\nIf you want to support options, then your port needs to provide 2 \nadditional components:\n\n1. A handler function defined this way:\n```python\ndef handle_options(options, error_handler):\n  # options is of type Dict[str, str]\n  # in case of error, use error_handler('error message')\n  # note that error_handler is guaranteed to never return\n```\n2. A dictionary called `OPTIONS` (type `Dict[str, str]`) where each key is the \n   name of the option and the value is a short description of what it does \n\nWhen emscripten detects that options have been provided, it parses them and\ncheck that they are valid option names for this port (using `OPTIONS`). It then\ncalls the handler function with these (valid) options. If you detect an error\nwith a value, you should use the error handler provided to report the \nfailure.\n\nSince emscripten uses `:` as the option separator, `::` is the escape syntax \n(ex: `--use-port=name:opt1=abc::def`)\n\n> ### Note\n> If the options influence the way the library produced by the port is built, \n> you must ensure that the library name accounts for these options. Check \n> `glfw3.py` for an example of ports with options.\n\nAfter adding a contrib port, you should consider modifying the documentation \nunder `site/source/docs/compiling/Contrib-Ports.rst`.","isInternal":false,"tokens":470,"sizeBytes":2001},{"name":"README.md","path":"tools/pylauncher/README.md","rawUrl":"https://raw.githubusercontent.com/emscripten-core/emscripten/HEAD/tools/pylauncher/README.md","title":"pylauncher Documentation","category":"plugin-manifest","format":"markdown","content":"# Windows Python Script Launcher\n\nThis directory contains a simple launcher program for Windows which is used to\nexecute the Emscripten compiler entry points using the python interpreter. It\nuses the its own name (the name of the currently running executable) to\ndetermine which python script to run and serves the same purpose as the shell\nscripts (see `run_python.sh` ) do on non-Windows platforms.\n\n## Building\n\nThe primary `build.bat` script uses MSVC and links against `ucrtbase.dll` which\nships as part of the OS since Windows 10 (2015) and is available via\nWindows Update for Vista/7/8/8.1.\n\n`build.sh` cross-compiles with MinGW and links against `msvcrt.dll` (present\non all Windows versions). This script is mostly useful for debugging on Linux.\nThe .exe file that is checked in here, and used in by emsdk is currently always\nbuilt with the `build.bat` script above.\n\n## Related projects\n\n### posy-trampoline\n\nThe posy-trampoline project does something similar:\n\n    https://github.com/njsmith/posy/tree/main/src/trampolines/windows-trampolines/posy-trampoline\n\nHowever, IIRC it also embeds the target python file onto the executable itself\nwhich is not some Emscripten needs (or wants) to do.  Its also written in rust\n(which is not something Emscripten has in any of its dependencies yet).\nThe `uv` tool also embeds a version of this trampiline:\n\n    https://github.com/astral-sh/uv/tree/main/crates/uv-trampoline\n\nThere is also PyInstaller (https://pyinstaller.org/en/stable/), but that seems\nto want to wrap up the whole application into the executable too.\n\nBoth these projects seem to change the way the python code itself is delivered\nto Windows users.  The difference with Emscripten's pylauncher is that\nit leaves the layout of the python files unchanged.  i.e. Its just a launcher,\nnot any kind of bundler.  This means that Windows users can still see, and even\nmodify in place, all the python files just like non-Windows users.  All the\nlauncher does is allows the entry point to be an `.exe`.\n\nThe Emscripten launcher is also very small, coming it at just 5.5k at time of\nwriting.\n\nThe Emscripten launcher also doesn't require any modification of the `.exe` to\ndeploy it.  All one needs to do is copy the unmodified executable alongside a\npython file of the same name, and the launcher will find it and run it based\npurely on the name of the launcher itself (i.e. argv0).\n\n### setuptools\n\nThere is windows launcher that is part of setuptools:\n\n    https://github.com/pypa/setuptools/blob/main/launcher.c\n\nThe code is very similar to Emscripten's launcher.  In fact, perhaps we should\nconsider switch it this in the future?\n\nUnlike Emscripten's laucnher this launcher seems to look for\n`<exe_basename>-script.py` rather than just `<exe_basename>.py`, which is what\nthe Emscripten laucnher uses.\n\nThis laucnher also seem to examine the `#!` line of the target script and\nlocate the python executable somehow based on this.\n","isInternal":false,"tokens":718,"sizeBytes":2942}],"systemPromptSnippet":"<yakaai_skills repo=\"emscripten-core/emscripten\">\n<!-- File: tools/maint/README.md (Tokens: ~39 | Category: plugin-manifest) -->\nMaintenance Scripts for Emscripten Developers\n=============================================\n\nThis directory contains maintenance scripts used by emscripten developers.  For\nmore information see the comments at the top of each script.\n\n<!-- File: tools/ports/contrib/README.md (Tokens: ~470 | Category: plugin-manifest) -->\nEmscripten \"Contrib\" Ports\n==========================\n\nPorts in this directory are contributed by the wider community and are\nsupported on a \"best effort\" basis.  Since they are not run as part of\nemscripten CI they are not always guaranteed to build or function.\n\nIf you want to add a contrib port, please use another contrib port as \nan example. In particular, each contrib port must provide 3 extra piece\nof information:\n\n* `URL`: the url where the user can find more information about \n  the project/port\n* `DESCRIPTION`: a (short) description of what the project/port \n  is about\n* `LICENSE`: the license used by the project/port\n\nA contrib port can have options using the syntax \n`--use-port=name:opt1=v1:opt2=v2`.\n\nIf you want to support options, then your port needs to provide 2 \nadditional components:\n\n1. A handler function defined this way:\n```python\ndef handle_options(options, error_handler):\n  # options is of type Dict[str, str]\n  # in case of error, use error_handler('error message')\n  # note that error_handler is guaranteed to never return\n```\n2. A dictionary called `OPTIONS` (type `Dict[str, str]`) where each key is the \n   name of the option and the value is a short description of what it does \n\nWhen emscripten detects that options have been provided, it parses them and\ncheck that they are valid option names for this port (using `OPTIONS`). It then\ncalls the handler function with these (valid) options. If you detect an error\nwith a value, you should use the error handler provided to report the \nfailure.\n\nSince emscripten uses `:` as the option separator, `::` is the escape syntax \n(ex: `--use-port=name:opt1=abc::def`)\n\n> ### Note\n> If the options influence the way the library produced by the port is built, \n> you must ensure that the library name accounts for these options. Check \n> `glfw3.py` for an example of ports with options.\n\nAfter adding a contrib port, you should consider modifying the documentation \nunder `site/source/docs/compiling/Contrib-Ports.rst`.\n\n<!-- File: tools/pylauncher/README.md (Tokens: ~718 | Category: plugin-manifest) -->\n# Windows Python Script Launcher\n\nThis directory contains a simple launcher program for Windows which is used to\nexecute the Emscripten compiler entry points using the python interpreter. It\nuses the its own name (the name of the currently running executable) to\ndetermine which python script to run and serves the same purpose as the shell\nscripts (see `run_python.sh` ) do on non-Windows platforms.\n\n## Building\n\nThe primary `build.bat` script uses MSVC and links against `ucrtbase.dll` which\nships as part of the OS since Windows 10 (2015) and is available via\nWindows Update for Vista/7/8/8.1.\n\n`build.sh` cross-compiles with MinGW and links against `msvcrt.dll` (present\non all Windows versions). This script is mostly useful for debugging on Linux.\nThe .exe file that is checked in here, and used in by emsdk is currently always\nbuilt with the `build.bat` script above.\n\n## Related projects\n\n### posy-trampoline\n\nThe posy-trampoline project does something similar:\n\n    https://github.com/njsmith/posy/tree/main/src/trampolines/windows-trampolines/posy-trampoline\n\nHowever, IIRC it also embeds the target python file onto the executable itself\nwhich is not some Emscripten needs (or wants) to do.  Its also written in rust\n(which is not something Emscripten has in any of its dependencies yet).\nThe `uv` tool also embeds a version of this trampiline:\n\n    https://github.com/astral-sh/uv/tree/main/crates/uv-trampoline\n\nThere is also PyInstaller (https://pyinstaller.org/en/stable/), but that seems\nto want to wrap up the whole application into the executable too.\n\nBoth these projects seem to change the way the python code itself is delivered\nto Windows users.  The difference with Emscripten's pylauncher is that\nit leaves the layout of the python files unchanged.  i.e. Its just a launcher,\nnot any kind of bundler.  This means that Windows users can still see, and even\nmodify in place, all the python files just like non-Windows users.  All the\nlauncher does is allows the entry point to be an `.exe`.\n\nThe Emscripten launcher is also very small, coming it at just 5.5k at time of\nwriting.\n\nThe Emscripten launcher also doesn't require any modification of the `.exe` to\ndeploy it.  All one needs to do is copy the unmodified executable alongside a\npython file of the same name, and the launcher will find it and run it based\npurely on the name of the launcher itself (i.e. argv0).\n\n### setuptools\n\nThere is windows launcher that is part of setuptools:\n\n    https://github.com/pypa/setuptools/blob/main/launcher.c\n\nThe code is very similar to Emscripten's launcher.  In fact, perhaps we should\nconsider switch it this in the future?\n\nUnlike Emscripten's laucnher this launcher seems to look for\n`<exe_basename>-script.py` rather than just `<exe_basename>.py`, which is what\nthe Emscripten laucnher uses.\n\nThis laucnher also seem to examine the `#!` line of the target script and\nlocate the python executable somehow based on this.\n</yakaai_skills>"}