AL-Go icon indicating copy to clipboard operation
AL-Go copied to clipboard

[Bug]: Branches with long names breaks build due to exessive path length

Open AskeHolst opened this issue 3 months ago • 3 comments

AL-Go version

7.2

Describe the issue

In a repo with multiple projects and UseProjectDependencies the PR build of apps dependent on apps in other projects will fail if the branch being merge from is very long.

Essentially it will succesfully download the artifacts from the other project build, but use a path longer than 260 chars. When trying to use the app it fails.

Expected behavior

Branches with long names should not be directly used for path names.

Steps to reproduce

  • Create a repo having a long name with two projects and UseProjectDependencies = true.
  • In project 1 create a simple app, App1.
  • In project 2 create an app, App2 with a dependency on App1.
  • Create a branch with a very long name, say 100+ chars (GitHub will do that if you create a branch from an issue with long name).
  • Add some changes to the branch.
  • Create a PR
  • ‼️The PR build fails.

Additional context (logs, screenshots, etc.)

    _____           _        _ _ _
   |_   _|         | |      | | (_)
     | |  _ __  ___| |_ __ _| | |_ _ __   __ _    __ _ _ __  _ __  ___
     | | | '_ \/ __| __/ _` | | | | '_ \ / _` |  / _` | '_ \| '_ \/ __|
    _| |_| | | \__ \ |_ (_| | | | | | | | (_| | | (_| | |_) | |_) \__ \
   |_____|_| |_|___/\__\__,_|_|_|_|_| |_|\__, |  \__,_| .__/| .__/|___/
                                          __/ |       | |   | |
                                         |___/        |_|   |_|
  
  Warning: File not found: C:\2\_work\PurchaseTaxRetention\PurchaseTaxRetention\.dependencies\PTR-Library-nno_313-unapply-a-pi-that-is-posted-in-a-closed-cis-period-but-the-posting-date-for-the-reversal-is-in-an-open-period-Apps-PR314-20250905\pryme_Purchase Tax Retention_11.0.2147483647.245.app
  Compilation started for project 'CIS & RCT tax retention' containing '75' files at '09:12:55.870'.
  
  Error: AL1022 A package with publisher 'pryme', name 'Purchase Tax Retention', and a version compatible with '11.0.0.0' could not be found in the package cache folders: C:\2\_work\PurchaseTaxRetention\PurchaseTaxRetention\CISRCT\.packages

AskeHolst avatar Sep 05 '25 11:09 AskeHolst

Hi @AskeHolst, I have tried to repro the issue following your setup, but it works for me. If you are still experiencing this issue, please send the full logs for the whole PR build, and I can try to investigate further.

spetersenms avatar Nov 11 '25 15:11 spetersenms

Hi @AskeHolst, I have tried to repro the issue following your setup, but it works for me.

I should have specified that this was run on a self-hosted runner created with the getbuildagent arm template. Maybe long path support is different there from standard github runners.

AskeHolst avatar Nov 11 '25 21:11 AskeHolst

Thanks for confirming that @AskeHolst. I was now able to repro the issue, and found it's an issue with Windows, as the default path length is apparently 260 characters. I will work on a permanent fix, but for now you should be able to workaround the issue by adding the setting "githubRunnerShell": "pwsh" (http://aka.ms/algosettings#githubRunnerShell), as PowerShell 7 has better handling of paths compared to 5.

spetersenms avatar Nov 12 '25 10:11 spetersenms

Hi @AskeHolst. After taking the issue up internally, we have decided not to work on a permanent fix for this. The reason is, that building a solution that would work on both Linux and Windows, as well as PowerShell 5 and 7 is too complex for the severity of the issue. Going forward I recommend shortening the branch name, or using PowerShell 7 (pwsh) as that should work with long paths.

spetersenms avatar Nov 18 '25 10:11 spetersenms