ahkpp icon indicating copy to clipboard operation
ahkpp copied to clipboard

buildPaths error building ... - Since 2 days ( update ?)

Open loumizhu opened this issue 9 months ago • 6 comments

For troubleshooting assistance, refer to the troubleshooting guide

Description

When opening any ahk v1 file , output shows a lot of buildPaths errors

2025-04-03T09:25:18.658Z buildPaths error building c:\portable_apps\my_scripts\autohotkey\RM2module\c:\portable_apps\my_scripts\autohotkey\RM2module\RM2module.ahk 2025-04-03T09:25:18.659Z cannot open file:///c%3A/portable_apps/my_scripts/autohotkey/RM2module/c%3A/portable_apps/my_scripts/autohotkey/RM2module/RM2module.ahk%09%09%3B%20by%20Learning%20one. Detail: Unable to read file 'c:\portable_apps\my_scripts\autohotkey\RM2module\c:\portable_apps\my_scripts\autohotkey\RM2module\RM2module.ahk ; by Learning one' (Error: Unable to resolve nonexistent file 'c:\portable_apps\my_scripts\autohotkey\RM2module\c:\portable_apps\my_scripts\autohotkey\RM2module\RM2module.ahk ; by Learning one')

2025-04-03T09:30:29.817Z buildPaths error building C:\portable_apps\my_scripts\autohotkey\RM2module\Ahk_Script\Quick_Scripts\Lib\Faster_Script_-Optimize_Speed_To_MAX.ahk 2025-04-03T09:30:29.817Z cannot open file:///c%3A/portable_apps/my_scripts/autohotkey/RM2module/Ahk_Script/Quick_Scripts/Lib/Faster_Script-Optimize_Speed_To_MAX.ahk. Detail: Unable to read file 'c:\portable_apps\my_scripts\autohotkey\RM2module\Ahk_Script\Quick_Scripts\Lib\Faster_Script-Optimize_Speed_To_MAX.ahk' (Error: Unable to resolve nonexistent file 'c:\portable_apps\my_scripts\autohotkey\RM2module\Ahk_Script\Quick_Scripts\Lib\Faster_Script-_Optimize_Speed_To_MAX.ahk')

this included file is is located here #Include, %A_AhkPath%..\Lib\Faster_Script_-_Optimize_Speed_To_MAX.ahk

but it looks for in c:\portable_apps\my_scripts\autohotkey\RM2module\Ahk_Script\

and it looks a lot of file in that folder, although It's not special

Reproduction steps

Steps to reproduce the behavior:

  1. Open any Ahk file in vscode
  2. wait a little bit, and a wall of errors appears in output
  3. while the output errors are pouring, Can't write anything

Expected behavior

Nothing in the ouput

Additional context

it happened like yesterday, and it seems like the update broke it I checked the interpreter in on v1 (as shown in status bar) and tried defining it manually ctlk+k m I tried a full uninstall - reinstall

loumizhu avatar Apr 03 '25 09:04 loumizhu

Have run into the same errors from within a library relying on relative includes resembling the following:

#Include %A_ScriptDir%\..\SiblingDir\CommonFile.ahk

results in the following type of message:

2025-04-03T21:55:14.922Z buildPaths error building <drive>:\<ParentDir>\<ScriptDir>\<drive>:\<ParentDir>\<SiblingDir>\<CommonFile>.ahk
2025-04-03T21:55:14.923Z cannot open file:///<drive>%3A/<ParentDir>/<ScriptDir>/<drive>%3A/<ParentDir>/<SiblingDir>/<CommonFile>.ahk. Detail: Unable to read file '<drive>:\<ParentDir>\<ScriptDir>\<drive>:\<ParentDir>\<SiblingDir>\<CommonFile>.ahk' (Error: Unable to resolve nonexistent file '<drive>:\<ParentDir>\<ScriptDir>\<drive>:\<ParentDir>\<SiblingDir>\<CommonFile>.ahk')

Dis/Re-Enabling confirms with Output; significant load difference noted.

babalu-community avatar Apr 03 '25 22:04 babalu-community

Version rollback removed most of the errors, but several remained; these used a similar relative scheme, but with A_LineFile instead of A_ScriptDir.

Seems related to handling of relative paths in certain contexts.

Use %A_LineFile%.. to refer to the directory which contains the current file, even if it is not the main script file. For example, #Include %A_LineFile%..\other.ahk. [v1.1.28+]: %A_AhkPath%.. can be used to refer to the directory containing AutoHotkey.exe.

babalu-community avatar Apr 03 '25 22:04 babalu-community

Encountering the same issue while opening the ahk v1 file, rollback the extension to 6.7.0 to resolve it.

feeas avatar Apr 05 '25 02:04 feeas

@feeas 6.7.0 is the latest.

fade2gray avatar Apr 05 '25 09:04 fade2gray

@feeas 6.7.0 is the latest.

Sorry, I actually meant to say version 6.6.0.

feeas avatar Apr 05 '25 09:04 feeas

I'll move this log to debug for the next release as I look into it, it's related to #623 for anyone curious. Looks like the filename resolution isn't good enough to justify a warning log yet, sorry for the noise. You can safely ignore this log in the meantime.

mark-wiemer avatar Apr 06 '25 16:04 mark-wiemer

See also #646 and #649

mark-wiemer avatar May 14 '25 02:05 mark-wiemer