indygreg / indygreg/PyOxidizer

Regression in 0.9.0 - pythonXY.lib : fatal error LNK1136: invalid or corrupt file

Open
#302 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
6.2k
Forks
256
PR merge metrics
No merged PRs in 30d

Description

This issue is a regression since 0.7.0 and affects both 0.8.0 and 0.9.0.

I have a PyOxidizer project with the following:

```
pyembed = { version = "0.9", default-features = false, features = ["build-mode-pyoxidizer-exe", "cpython-link-unresolved-static"] }
```

I have updated my `pyoxidizer.bzl` as required since changes from 0.7. Build works perfectly fine on macOS, but it fails with a very obscure issue on Windows (partially cropped):

```
2_32.lib" "kernel32.lib" "advapi32.lib" "advapi32.lib" "cfgmgr32.lib" "credui.lib" "fwpuclnt.lib" "gdi32.lib" "kernel32.lib" "msimg32.lib" "ntdll.lib" "ole32.lib" "opengl32.lib" "secur32.lib" "shell32.lib" "shlwapi.lib" "user32.lib" "winspool.lib" "ws2_32.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib"
"pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib"
"pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "pythonXY.lib" "advapi32.lib" "ws2_32.lib" "userenv.lib" "msvcrt.lib"
= note: D:\kbdgen\build\x86_64-pc-windows-msvc\debug\resources\pythonXY.lib : fatal error LNK1136: invalid or corrupt file
```

If I check, `pythonXY.lib` is a 0 byte file. The repo is http://github.com/divvun/kbdgen, you should be able to replicate this locally with `cargo build`.

`pyoxidizer build` succeeds, but doesn't build the binary I need (ie, I am integrating a python interpreter.)

The Python version installed on the system is 3.8.6.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the Windows failure from the kbdgen repository with cargo build, using the pyembed settings shown in the issue, and compare it with pyoxidizer build. Inspect the generated pythonXY.lib and the pyoxidizer.bzl configuration; done means the integrated Python build produces a valid non-empty library and completes successfully on Windows.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.