Skip to content

Commit e2a32cf

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/main'
2 parents bee4d47 + e8d01e4 commit e2a32cf

File tree

2 files changed

+143
-53
lines changed

2 files changed

+143
-53
lines changed

.github/workflows/windows_test2.yml

Lines changed: 142 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Windows Path Detection Deep Debug
1+
name: Windows Path Detection Deep Debug - Fixed
22
on:
33
push:
44
branches:
@@ -190,10 +190,10 @@ jobs:
190190
shell: pwsh
191191
continue-on-error: true
192192

193-
- name: "PHASE 4: Configuration File Analysis"
193+
- name: "PHASE 4: Configuration File Analysis - FIXED"
194194
run: |
195195
Write-Host "=" * 80
196-
Write-Host "PHASE 4: CONFIGURATION FILE ANALYSIS"
196+
Write-Host "PHASE 4: CONFIGURATION FILE ANALYSIS - FIXED"
197197
Write-Host "=" * 80
198198
199199
Write-Host "`n--- Post-run Directory State ---"
@@ -212,28 +212,41 @@ jobs:
212212
$config_content = Get-Content ~\.config\omnipkg\config.json -Raw
213213
Write-Host $config_content
214214
215-
# Parse and analyze
215+
# Parse and analyze - FIXED JSON PARSING
216216
try {
217217
$config = $config_content | ConvertFrom-Json
218218
Write-Host "`n--- Parsed Configuration Analysis ---"
219219
Write-Host "Root level properties: $($config.PSObject.Properties.Name -join ', ')"
220220
221221
if ($config.environments) {
222222
Write-Host "Environments found: $($config.environments.PSObject.Properties.Name.Count)"
223-
foreach ($env_id in $config.environments.PSObject.Properties.Name) {
223+
224+
# FIXED: Properly access the first environment
225+
$env_ids = @($config.environments.PSObject.Properties.Name)
226+
foreach ($env_id in $env_ids) {
224227
$env_config = $config.environments.$env_id
225228
Write-Host "`nEnvironment ID: $env_id"
226-
Write-Host " python_executable: '$($env_config.python_executable)'"
227-
Write-Host " site_packages_path: '$($env_config.site_packages_path)'"
228-
Write-Host " version: '$($env_config.version)'"
229-
Write-Host " created_at: '$($env_config.created_at)'"
229+
230+
# FIXED: Properly check for null/empty values
231+
$python_exe = if ($env_config.python_executable) { $env_config.python_executable } else { "" }
232+
$site_path = if ($env_config.site_packages_path) { $env_config.site_packages_path } else { "" }
233+
$version = if ($env_config.version) { $env_config.version } else { "" }
234+
$created_at = if ($env_config.created_at) { $env_config.created_at } else { "" }
235+
236+
Write-Host " python_executable: '$python_exe'"
237+
Write-Host " site_packages_path: '$site_path'"
238+
Write-Host " version: '$version'"
239+
Write-Host " created_at: '$created_at'"
230240
231241
# Check if paths exist
232-
if ($env_config.python_executable) {
233-
Write-Host " python_executable exists: $(Test-Path $env_config.python_executable)"
242+
if ($python_exe) {
243+
Write-Host " python_executable exists: $(Test-Path $python_exe)"
244+
} else {
245+
Write-Host " python_executable is EMPTY!"
234246
}
235-
if ($env_config.site_packages_path) {
236-
Write-Host " site_packages_path exists: $(Test-Path $env_config.site_packages_path)"
247+
248+
if ($site_path) {
249+
Write-Host " site_packages_path exists: $(Test-Path $site_path)"
237250
} else {
238251
Write-Host " site_packages_path is EMPTY!"
239252
}
@@ -243,20 +256,17 @@ jobs:
243256
}
244257
} catch {
245258
Write-Host "Failed to parse config.json: $($_.Exception.Message)"
259+
Write-Host "Full error: $($_ | Out-String)"
246260
}
247261
} else {
248262
Write-Host "config.json does not exist!"
249263
}
250264
shell: pwsh
251265

252-
# =============================================================================
253-
# PHASE 5: GROUND TRUTH vs OMNIPKG COMPARISON
254-
# =============================================================================
255-
256-
- name: "PHASE 5: Ground Truth Discovery and Comparison"
266+
- name: "PHASE 5: Ground Truth Discovery and Comparison - FIXED"
257267
run: |
258268
Write-Host "=" * 80
259-
Write-Host "PHASE 5: GROUND TRUTH vs OMNIPKG COMPARISON"
269+
Write-Host "PHASE 5: GROUND TRUTH vs OMNIPKG COMPARISON - FIXED"
260270
Write-Host "=" * 80
261271
262272
Write-Host "`n--- Multiple Ground Truth Methods ---"
@@ -317,29 +327,34 @@ jobs:
317327
print(' Contains packaging .dist-info:', packaging_dist)
318328
"
319329
320-
Write-Host "`n--- omnipkg Configuration Comparison ---"
330+
Write-Host "`n--- omnipkg Configuration Comparison - FIXED ---"
321331
if (Test-Path ~\.config\omnipkg\config.json) {
322332
$config = Get-Content ~\.config\omnipkg\config.json | ConvertFrom-Json
323-
$omnipkg_path = $config.environments.psobject.properties[0].Value.site_packages_path
324-
325-
Write-Host "Ground Truth (pip show): '$pip_location'"
326-
Write-Host "omnipkg Config: '$omnipkg_path'"
327-
Write-Host "Paths match: $(if ($pip_location -eq $omnipkg_path) { 'YES' } else { 'NO' })"
328-
Write-Host "omnipkg path empty: $(if ([string]::IsNullOrEmpty($omnipkg_path)) { 'YES' } else { 'NO' })"
329333
330-
# Case sensitivity check
331-
if (![string]::IsNullOrEmpty($pip_location) -and ![string]::IsNullOrEmpty($omnipkg_path)) {
332-
Write-Host "Case-insensitive match: $(if ($pip_location.ToLower() -eq $omnipkg_path.ToLower()) { 'YES' } else { 'NO' })"
334+
# FIXED: Properly extract the site_packages_path
335+
$env_ids = @($config.environments.PSObject.Properties.Name)
336+
if ($env_ids.Count -gt 0) {
337+
$first_env_id = $env_ids[0]
338+
$first_env = $config.environments.$first_env_id
339+
$omnipkg_path = if ($first_env.site_packages_path) { $first_env.site_packages_path } else { "" }
340+
341+
Write-Host "Ground Truth (pip show): '$pip_location'"
342+
Write-Host "omnipkg Config: '$omnipkg_path'"
343+
Write-Host "Paths match: $(if ($pip_location -eq $omnipkg_path) { 'YES' } else { 'NO' })"
344+
Write-Host "omnipkg path empty: $(if ([string]::IsNullOrEmpty($omnipkg_path)) { 'YES' } else { 'NO' })"
345+
346+
# Case sensitivity check
347+
if (![string]::IsNullOrEmpty($pip_location) -and ![string]::IsNullOrEmpty($omnipkg_path)) {
348+
Write-Host "Case-insensitive match: $(if ($pip_location.ToLower() -eq $omnipkg_path.ToLower()) { 'YES' } else { 'NO' })"
349+
}
350+
} else {
351+
Write-Host "No environments found in omnipkg config"
333352
}
334353
} else {
335354
Write-Host "Cannot compare - omnipkg config.json not found"
336355
}
337356
shell: pwsh
338357

339-
# =============================================================================
340-
# PHASE 6: PATH CONSTRUCTION DEBUGGING
341-
# =============================================================================
342-
343358
- name: "PHASE 6: Path Construction Logic Debugging"
344359
run: |
345360
Write-Host "=" * 80
@@ -402,20 +417,41 @@ jobs:
402417
"
403418
shell: pwsh
404419

405-
- name: "PHASE 7: Final Diagnosis and Summary"
420+
- name: "PHASE 7: Final Diagnosis and Summary - FIXED"
406421
run: |
407422
Write-Host "=" * 80
408-
Write-Host "PHASE 7: FINAL DIAGNOSIS AND SUMMARY"
423+
Write-Host "PHASE 7: FINAL DIAGNOSIS AND SUMMARY - FIXED"
409424
Write-Host "=" * 80
410425
411426
Write-Host "`n--- Summary of Findings ---"
412427
Write-Host "1. omnipkg exit code: ${{ steps.omnipkg_run.outputs.OMNIPKG_EXIT_CODE }}"
413428
414429
if (Test-Path ~\.config\omnipkg\config.json) {
415430
$config = Get-Content ~\.config\omnipkg\config.json | ConvertFrom-Json
416-
$omnipkg_path = $config.environments.psobject.properties[0].Value.site_packages_path
417-
Write-Host "2. omnipkg detected site-packages: '$omnipkg_path'"
418-
Write-Host "3. Config path is empty: $(if ([string]::IsNullOrEmpty($omnipkg_path)) { 'YES - THIS IS THE PROBLEM' } else { 'NO' })"
431+
432+
# FIXED: Properly extract environment data
433+
$env_ids = @($config.environments.PSObject.Properties.Name)
434+
if ($env_ids.Count -gt 0) {
435+
$first_env_id = $env_ids[0]
436+
$first_env = $config.environments.$first_env_id
437+
$omnipkg_path = if ($first_env.site_packages_path) { $first_env.site_packages_path } else { "" }
438+
439+
Write-Host "2. omnipkg detected site-packages: '$omnipkg_path'"
440+
Write-Host "3. Config path is empty: $(if ([string]::IsNullOrEmpty($omnipkg_path)) { 'YES - THIS IS THE PROBLEM' } else { 'NO - PATH DETECTED CORRECTLY' })"
441+
442+
# Check other important fields
443+
$python_exe = if ($first_env.python_executable) { $first_env.python_executable } else { "" }
444+
$version = if ($first_env.version) { $first_env.version } else { "" }
445+
$created_at = if ($first_env.created_at) { $first_env.created_at } else { "" }
446+
447+
Write-Host "4. Python executable: '$python_exe'"
448+
Write-Host "5. Version field: '$version' $(if ([string]::IsNullOrEmpty($version)) { '(MISSING)' } else { '(OK)' })"
449+
Write-Host "6. Created at field: '$created_at' $(if ([string]::IsNullOrEmpty($created_at)) { '(MISSING)' } else { '(OK)' })"
450+
451+
} else {
452+
Write-Host "2. omnipkg environments: NONE FOUND"
453+
Write-Host "3. This indicates omnipkg failed during environment creation"
454+
}
419455
} else {
420456
Write-Host "2. omnipkg config.json: NOT CREATED"
421457
Write-Host "3. This indicates omnipkg failed during initialization"
@@ -431,28 +467,68 @@ jobs:
431467
}
432468
} catch {}
433469
434-
Write-Host "4. Ground truth (pip): '$pip_location'"
470+
Write-Host "7. Ground truth (pip): '$pip_location'"
435471
436-
Write-Host "`n--- Recommended Investigation Areas ---"
437-
Write-Host "- Check omnipkg's site-packages path detection logic for Windows"
438-
Write-Host "- Verify Windows path case handling (Lib vs lib)"
439-
Write-Host "- Check if omnipkg is using sys.prefix vs sys.executable for path construction"
440-
Write-Host "- Investigate any Windows-specific path normalization issues"
441-
Write-Host "- Review error handling in the configuration initialization code"
472+
Write-Host "`n--- Status Assessment ---"
473+
if (Test-Path ~\.config\omnipkg\config.json) {
474+
$config = Get-Content ~\.config\omnipkg\config.json | ConvertFrom-Json
475+
$env_ids = @($config.environments.PSObject.Properties.Name)
476+
if ($env_ids.Count -gt 0) {
477+
$first_env = $config.environments.$($env_ids[0])
478+
$has_site_path = ![string]::IsNullOrEmpty($first_env.site_packages_path)
479+
$has_python_exe = ![string]::IsNullOrEmpty($first_env.python_executable)
480+
481+
if ($has_site_path -and $has_python_exe) {
482+
Write-Host "STATUS: PATH DETECTION WORKING - Core functionality appears intact"
483+
} else {
484+
Write-Host "STATUS: PARTIAL SUCCESS - Some fields missing"
485+
}
486+
} else {
487+
Write-Host "STATUS: INITIALIZATION FAILED - No environments created"
488+
}
489+
} else {
490+
Write-Host "STATUS: COMPLETE FAILURE - No config file created"
491+
}
442492
443493
shell: pwsh
444494

445495
# =============================================================================
446-
# ARTIFACTS AND CLEANUP
496+
# ARTIFACTS AND CLEANUP - FIXED
447497
# =============================================================================
448498

449-
- name: Upload omnipkg output as artifact
499+
- name: Copy omnipkg config to workspace for upload
500+
run: |
501+
# Create a directory in the workspace to copy config files
502+
New-Item -ItemType Directory -Path "./debug-artifacts" -Force
503+
504+
if (Test-Path ~\.config\omnipkg) {
505+
# Copy the entire omnipkg config directory to workspace
506+
Copy-Item -Path ~\.config\omnipkg -Destination "./debug-artifacts/" -Recurse -Force
507+
Write-Host "Copied omnipkg config to workspace"
508+
} else {
509+
Write-Host "No omnipkg config to copy"
510+
# Create an empty marker file
511+
New-Item -ItemType File -Path "./debug-artifacts/no-config-created.txt" -Force
512+
}
513+
514+
# Also copy the output file if it exists
515+
if (Test-Path "./omnipkg_output.txt") {
516+
Copy-Item -Path "./omnipkg_output.txt" -Destination "./debug-artifacts/" -Force
517+
}
518+
519+
# List what we're about to upload
520+
Write-Host "`nFiles to be uploaded:"
521+
Get-ChildItem -Path "./debug-artifacts" -Recurse | ForEach-Object {
522+
Write-Host " $($_.FullName)"
523+
}
524+
shell: pwsh
525+
if: always()
526+
527+
- name: Upload omnipkg debug artifacts - FIXED
450528
uses: actions/upload-artifact@v4
451529
with:
452-
name: omnipkg-debug-output
453-
path: |
454-
omnipkg_output.txt
455-
~/.config/omnipkg/**
530+
name: omnipkg-debug-output-fixed
531+
path: ./debug-artifacts/
456532
if: always()
457533

458534
- name: Final Status
@@ -461,6 +537,20 @@ jobs:
461537
Write-Host "INVESTIGATION COMPLETE: omnipkg failed with exit code ${{ steps.omnipkg_run.outputs.OMNIPKG_EXIT_CODE }}"
462538
exit 1
463539
} else {
464-
Write-Host "INVESTIGATION COMPLETE: omnipkg ran but may have path detection issues"
540+
Write-Host "INVESTIGATION COMPLETE: omnipkg ran successfully"
541+
# Additional check for path detection
542+
if (Test-Path ~\.config\omnipkg\config.json) {
543+
$config = Get-Content ~\.config\omnipkg\config.json | ConvertFrom-Json
544+
$env_ids = @($config.environments.PSObject.Properties.Name)
545+
if ($env_ids.Count -gt 0) {
546+
$first_env = $config.environments.$($env_ids[0])
547+
if ([string]::IsNullOrEmpty($first_env.site_packages_path)) {
548+
Write-Host "WARNING: Path detection failed - site_packages_path is empty"
549+
exit 1
550+
} else {
551+
Write-Host "SUCCESS: Path detection working correctly"
552+
}
553+
}
554+
}
465555
}
466556
shell: pwsh

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Born from a real-world nightmare—a forced downgrade that wrecked a production
8888
<!-- COMPARISON_STATS_START -->
8989
## ⚖️ Multi-Version Support
9090

91-
[![omnipkg](https://img.shields.io/badge/omnipkg-739%20Wins-brightgreen?logo=python&logoColor=white)](https://github.com/1minds3t/omnipkg/actions/workflows/omnipkg_vs_the_world.yml) [![pip](https://img.shields.io/badge/pip-742%20Failures-red?logo=pypi&logoColor=white)](https://github.com/1minds3t/omnipkg/actions/workflows/omnipkg_vs_the_world.yml) [![uv](https://img.shields.io/badge/uv-742%20Failures-red?logo=python&logoColor=white)](https://github.com/1minds3t/omnipkg/actions/workflows/omnipkg_vs_the_world.yml)
91+
[![omnipkg](https://img.shields.io/badge/omnipkg-740%20Wins-brightgreen?logo=python&logoColor=white)](https://github.com/1minds3t/omnipkg/actions/workflows/omnipkg_vs_the_world.yml) [![pip](https://img.shields.io/badge/pip-743%20Failures-red?logo=pypi&logoColor=white)](https://github.com/1minds3t/omnipkg/actions/workflows/omnipkg_vs_the_world.yml) [![uv](https://img.shields.io/badge/uv-743%20Failures-red?logo=python&logoColor=white)](https://github.com/1minds3t/omnipkg/actions/workflows/omnipkg_vs_the_world.yml)
9292

9393
*Multi-version installation tests run hourly. [Live results here.](https://github.com/1minds3t/omnipkg/actions/workflows/omnipkg_vs_the_world.yml)*
9494

0 commit comments

Comments
 (0)