indygreg / indygreg/PyOxidizer

panick processing Python .pyc file not slated for inclusion

Open
#154 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Rust
Stars
6.2k
Forks
256
PR merge metrics
No merged PRs in 30d

Description

I have some junk in my site-packages, and PyOxidizer is choking when it encounters them, when it should report and move on as these files are irrelevant to the rule.
(adding `excludes: ["cproton"]` also didnt help)

```rust
processing packaging rule: PackageRoot(PackagingPackageRoot { path: "/usr/lib64/python3.7", packages: ["distutils", "distutils.tests", "idlelib", "idlelib.idle_test"], optimize_level: 0, excludes: [], include_source: true, install_location: Embedded })
thread 'main' panicked at 'encountered .pyc file with invalid path: cproton.pyc', /home/jayvdb/.cargo/registry/src/github.com-1ecc6299db9ec823/pyoxidizer-0.4.0/src/pyrepackager/fsscan.rs:260:21
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
1: std::sys_common::backtrace::print
at src/libstd/sys_common/backtrace.rs:71
at src/libstd/sys_common/backtrace.rs:59
2: std::panicking::default_hook::{{closure}}
at src/libstd/panicking.rs:197
3: std::panicking::default_hook
at src/libstd/panicking.rs:211
4: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:474
5: std::panicking::continue_panic_fmt
at src/libstd/panicking.rs:381
6: std::panicking::begin_panic_fmt
at src/libstd/panicking.rs:336
7: ::next
8: pyoxidizer::pyrepackager::packaging_rule::resolve_python_packaging
9: pyoxidizer::pyrepackager::repackage::resolve_python_resources
10: pyoxidizer::pyrepackager::repackage::process_config
11: pyoxidizer::projectmgmt::build_pyoxidizer_artifacts
12: pyoxidizer::projectmgmt::build_project
13: pyoxidizer::cli::run_cli
14: pyoxidizer::main
15: std::rt::lang_start::{{closure}}
16: std::panicking::try::do_call
at src/libstd/rt.rs:49
at src/libstd/panicking.rs:293
17: __rust_maybe_catch_panic
at src/libpanic_unwind/lib.rs:87
18: std::rt::lang_start_internal
at src/libstd/panicking.rs:272
at src/libstd/panic.rs:388
at src/libstd/rt.rs:48
19: main
20: __libc_start_main
21: _start
at ../sysdeps/x86_64/start.S:120
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at src/pyrepackager/fsscan.rs:260 in PythonResourceIterator::next, then follow the packaging path through resolve_python_packaging. Reproduce the PackageRoot scan containing cproton.pyc and verify that an invalid, excluded .pyc is reported or skipped without panicking.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.