indygreg / indygreg/PyOxidizer

Filesystem-relative imports do not work from network locations on Windows

Open
#709 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Steps to reproduce:

  1. Create a simple pyoxidizer.bzl config with filesystem-relative imports enabled
def make_exe():
    dist = default_python_distribution()
    policy = dist.make_python_packaging_policy()
    policy.resources_location = "filesystem-relative:lib"
    python_config = dist.make_python_interpreter_config()
    python_config.module_search_paths = ["$ORIGIN/lib"]
    python_config.run_command = "import ctypes; print(ctypes.get_errno())"

    exe = dist.to_python_executable(
        name="example",
        packaging_policy=policy,
        config=python_config,
    )
    return exe

def make_install(exe):
    files = FileManifest()
    files.add_python_resource("example", exe)
    return files

register_target("exe", make_exe)
register_target("install", make_install, depends=["exe"], default=True)

resolve_targets()
  1. Build using pyoxidizer build in a Windows environment
  2. Move the compiled output (including all its extra files) to an SMB share (either mapped or unmapped) and execute it

Expected behavior:
ctypes imports correctly and the program outputs 0

Actual behavior:
Program crashes when importing ctypes:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "ctypes", line 8, in <module>
ImportError: DLL load failed while importing _ctypes: The parameter is incorrect.

Using:

  • Pyoxidizer 0.24.0
  • Python 3.10.10

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

No source file or test is named. Start by reproducing the provided PyOxidizer 0.24.0 configuration on Windows from both mapped and unmapped SMB locations, then trace the filesystem-relative resource and module-search-path handling; done means ctypes imports successfully and prints 0 from the network location.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
build-system, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.