{"id":31221103,"url":"https://github.com/robotpy/crossenv","last_synced_at":"2025-12-12T01:04:25.285Z","repository":{"id":30821767,"uuid":"122020788","full_name":"robotpy/crossenv","owner":"robotpy","description":"Cross-compiling virtualenv for Python","archived":false,"fork":false,"pushed_at":"2025-09-13T06:39:01.000Z","size":288,"stargazers_count":126,"open_issues_count":6,"forks_count":25,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-09-13T07:13:39.062Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robotpy.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2018-02-19T04:57:39.000Z","updated_at":"2025-09-13T06:39:05.000Z","dependencies_parsed_at":"2025-07-24T03:23:35.268Z","dependency_job_id":"d9124110-336e-413c-bb65-a82db32e35b1","html_url":"https://github.com/robotpy/crossenv","commit_stats":{"total_commits":152,"total_committers":10,"mean_commits":15.2,"dds":"0.20394736842105265","last_synced_commit":"1980f4ab7a19096f76095afeece892387927c126"},"previous_names":["robotpy/crossenv"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/robotpy/crossenv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotpy%2Fcrossenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotpy%2Fcrossenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotpy%2Fcrossenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotpy%2Fcrossenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robotpy","download_url":"https://codeload.github.com/robotpy/crossenv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotpy%2Fcrossenv/sbom","scorecard":{"id":232414,"data":{"date":"2025-08-11","repo":{"name":"github.com/benfogle/crossenv","commit":"8628f8d25fc39609da323f3f14919d794096a2cc"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":3,"reason":"Found 3/8 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":2,"reason":"2 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: tests/prebuilt/docker/Dockerfile:1: pin your Docker image by updating ubuntu:18.04 to ubuntu:18.04@sha256:152dc042452c496007f07ca9127571cb9c29697f42acbfad72324b2bb2e43c98","Info:   0 out of   1 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T05:04:53.840Z","repository_id":30821767,"created_at":"2025-08-17T05:04:53.840Z","updated_at":"2025-08-17T05:04:53.840Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276297404,"owners_count":25618236,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-21T02:00:07.055Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-09-21T19:49:20.708Z","updated_at":"2025-09-21T19:49:22.994Z","avatar_url":"https://github.com/robotpy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Virtual Environments for Cross-Compiling Python Extension Modules\n=============================================================================\n\nDocumentation is available online at https://crossenv.readthedocs.io and in the\n``docs`` directory.\n\nPorting a Python app to an embedded device can be complicated. Once you have\nPython built for your system, you may find yourself needing to include many\nthird-party libraries. Pure-Python libraries usually just work, but many\npopular libraries rely on compiled C code, which can be challenging to build.\n\nThis package is a tool for cross-compiling extension modules. It creates a\nspecial virtual environment such that ``pip`` or ``setup.py`` will cross\ncompile packages for you, usually with no further work on your part.\n\nIt can be used to:\n\n* Build binary wheels, for installation on target.\n* Install packages to a directory for upload or inclusion in a firmware image.\n\n**Note**: While this tool can cross-compile *most* Python packages, it can't\nsolve all the problems of cross-compiling. In some cases manual intervention\nmay still be necessary.\n\nThis tool requires Python 3.5 or higher (host and build). Significant work has\ngone into cross-compiling Python in newer versions, and many of the techniques\nneeded to do the cross compilation properly are not available on older\nreleases.\n\nThis tool currently only supports Linux build machines.\n\n\nVocabulary\n-----------------------------------------------------------------------------\n\n+---------------+------------------------------------------------------------+\n| Host          | The machine you are building **for**. (Android, iOS, other |\n|               | embedded systems.)                                         |\n+---------------+------------------------------------------------------------+\n| Build         | The machine you are building **on**. (Probably your        |\n|               | desktop.)                                                  |\n+---------------+------------------------------------------------------------+\n| Host-python   | The compiled Python binary and libraries that run on Host  |\n+---------------+------------------------------------------------------------+\n| Build-python  | The compiled Python binary and libraries that run on       |\n|               | Build.                                                     |\n+---------------+------------------------------------------------------------+\n| Cross-python  | Build-python, configured specially to build packages that  |\n|               | can be run with Host-python. This tool creates             |\n|               | Cross-python.                                              |\n+---------------+------------------------------------------------------------+\n\n\nHow it works\n-----------------------------------------------------------------------------\n\nCross-python is set up carefully so that it reports all system information\nexactly as Host-python would. When done correctly, a side effect of this is\nthat ``distutils`` and ``setuptools`` will cross-compile when building\npackages. All of the normal packaging machinery still works correctly, so\ndependencies, ABI tags, and so forth all work as expected.\n\n\nRequirements\n-----------------------------------------------------------------------------\n\nYou will need:\n\n1. A version of Python (3.5 or later) that runs on Build. (Build-python.)\n2. A version of Python that will run on Host. (Host-python.) This must be the\n   *same version* as Build-python.\n3. The cross-compiling toolchain used to make Host-python. Make sure you set\n   PATH correctly to use it.\n4. Any libraries your modules depend on, cross-compiled and installed\n   somewhere Cross-python can get to them. For example, the ``cryptography``\n   package depends on OpenSSL and libffi.\n\n\nInstallation\n-----------------------------------------------------------------------------\n\nCrossenv can be installed using pip::\n\n    $ pip install crossenv\n\n\nUsage\n-----------------------------------------------------------------------------\n\nTo create the virtual environment::\n\n    $ /path/to/build/python3 -m crossenv /path/to/host/python3 venv\n\nThis creates a folder named ``venv`` that contains two subordinate virtual\nenvironments: one for Build-python, and one for Cross-python. When activated,\n``python`` (or its alias ``cross-python``) can be used for cross compiling. If\nneeded, packages can be installed on Build (e.g., a package requires Cython to\ninstall) with ``build-python``. There are equivalent ``pip``, ``cross-pip``,\nand ``build-pip`` commands.\n\nThe cross-compiler to use, along with any extra flags needed, are taken from\ninformation recorded when Host-python was compiled.  To activate the\nenvironment::\n\n    $ . venv/bin/activate\n\nYou can now see that ``python`` seems to think it's running on Host::\n\n    (cross) $ python -m sysconfig\n    ...\n\nNow you can cross compile! To install a package to\n``venv/cross/lib/python3.6/site-packages``, you can use pip directly::\n\n    (cross) $ pip -v install numpy\n    ...\n\nYou can use ``setup.py`` to build wheels::\n\n    (cross) $ pip install wheel\n    (cross) $ pip download numpy\n    Collecting numpy\n      Using cached numpy-1.14.1.zip\n      Saved ./numpy-1.14.1.zip\n    Successfully downloaded numpy\n    (cross) $ unzip -q ./numpy-1.14.1.zip\n    (cross) $ cd numpy-1.14.1\n    (cross) $ python setup.py bdist_wheel\n    ...\n\nWhen you need packages like Cython or cffi installed to build another module,\nsometimes satisfying dependencies can get tricky. If you simply ``pip install``\nthe module, you may find it builds Cython as a prerequisite *for the host* and\nthen tries to run it on the build machine. This will fail, of course, but if we\ninstall the necessary package for ``build-python``, then ``pip`` will pick up\nthe correct version during install.\n\nFor example, to build bcrypt and python-cryptography::\n\n    (cross) $ build-pip install cffi\n    (cross) $ pip install bcrypt\n    (cross) $ pip install cryptography\n\nSome packages do explicit checks for existence of a package. For instance, a\npackage may do a check for Cython (other than simply trying to import it)\nbefore proceeding with installation. If a package is installed with\n``build-pip``, etc., then setuptools in ``cross-python`` does not recognize it\nas installed. (Note that you can still import it even if setuptools can't see\nit, so the naive check of ``import Cython`` will work fine so long as you did\n``build-pip install Cython`` earlier.) This is by design. To selectively expose\nbuild-python packages so that setuptools will count them as installed, you can\nuse the ``cross-expose`` script installed in the virtual environment.\n\nKnown Limitations\n-----------------------------------------------------------------------------\n\n* Upgrading ``cross-pip`` and ``build-pip`` must be done carefully, and it's\n  best not to do so unless you need to. If you need to: upgrade ``cross-pip``\n  first, then ``build-pip``.\n\n* When installing scripts, the shebang (``#!``) line is wrong. This will\n  need to be fixed up before using on Host.\n\n* Any dependant libraries used during the build, such as OpenSSL, are *not*\n  packaged in the wheel or install directory. You will need to ensure that\n  these libraries are installed on Host and can be used. This is the normal\n  Python behavior.\n\n* Any setup-time requirement listed in ``setup.py`` under ``setup_requires``\n  will be installed in Cross-python's virtual environment, not Build-python.\n  This will mostly work anyway if they are pure-Python, but for packages\n  with extension modules (Cython, etc.), you will need to install them into\n  Build-python's environment first. It's often a good idea to do a\n  ``build-pip install \u003cwhatever\u003e`` prior to ``pip install \u003cwhatever\u003e``.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobotpy%2Fcrossenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobotpy%2Fcrossenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobotpy%2Fcrossenv/lists"}