AL
AL copied to clipboard
Default output dir of alc.exe changed and new parameter outputFolder does not work
First of all: great job on the new compiler! On our project with 3000+ Objects it improved build time from 24s to 20s which is an amazing improvement, I mean it! 👌
Also the option to specify the outputFolder is great. Specifying the file explicitly was not ideal, since the generated filename is great and one would have to reconstruct the filename if using a custom output.
1. Describe the bug The output directory when calling alc.exe directly has changed without notice. The default location was inside the /project-dir. The new default is the current working directory.
This change broke our pipelines. I already fixed it by specifying /outputFolder (thanks again for adding that!). But it should be fixed so others don't experience the same issue. Alternatively at least add the fullname of the created .app to compiler output, so we don't have to look for it.
2. To Reproduce Steps to reproduce the behavior:
- Compile an extension with specifying the project directory
- Look for the app in the project directory
."C:\buildtools\compiler11.x\alc.exe" /project:"$AgentDir\s\app" /packagecachepath:"$AgentDir\root" /assemblyprobingpaths:"c:\bcartifacts.cache\onprem\22.5.59966.60134\platform\ServiceTier","c:\bcartifacts.cache\onprem\22.5.59966.60134\platform\Prerequisite Components","$AgentDir\s\app\.netpackages","C:\Windows\Microsoft.NET\assembly" /parallel+
# outputs file to project dir, in our case "$AgentDir\s\app"
."C:\buildtools\compiler12.x\alc.exe" /project:"$AgentDir\s\app" /packagecachepath:"$AgentDir\root" /assemblyprobingpaths:"c:\bcartifacts.cache\onprem\22.5.59966.60134\platform\ServiceTier","c:\bcartifacts.cache\onprem\22.5.59966.60134\platform\Prerequisite Components","$AgentDir\s\app\.netpackages","C:\Windows\Microsoft.NET\assembly" /parallel+
# outputs file to current working dir, in our case "$AgentDir\s"
# old help:
/out:<file> Specify the output package file name (default: the name is generated from the project manifest as <Publisher>_<Name>_<Version>.app)
# new help:
/out:<file> Specify the output package file name (default: the name is generated from the project manifest as <Publisher>_<Name>_<Version>.app). Cannot be specified with outputFolder.
/outputFolder:<folder> Specify the folder where the output package file will be written to (default: the working directory). Cannot be specified with out.
3. Expected behavior App gets output to the directory specified in /project by default.
4. Actual behavior App gets output to working dir by default
5. Versions: alc.exe:
- old; everything < 12.0 in the example I used 11.7.13.11986
- new behavior 12.0.13.24028
6. Update
I only thought I had fixed it (by manually setting outputFolder
to the same value as project
so all following processes could stay untouched), turns out it didn't work, now I receive this error:
."C:\buildtools\compiler12.x\alc.exe" /project:"$AgentDir\s\app" /packagecachepath:"$AgentDir\root" /assemblyprobingpaths:"c:\bcartifacts.cache\onprem\22.5.59966.60134\platform\ServiceTier","c:\bcartifacts.cache\onprem\22.5.59966.60134\platform\Prerequisite Components","$AgentDir\s\app\.netpackages","C:\Windows\Microsoft.NET\assembly" /parallel+ /outputFolder:"$AgentDir\s\app"
Microsoft (R) AL Compiler version 12.0.13.24028
Copyright (C) Microsoft Corporation. All rights reserved
error AL1009: Unrecognized option: '/outputFolder:C:\[..]'
# [..] as placeholder for project directory, works correctly on project parameter
# redacted as it contains fqdn of the host aka private information
I even tried switching runtime to 12.0, platform to 23.0 and application to 23.0 just in case the parameter would only be supported in the newest runtime. So it seems that the compiler does not yet recognize this option? Now it's definitely a bug and no longer a just a suggestion :/
The call of alc.exe is encapsulated in a Powershell cmdlet. As a workaround I now edited the begin and end blocks, but imho this is ugly and I don't like having my scripts depend on the location. Especially setting the location in a cmdlet is not a good practice imho.
begin {
#...
$InitialLocation = Get-Location
Set-Location = $OutDirectory # name of the parameter is a bit different to alc-parameter in order to adhere to our usual conventions
#...
}
process {...}
end {
#...
Set-Location $InitialLocation
#...
}
It seems that while the alc.exe help text specifies the parameter as outputFolder, the actual parameter the program expects is "outFolder". Just ran into this myself today. Hopefully the help text can be corrected, rather than changing the current expected parameter name in the code, since that will break any existing programs and scripts utilizing it.
If that's the case, i fully agree 👍 No use in changing the behavior when the theoretically correct call never actually worked 😆