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

Subpar alternative/comparison documentation #10

Open
Code0x58 opened this issue Dec 18, 2018 · 1 comment
Open

Subpar alternative/comparison documentation #10

Code0x58 opened this issue Dec 18, 2018 · 1 comment
Labels

Comments

@Code0x58
Copy link

The PEX Design page doesn't list subpar as an alternative, although it seems to be.

At a glance (using a sample pex from heron) both produce python zip files:

  • the par shebang uses python whereas pex uses something like python2.7
  • the par zip has 0 compression which makes the file human readable/search
  • the pex has a .bootstrap/ (including bytecode cache) and PEX-INFO

I don't know how much is configurable between the two, or how different situations are handled (such as C extensions). It looks like pex isn't very portable, but handles dependencies at least a bit differently.

Does anyone know the two well enough to be able to give a fairly detailed comparison on the practical differences?

trees of examples

par-example
├── __main__.py
├── org_apache_heron
│   └── heron
│       ├── common
│       │   ├── __init__.py
│       │   └── tests
│       │       ├── __init__.py
│       │       └── python
│       │           ├── __init__.py
│       │           └── pex_loader
│       │               ├── __init__.py
│       │               └── testdata
│       │                   ├── __init__.py
│       │                   └── src
│       │                       ├── __init__.py
│       │                       ├── sample
│       │                       └── sample.py
│       └── __init__.py
└── subpar
    ├── __init__.py
    └── runtime
        ├── __init__.py
        └── support.py

10 directories, 13 files
pex-example
├── .bootstrap
│   ├── __init__.py
│   ├── _markerlib
│   │   ├── __init__.py
│   │   ├── __init__.pyc
│   │   ├── markers.py
│   │   └── markers.pyc
│   ├── _pex
│   │   ├── archiver.py
│   │   ├── archiver.pyc
│   │   ├── base.py
│   │   ├── base.pyc
│   │   ├── common.py
│   │   ├── common.pyc
│   │   ├── compatibility.py
│   │   ├── compatibility.pyc
│   │   ├── compiler.py
│   │   ├── compiler.pyc
│   │   ├── crawler.py
│   │   ├── crawler.pyc
│   │   ├── environment.py
│   │   ├── environment.pyc
│   │   ├── fetcher.py
│   │   ├── fetcher.pyc
│   │   ├── finders.py
│   │   ├── finders.pyc
│   │   ├── http.py
│   │   ├── http.pyc
│   │   ├── __init__.py
│   │   ├── __init__.pyc
│   │   ├── installer.py
│   │   ├── installer.pyc
│   │   ├── interpreter.py
│   │   ├── interpreter.pyc
│   │   ├── iterator.py
│   │   ├── iterator.pyc
│   │   ├── link.py
│   │   ├── link.pyc
│   │   ├── orderedset.py
│   │   ├── orderedset.pyc
│   │   ├── package.py
│   │   ├── package.pyc
│   │   ├── pep425.py
│   │   ├── pep425.pyc
│   │   ├── pex_bootstrapper.py
│   │   ├── pex_bootstrapper.pyc
│   │   ├── pex_builder.py
│   │   ├── pex_builder.pyc
│   │   ├── pex_info.py
│   │   ├── pex_info.pyc
│   │   ├── pex.py
│   │   ├── pex.pyc
│   │   ├── platforms.py
│   │   ├── platforms.pyc
│   │   ├── requirements.py
│   │   ├── requirements.pyc
│   │   ├── resolvable.py
│   │   ├── resolvable.pyc
│   │   ├── resolver_options.py
│   │   ├── resolver_options.pyc
│   │   ├── resolver.py
│   │   ├── resolver.pyc
│   │   ├── sorter.py
│   │   ├── sorter.pyc
│   │   ├── testing.py
│   │   ├── testing.pyc
│   │   ├── tracer.py
│   │   ├── tracer.pyc
│   │   ├── translator.py
│   │   ├── translator.pyc
│   │   ├── util.py
│   │   ├── util.pyc
│   │   ├── variables.py
│   │   ├── variables.pyc
│   │   ├── version.py
│   │   └── version.pyc
│   ├── pkg_resources
│   │   ├── __init__.py
│   │   ├── __init__.pyc
│   │   └── _vendor
│   │       ├── __init__.py
│   │       ├── __init__.pyc
│   │       └── packaging
│   │           ├── __about__.py
│   │           ├── __about__.pyc
│   │           ├── _compat.py
│   │           ├── _compat.pyc
│   │           ├── __init__.py
│   │           ├── __init__.pyc
│   │           ├── specifiers.py
│   │           ├── specifiers.pyc
│   │           ├── _structures.py
│   │           ├── _structures.pyc
│   │           ├── version.py
│   │           └── version.pyc
│   ├── pkg_resources.py
│   └── pkg_resources.pyc
├── heron
│   ├── common
│   │   ├── __init__.py
│   │   └── tests
│   │       ├── __init__.py
│   │       └── python
│   │           ├── __init__.py
│   │           └── pex_loader
│   │               ├── __init__.py
│   │               └── testdata
│   │                   ├── __init__.py
│   │                   └── src
│   │                       ├── __init__.py
│   │                       ├── sample.py
│   │                       └── sample.pyc
│   └── __init__.py
├── __main__.py
├── __main__.pyc
└── PEX-INFO

13 directories, 103 files

@jsirois
Copy link
Contributor

jsirois commented Dec 21, 2018

It would be excellent if you closed either pex-tool/pex#636 or this issue to keep a single stream of conversation going. That said - there is more detail here. I can say the shebang in pex is configurable. Installing pex and executing pex --help will be instructive as will it's docs ; a good entrypoint for those is at https://github.com/pantsbuild/pex/blob/master/README.rst.

There are differences between pex, and the pexes pants creates. Pants does not expose every option pex supports today - and it may make sense to expose more (Pants feature requests are appropriate here), or it may be a Pants bug when certain options aren't used or used properly (your interpreter constraints or python target cmpatibilities allow for python3 but the generated pex shebang is python2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants