Update app.py
Browse files
app.py
CHANGED
@@ -309,7 +309,7 @@ try:
|
|
309 |
return original_urlopen(url, *args, **kwargs)
|
310 |
except urllib.error.URLError as e:
|
311 |
if hasattr(e, 'reason') and 'could not resolve host' in str(e.reason).lower():
|
312 |
-
print(f"\\nβ DNS Resolution Error: {e.reason}")
|
313 |
handle_network_error()
|
314 |
sys.exit(6) # Exit with the same code for consistency
|
315 |
raise
|
@@ -664,6 +664,33 @@ exec /usr/bin/x86_64-w64-mingw32-{tool} "$@"
|
|
664 |
else:
|
665 |
arch_used = "Native Linux"
|
666 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
667 |
# Create result summary
|
668 |
result_summary = f"""# β
Compilation Successful!
|
669 |
|
@@ -687,12 +714,7 @@ exec /usr/bin/x86_64-w64-mingw32-{tool} "$@"
|
|
687 |
{binary_info}
|
688 |
|
689 |
## π Cross-Compilation Details:
|
690 |
-
{
|
691 |
-
- Target architecture: {env.get('TARGET_ARCH', 'default')}
|
692 |
-
- Cross-compile prefix: {env.get('CROSS_COMPILE', 'none')}
|
693 |
-
- Compiler flags: {env.get('CFLAGS', 'none')}
|
694 |
-
- Verified architecture: {arch_info}
|
695 |
-
- Environment variables set: {len([k for k in env.keys() if k.startswith(('CC', 'CXX', 'TARGET', 'CROSS'))])} variables''' if output_extension == '.exe' else '- Native Linux compilation'}
|
696 |
|
697 |
## π Usage Instructions:
|
698 |
```bash
|
@@ -702,12 +724,7 @@ exec /usr/bin/x86_64-w64-mingw32-{tool} "$@"
|
|
702 |
```
|
703 |
|
704 |
## β οΈ Cross-Compilation Notes:
|
705 |
-
{
|
706 |
-
- Used comprehensive environment variable setup
|
707 |
-
- All MinGW-w64 tools explicitly set
|
708 |
-
- Wrapper scripts created for version compatibility
|
709 |
-
- Binary verified with file command
|
710 |
-
- Should run on Windows {arch_info} systems''' if output_extension == '.exe' else 'Native Linux compilation with maximum compatibility'}
|
711 |
|
712 |
## π Network Dependencies:
|
713 |
- Binary includes enhanced error handling for network issues
|
@@ -722,11 +739,7 @@ exec /usr/bin/x86_64-w64-mingw32-{tool} "$@"
|
|
722 |
```
|
723 |
|
724 |
## π§ Technical Details:
|
725 |
-
{
|
726 |
-
- Wrapper scripts handle version parsing issues
|
727 |
-
- Cross-compilation forced with {len([k for k in env.keys() if k.startswith(('CC', 'CXX', 'TARGET', 'CROSS'))])} environment variables
|
728 |
-
- Binary architecture verified: {arch_info}
|
729 |
-
- Network error handling enhanced for better diagnostics''' if output_extension == '.exe' else '- Native compilation optimized for compatibility\n- Network error handling added for better runtime diagnostics'}"""
|
730 |
|
731 |
if progress_callback:
|
732 |
progress_callback(1.0, f"Compilation successful! Created {arch_info} executable π")
|
|
|
309 |
return original_urlopen(url, *args, **kwargs)
|
310 |
except urllib.error.URLError as e:
|
311 |
if hasattr(e, 'reason') and 'could not resolve host' in str(e.reason).lower():
|
312 |
+
print(f"\\nβ DNS Resolution Error: {{e.reason}}")
|
313 |
handle_network_error()
|
314 |
sys.exit(6) # Exit with the same code for consistency
|
315 |
raise
|
|
|
664 |
else:
|
665 |
arch_used = "Native Linux"
|
666 |
|
667 |
+
# Fix f-string issue by using separate variables
|
668 |
+
if output_extension == '.exe':
|
669 |
+
cross_compilation_details = f'''- Cross-compiler: {env.get('CC', 'default')}
|
670 |
+
- Target architecture: {env.get('TARGET_ARCH', 'default')}
|
671 |
+
- Cross-compile prefix: {env.get('CROSS_COMPILE', 'none')}
|
672 |
+
- Compiler flags: {env.get('CFLAGS', 'none')}
|
673 |
+
- Verified architecture: {arch_info}
|
674 |
+
- Environment variables set: {len([k for k in env.keys() if k.startswith(('CC', 'CXX', 'TARGET', 'CROSS'))])} variables'''
|
675 |
+
|
676 |
+
cross_compilation_notes = f'''- Successfully cross-compiled for Windows {arch_info}
|
677 |
+
- Used comprehensive environment variable setup
|
678 |
+
- All MinGW-w64 tools explicitly set
|
679 |
+
- Wrapper scripts created for version compatibility
|
680 |
+
- Binary verified with file command
|
681 |
+
- Should run on Windows {arch_info} systems'''
|
682 |
+
|
683 |
+
technical_details = f'''- Environment variables comprehensively set for 64-bit compilation
|
684 |
+
- Wrapper scripts handle version parsing issues
|
685 |
+
- Cross-compilation forced with {len([k for k in env.keys() if k.startswith(('CC', 'CXX', 'TARGET', 'CROSS'))])} environment variables
|
686 |
+
- Binary architecture verified: {arch_info}
|
687 |
+
- Network error handling enhanced for better diagnostics'''
|
688 |
+
else:
|
689 |
+
cross_compilation_details = "- Native Linux compilation"
|
690 |
+
cross_compilation_notes = "Native Linux compilation with maximum compatibility"
|
691 |
+
technical_details = """- Native compilation optimized for compatibility
|
692 |
+
- Network error handling added for better runtime diagnostics"""
|
693 |
+
|
694 |
# Create result summary
|
695 |
result_summary = f"""# β
Compilation Successful!
|
696 |
|
|
|
714 |
{binary_info}
|
715 |
|
716 |
## π Cross-Compilation Details:
|
717 |
+
{cross_compilation_details}
|
|
|
|
|
|
|
|
|
|
|
718 |
|
719 |
## π Usage Instructions:
|
720 |
```bash
|
|
|
724 |
```
|
725 |
|
726 |
## β οΈ Cross-Compilation Notes:
|
727 |
+
{cross_compilation_notes}
|
|
|
|
|
|
|
|
|
|
|
728 |
|
729 |
## π Network Dependencies:
|
730 |
- Binary includes enhanced error handling for network issues
|
|
|
739 |
```
|
740 |
|
741 |
## π§ Technical Details:
|
742 |
+
{technical_details}"""
|
|
|
|
|
|
|
|
|
743 |
|
744 |
if progress_callback:
|
745 |
progress_callback(1.0, f"Compilation successful! Created {arch_info} executable π")
|