Skip to content

Handle Windows paths - #379

Merged
fingolfin merged 2 commits into
masterfrom
mh/win-paths
Nov 10, 2026
Merged

fingolfin merged 2 commits into
masterfrom
mh/win-paths

Conversation

@fingolfin

Copy link
Copy Markdown
Member

AUTODOC_CurrentDirectory ran the pwd program, which under MSYS2 prints a path such as /c/gap2 that native Windows programs cannot use. Several places also took a path to be absolute only if it starts with a slash, so on Windows they prefixed an absolute C:/... path with that directory, yielding /c/gap2/C:/gap2/... . Use GAP_getcwd, and recognize drive paths as absolute via the new AUTODOC_IsAbsolutePath.

Assisted-by: Claude Code (Opus 5)


GAP_getcwd is only available in recent GAP; and AUTODOC_IsAbsolutePath is probably something we should have built into GAP. So I am not sure we'll want to keep this as it is. Hrm.

@codecov

codecov Bot commented Sep 13, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.30435% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.00%. Comparing base (a8c0b99) to head (fd36055).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
gap/ToolFunctions.gi 89.47% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #379      +/-   ##
==========================================
- Coverage   93.04%   93.00%   -0.05%     
==========================================
  Files          15       15              
  Lines        3135     3144       +9     
==========================================
+ Hits         2917     2924       +7     
- Misses        218      220       +2     
Files with missing lines Coverage Δ
gap/AutoDocMainFunction.gi 93.58% <100.00%> (ø)
gap/Examples.gi 96.22% <100.00%> (ø)
gap/ToolFunctions.gd 100.00% <100.00%> (ø)
gap/ToolFunctions.gi 93.00% <89.47%> (-0.31%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fingolfin
fingolfin marked this pull request as ready for review November 10, 2026 13:45
AUTODOC_CurrentDirectory ran the pwd program, which under MSYS2 prints
a path such as /c/gap2 that native Windows programs cannot use. Several
places also took a path to be absolute only if it starts with a slash,
so on Windows they prefixed an absolute C:/... path with that directory,
yielding /c/gap2/C:/gap2/... . Use GAP_getcwd, and recognize drive
paths as absolute via the new AUTODOC_IsAbsolutePath.

Assisted-by: Generative AI
AUTODOC_CreateDirIfMissing treated only paths starting with a slash as
absolute, so a `..` could remove the drive of a path such as
C:/../doc and create the directory relative to the working directory
instead. Split off the root prefix of the path first, shared with
AUTODOC_IsAbsolutePath via the new AUTODOC_PathRoot. Check
ARCH_IS_WINDOWS last there, as on Cygwin it tests for files.

AUTODOC_CurrentDirectory now raises an error when the working
directory cannot be determined, instead of returning fail.

Assisted-by: Generative AI
@fingolfin
fingolfin merged commit fe784fd into master Nov 10, 2026
4 of 5 checks passed
@fingolfin
fingolfin deleted the mh/win-paths branch November 10, 2026 17:13
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