Skip to content

refactor(windows): dedupe ifx/ifort Intel env-capture logic - #7

Closed
djkees wants to merge 3 commits into
developfrom
refactor/ifx-ifort-windows-env-capture
Closed

djkees wants to merge 3 commits into
developfrom
refactor/ifx-ifort-windows-env-capture

Conversation

@djkees

@djkees djkees commented Sep 14, 2026

Copy link
Copy Markdown
Owner

ifx and ifort on Windows each hand-rolled the same ~60-line block: generate a batch file that runs vcvars64.bat then Intel's setvars.bat and dumps the environment, parse the output, filter Git's link.exe out of PATH, and export the rest. PR fortran-lang#260 (the PATH-dedup fix) had to patch both copies identically — a sign this needed to be one function, not two.

  • Extracts the batch-file generation, env-line parsing, and PATH filtering into captureIntelWindowsEnvironment(setvarsBat, batchFileName) in a new src/intel_windows_env.ts.
  • ifx/win32.ts and ifort/win32.ts now just call it with their own setvars.bat path and batch filename; dropped their now-unused os/setup_msvc imports.
  • Pure refactor, no behavior change — all 16 existing ifx/ifort Windows tests pass unmodified, plus a new small test file for the extracted module.

709/709 unit tests pass; lint clean; npm run build + bundle smoke test both succeed (dist committed alongside source per the repo's convention).

djkees and others added 3 commits September 14, 2026 12:49
ifx and ifort each hand-rolled the same ~60-line batch-file generation
(vswhere -> vcvars64.bat -> setvars.bat -> env dump), env-line parsing, and
PATH filtering. PR fortran-lang#260 had to patch both copies identically to fix one
PATH bug. Extracts it into captureIntelWindowsEnvironment() in a new
intel_windows_env module; no behavior change.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The rebase's dist/ conflict was resolved with a placeholder; this
regenerates it fresh from source so it actually reflects the rebased tree.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@djkees
djkees force-pushed the refactor/ifx-ifort-windows-env-capture branch from e3d59f2 to d728da0 Compare September 14, 2026 18:50
@djkees

djkees commented Sep 14, 2026

Copy link
Copy Markdown
Owner Author

Moving this upstream: fortran-lang#268

@djkees djkees closed this Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant