gentle-flower-25372
03/01/2024, 3:16 PMinclude_sources=False
doesn't actually include anything in the pex. Before I followed the blog post the pex_binary had everything in it.
$ pants package apps/app-api:binary-deps
15:10:29.30 [INFO] Wrote dist/apps.app-api/binary-deps.pex
$ tree dist/apps.app-api/binary-deps.pex
dist/apps.app-api/binary-deps.pex
├── PEX-INFO
├── __main__.py
└── __pex__
└── __init__.py
1 directory, 3 files
# BUILD
pex_binary(
name="binary-deps",
include_sources=False,
include_tools=True,
complete_platforms=[
"3rdparty/platforms:docker_python_3_9_bullseye",
],
dependencies=[
"apps/app-api:poetry#celery",
"apps/app-api:poetry#ddtrace",
"apps/app-api:poetry#gunicorn",
# Generated
"apps/app-api/app_api:app_api",
"apps/app-api/app_api/alembic:alembic",
"apps/app-api/app_api/alembic/versions:versions",
"apps/app-api/app_api/auth:auth",
"apps/app-api/app_api/config:config",
"apps/app-api/app_api/controllers:controllers",
"apps/app-api/app_api/custom_models:custom_models",
"apps/app-api/app_api/data:data",
],
# Optimal settings for Docker builds
layout = "packed",
execution_mode = "venv",
)
curved-television-6568
03/01/2024, 3:40 PMpex_binary
? pants peek apps/app-api:binary-deps
curved-television-6568
03/01/2024, 3:42 PMgentle-flower-25372
03/01/2024, 3:46 PM$ pants peek apps/app-api:binary-deps
[
{
"address": "apps/app-api:binary-deps",
"target_type": "pex_binary",
"args": null,
"complete_platforms": [
"3rdparty/platforms:docker_python_3_9_bullseye"
],
"dependencies": [
"apps/app-api:poetry#celery",
"apps/app-api:poetry#ddtrace",
"apps/app-api:poetry#gunicorn",
...
curved-television-6568
03/01/2024, 4:10 PM--keep-sandboxes=always
and inspect the sandbox building the pex file, to see what files are in there, and what pex command was used etc..gentle-flower-25372
03/01/2024, 4:10 PMcurved-television-6568
03/01/2024, 4:11 PMbetter-van-82973
03/01/2024, 6:57 PMinclude_sources=False,
include_tools=True,
gentle-flower-25372
03/01/2024, 7:50 PMlayout
from packed
to loose
without any other changes and it breaks everything also 😢broad-processor-92400
03/02/2024, 3:43 AM.deps
maybe), so if you’re inspecting one, make sure that those are included in the listing (eg ls -a
)