AL icon indicating copy to clipboard operation
AL copied to clipboard

Compiler is using wrong symbols to compile in Multi-Root project

Open gntpet opened this issue 2 years ago • 4 comments

1. Describe the bug I do have two extensions A & B in multi-root project setup.

Extension B, depends on Extension A.

Extension A is using symbols from W1 Extension B is using symbols from Italian localization.

When I compile Extension B, it first compiles dependecy A & then itself. Both projects are getting compiled using symbols from Extension A.

2. To Reproduce Make two simple projects in multi-root configuration. for project A download symbols from w1 version for project B download symbols from italian version

for project B add some code that works in base version only. For e.g. use "Prices Including VAT", which does not exist in Italian version, but exist in w1 version.

pageextension 50364 pageextension50364 extends "Sales Order"
{
    layout
    {
        addafter("Prices Including VAT")
        {
            field("Gen. Bus. Posting Group"; "Gen. Bus. Posting Group")
            {
                ApplicationArea = All;
            }
        }
    }
}

You will see, that extension will compile successfully, but you won't be able to deploy it to Italian version.

3. Expected behavior I would expect that each extension is compiled using the symbols from each folder, and I should see compiler error while compiling extension B, since i'm referencing non-existing control.

4. Actual behavior Extension B is compiled using symbols from project A.

5. Versions:

  • AL Language: v10.0.687650
  • Visual Studio Code: 1.71.2
  • Business Central: 20.5.45456.47314 (italian)
  • List of Visual Studio Code extensions that you have installed: not applicable

gntpet avatar Oct 06 '22 13:10 gntpet

If you have a workspace with project references extension B will resolve symbols defined in A and referenced in B from the project A and not the extension A. App(extension) references are resolved from the individual package cache folders. Composition though will be tricky, if you are using propagateDependencies, since I think then what B delegates will be taken into consideration, Is that your issue?

kalberes avatar Oct 12 '22 17:10 kalberes

When I compile my Italian extension, I expect it to be compiled against symbols stored in Italian extension .alpackage folder, not with a symbols from some other extension.

gntpet avatar Oct 13 '22 05:10 gntpet

But are you using propagateDependencies? Since if not thigs are expected to work like you claim and thus this is a big bug.

kalberes avatar Oct 13 '22 09:10 kalberes

I'm not using propagateDependencies

gntpet avatar Oct 13 '22 15:10 gntpet

We have internally discussed this issue and have decided not to accept this issue to be fixed at the moment to prioritize other issues. Thank you for raising this concern.

Our recommendation is to set a global packages cache using the al.packageCachePath setting (either on user or workspace level)

thloke avatar Nov 01 '22 09:11 thloke