indygreg / indygreg/PyOxidizer

Error after `pyoxidizer run`: "unexpected entry in distribution root directory: .DS_Store"

Open
#733 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
6.2k
Forks
256
PR merge metrics
No merged PRs in 30d

Description

When I follow the instructions for *Getting Started, Customizing Python and Packaging Behavior*, with this line in the .bzl file uncommented

` python_config.run_command = "import uuid; print(uuid.uuid4())"`

I get the following error:

```
(.venv) -> pyoxidizer run
resolving 1 targets
resolving target install
resolving target exe
target Python distribution for aarch64-apple-darwin resolves to: https://github.com/indygreg/python-build-standalone/releases/download/20221220/cpython-3.9.16%2B20221220-aarch64-apple-darwin-pgo-full.tar.zst (sha256=a83812be1383194760c5afcf85c51c553ab5e97ff2047688ced7f99aa15edda1)
error[PYOXIDIZER_BUILD]: reading tar.zst distribution data

Caused by:
0: reading tar distribution data
1: unexpected entry in distribution root directory: .DS_Store
--> ./pyoxidizer.bzl:22:14
|
22 | policy = dist.make_python_packaging_policy()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ resolve_distribution


error: reading tar.zst distribution data

Caused by:
0: reading tar distribution data
1: unexpected entry in distribution root directory: .DS_Store

```

For different Python versions (3.9, 3.8), I tried making this change in the .bzl file:

```
dist = default_python_distribution(
flavor = 'standalone', build_target = 'aarch64-apple-darwin',
python_version = '3.8'
)

```
The first time I run the `pyoxidizer run` command with a new Python version, it works, but when I try a second time I get the `.DS_Store` error.

I've tried deleting any instances of the `.DS_Store` file from the directory for the app but this does not resolve the issue. I don't know which directory is the distribution root directory.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failure by running `pyoxidizer run` twice with the configuration shown in `pyoxidizer.bzl`, then start at line 22 where `resolve_distribution` is called. Trace how the Python distribution archive is read and identify why `.DS_Store` reaches the distribution root; done means repeated runs no longer fail with this error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.