beeware / beeware/briefcase

Briefcase download an incomplete rcedit-x64.exe lead to "OSerror: [WinError 193] %1 is not a valid win32 application"

Open
#1,160 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
3.3k
Forks
549
Avg merge
1d 4h
Merged PRs (30d)
40

Description

### Describe the bug

The first time to run `briefcase build`, it downloads a file "_rcedit-x64.exe_" to path _C:\Users\\AppData\Local\BeeWare\briefcase\Cache\tools_ (THE_TOOLS_PATH).

In some way, I get an incomplete one, so that I can't build my application. Then the problem is:
There is no way to make sure you get a healthy "_rcedit-x64.exe_", or if you get a bad one, the trackback don't show you any thing about "_rcedit-x64.exe_", and this is hard to know the real problem.

### Steps to reproduce

1. Make sure there is not a file "_rcedit-x64.exe_" or "_rcedit-x64.exe_" in THE_TOOLS_PATH above. If there is one, delete it.
2. Create a new briefcase project
3. Create scaffold via `briefcase create`
4. Then `briefcase build`, it should not find the rcedit file and start downloading "_rcedit-x64.exe_". If your have a bad Internet, you can get an **incomplete** "_rcedit-x64.exe_" in THE_TOOLS_PATH.
5. "OSerror: [WinError 193] %1 is not a valid win32 application" will occur.

### Expected behavior

A perfect build process.

### Screenshots

![image](https://user-images.githubusercontent.com/8564451/229297319-73217f29-c230-4634-8cbb-176582be4b72.png)

### Environment

- Operating System: Windows 10 21H2
- Python version: 3.11.2
- Software versions:
- Briefcase: 0.3.13
- Toga: 0.3.0

### Logs

I've fixed this so I can't get a bug log.

### Additional context

# How to fix
if you're facing this, download a rcedit-x64.exe from [rcedit](https://github.com/electron/rcedit/releases/tag/v1.1.1). Replace it in _C:\Users\\AppData\Local\BeeWare\briefcase\Cache\tools_

Contributor guide

Open the contributing guide

Research direction

Start at the briefcase build path that downloads rcedit-x64.exe into THE_TOOLS_PATH, and reproduce the failure with a missing or incomplete cached executable on Windows. Trace how the downloaded tool is validated and how WinError 193 is reported; done means an incomplete download is detected or retried and the resulting build error identifies rcedit-x64.exe.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.