{"id":37701992,"url":"https://github.com/a-scie/ptex","last_synced_at":"2026-01-16T13:00:51.908Z","repository":{"id":63728119,"uuid":"564393226","full_name":"a-scie/ptex","owner":"a-scie","description":"Ship gouged out scies that repair their base on 1st run by fetching missing files.","archived":false,"fork":false,"pushed_at":"2026-01-10T03:33:30.000Z","size":482,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-11T00:59:38.897Z","etag":null,"topics":["cli","http-client","rust","tools"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/a-scie.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-11-10T16:10:49.000Z","updated_at":"2026-01-10T03:33:30.000Z","dependencies_parsed_at":"2023-09-27T03:42:04.039Z","dependency_job_id":"40bfb605-ebb4-4da0-90c4-3a1d2d51a369","html_url":"https://github.com/a-scie/ptex","commit_stats":null,"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"purl":"pkg:github/a-scie/ptex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-scie%2Fptex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-scie%2Fptex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-scie%2Fptex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-scie%2Fptex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a-scie","download_url":"https://codeload.github.com/a-scie/ptex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-scie%2Fptex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478885,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","http-client","rust","tools"],"created_at":"2026-01-16T13:00:50.563Z","updated_at":"2026-01-16T13:00:51.901Z","avatar_url":"https://github.com/a-scie.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ptex\n\n[![GitHub](https://img.shields.io/github/license/a-scie/ptex)](LICENSE)\n[![Github Actions CI](https://github.com/a-scie/ptex/actions/workflows/ci.yml/badge.svg)](https://github.com/a-scie/ptex/actions/workflows/ci.yml)\n[![Discord](https://img.shields.io/discord/1113502044922322954)](https://scie.app/discord)\n\nShip gouged out scies that repair their base on 1st run by fetching missing files.\n\n## Why use `ptex`?\n\nShipping your interpreted-language application as a native executable [scie](\nhttps://github.com/a-scie/jump) can be attractive. Users need not install an interpreter or even\nknow what language your application is written in at all. As you continue to ship updates to your\napplication each binary scie release will contain the same embedded interpreter though and these can\nbe quite large. This is unfortunate since the interpreter likely already exists in the user's local\n`~/.nce` cache. For this reason and others, you may want to ship a scie without all the files in its\nbase filled in, but instead downloaded to the end users machine only if needed. This saves\nstorage space on your servers and the end user's machine as well as bandwidth transferring your\napplication scie between them. The `ptex` binary can help you do this.\n\n## How `ptex` works\n\nThe [`scie-jump`](\nhttps://github.com/a-scie/jump/blob/main/docs/packaging.md#optional-fields) supports assigning a\n`source` binding command to any file entry in the lift manifest. That source binding command then\nbecomes responsible for providing the content of that file when needed. The `ptex` binary can be\nused as the executable for these binding commands to provide a robust, self-contained means of\nfetching scie files just in time, on an as-needed basis. The `ptex` just needs to be told what URL\neach file it is responsible for materializing comes from. Configuration looks like so:\n```json\n{\n  \"scie\": {\n    \"lift\": {\n      \"name\": \"skinny-scie\",\n      \"files\": [\n        {\n          \"name\": \"ptex-linux-x86_64\",\n          \"key\": \"ptex\",\n          \"executable\": true\n        },\n        {\n          \"name\": \"cpython-3.10.8+20221106-x86_64-unknown-linux-gnu-install_only.tar.gz\",\n          \"key\": \"cpython\",\n          \"size\": 27555856,\n          \"hash\": \"6c8db44ae0e18e320320bbaaafd2d69cde8bfea171ae2d651b7993d1396260b7\",\n          \"type\": \"tar.gz\",\n          \"source\": \"ptex-fetch\"\n        }\n      ],\n      \"boot\": {\n        \"commands\": {\n          \"\": {\n            \"exe\": \"{cpython}/python/bin/python3.10\",\n            \"args\": [\n              \"-c\",\n              \"print('Hello World!')\"\n            ]\n          }\n        },\n        \"bindings\": {\n          \"ptex-fetch\": {\n            \"exe\": \"{ptex}\",\n            \"args\": [\n              \"{scie.lift}\"\n            ]\n          }\n        }\n      }\n    }\n  },\n  \"ptex\": {\n    \"cpython-3.10.8+20221106-x86_64-unknown-linux-gnu-install_only.tar.gz\":\n      \"https://github.com/astral-sh/python-build-standalone/releases/download/20221106/cpython-3.10.8+20221106-x86_64-unknown-linux-gnu-install_only.tar.gz\"\n  }\n}\n```\n\nIn this example Linux x86_64 CPython 3.10 scie, the Linux x86_64 `ptex` binary found in the\n[`ptex` Releases](https://github.com/a-scie/ptex/releases) is directly included. The CPython binary\ndistribution from [Python Build Standalone](https://github.com/astral-sh/python-build-standalone) is\nnot directly included, but instead sourced via `ptex`. This is arranged with a binding command\nconfigured to run `ptex` passing in the lift manifest itself which `ptex` uses to find the URL of\nthe CPython binary distribution when it needs to fetch it.\n\nThis results in a `skinny-scie` that is ~5.6MB. On 1st run on the target host you'll see some\ninformation about the download updating on stderr:\n```\n$ rm -rf ~/.nce \u0026\u0026 time ./skinny-scie\nDownloaded 27555856 of 27555856 bytes (100%) from https://github.com/astral-sh/python-build-standalone/releases/download/20221106/cpython-3.10.8+20221106-x86_64-unknown-linux-gnu-install_only.tar.gz\nHello World!\n\nreal    0m3.888s\nuser    0m0.305s\nsys     0m0.212s\n```\nOn subsequent runs on that host, or any host where a scie has already used that CPython\ndistribution, you'll find:\n```\n$ time ./skinny-scie\nHello World!\n\nreal    0m0.018s\nuser    0m0.018s\nsys     0m0.000s\n```\n\nSince the CPython distribution was already downloaded and extracted (to\n`~/.nce/6c8db44ae0e18e320320bbaaafd2d69cde8bfea171ae2d651b7993d1396260b7` in this case) it is not\nfetched again, but instead ready for use immediately. Any other scie that uses this same CPython\ndistribution with the same hash, whether it uses ptex or not, will also enjoy this same cache-hit\nand speedy run.\n\nFor comparison, the equivalent self-contained scie with a pre-downloaded and embedded CPython\ndistribution is ~28M:\n```json\n{\n  \"scie\": {\n    \"lift\": {\n      \"name\": \"skinny-scie\",\n      \"files\": [\n        {\n          \"name\": \"cpython-3.10.8+20221106-x86_64-unknown-linux-gnu-install_only.tar.gz\",\n          \"key\": \"cpython\"\n        }\n      ],\n      \"boot\": {\n        \"commands\": {\n          \"\": {\n            \"exe\": \"{cpython}/python/bin/python3.10\",\n            \"args\": [\n              \"-c\",\n              \"print('Hello World!')\"\n            ]\n          }\n        }\n      }\n    }\n  }\n}\n```\n\n## Building `ptex`\n\nThe `ptex` binary is [released](https://github.com/a-scie/ptex/releases) for Linux (x86_64,\naarch64, armv7l, powerpc64le, riscv64 \u0026 s390x), macOS (x86_64 \u0026 aarch64) and Windows\n(x86_64 \u0026 aarch64). If you'd like to build your own copy, you'll need\n[Rust installed](https://rustup.rs/) at which point you can run `cargo run -p package` and a binary\nfor your current machine will be built in `dist/` along with a sha256 checksum file. For more build\noptions, you can run `cargo run -p package -- --help`. On some systems, builds will require `cmake`,\n`make` and `perl` in order to build various `*-sys` crates. If you're missing these, the build\nfailures will point you in the right direction with some reading.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-scie%2Fptex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa-scie%2Fptex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-scie%2Fptex/lists"}