HodorNV / ALOps

ALOps
59 stars 24 forks source link

Compiler error #576

Closed panas78 closed 1 year ago

panas78 commented 1 year ago

Trying to build a custom Base App. With version 20.3 everything was running fine. After update to 21 the compiler task generates error ,although the project in VSCode compiles without any errors,

attached is the log from the task

log.txt

waldo1001 commented 1 year ago

yaml?

panas78 commented 1 year ago

parameters:

steps:

waldo1001 commented 1 year ago

I need the full yaml - you're compiling in the docker container, so - how do you build that container?

panas78 commented 1 year ago
name: $(Build.BuildId)
trigger:
  branches:
    include:
    - main
resources:
  repositories:
  - repository: templates
    type: git
    name: Pipeline-Templates
variables:
- group: Secrets
- group: VersionGlobal
stages:
- stage: __default
  jobs:
  - job: Job
    pool:
      name: DiastasysPool
    steps:
    - task: 6d15af64-176c-496d-b583-fd2ae21d4df4@1
      inputs:
        repository: self
        clean: true
    - task: 6d15af64-176c-496d-b583-fd2ae21d4df4@1
      inputs:
        repository: git://Navins/SCRIPTS
    - task: DeleteFiles@1
      displayName: "Delete AppSourceCop.json"
      inputs:
        SourceFolder: ''
        Contents: '$(Build.Repository.Name)\AppSourceCop.json'
    - task: ALOpsDockerCreate@1
      displayName: "ALOPS - Create Docker Container"
      inputs:
        artifactversion: $(artifactversion20)
        artifactcountry: "w1"
        versionselect: "Closest"
    - task: ALOpsDockerStart@1
      displayName: "ALOPS - Start Docker Container"
    - task: ALOpsDockerWait@1
      displayName: "ALOPS - Wait for Docker Container to start"
      inputs:
        search_string: "Ready for connections!"
    - task: ALOpsLicenseImport@1
      displayName: "ALOPS - License Import"
      inputs:
        usedocker: true
        license_path: $(licensepath20)
    - task: DownloadPipelineArtifact@2
      enabled: false
      displayName: "Download Previous Version"
      continueOnError: true
      inputs:
        buildType: "specific"
        project: "$(System.TeamProjectId)"
        definition: "$(System.DefinitionId)"
        buildVersionToDownload: "latestFromBranch"
        branchName: "refs/heads/main"
        allowPartiallySucceededBuilds: true
        itemPattern: "**/*.app"
        targetPath: '$(Build.Repository.Name)\.alpackages\Prev'
    - task: ALOpsAppPublish@1
      enabled: false
      displayName: "ALOPS - Publish Previous Version"
      continueOnError: true
      inputs:
        usedocker: true
        nav_artifact_app_filter: "*.app"
        skip_verification: true
        batch_publish_folder: '$(Build.Repository.Name)\.alpackages\Prev'
    - task: ALOpsAppCompiler@1
      displayName: "ALOPS - Compile App"
      inputs:
        usedocker: true
        targetproject: '$(Build.Repository.Name)\app.json'
        nav_app_version: $(versiontemplate20)
        failed_on_warnings: False
    - task: ALOpsAppPublish@1
      displayName: "ALOPS - Publish App"
      inputs:
        usedocker: true
        nav_artifact_app_filter: "*.app"
        skip_verification: true
        forcesync: true
    - task: ALOpsDockerRemove@1
      displayName: "ALOPS - Remove Docker Container"
      enabled: true
      condition: always()
panas78 commented 1 year ago

artifactversion20 = 21.0.46256.46853

panas78 commented 1 year ago

The Pull Request validate pipeline with "on the fly" compiler was successfull :

name: $(Build.BuildId)
trigger:
  branches:
    include:
    - main
resources:
  repositories:
  - repository: templates
    type: git
    name: Pipeline-Templates
variables:
- group: Secrets
- group: VersionGlobal
stages:
- stage: __default
  jobs:
  - job: Job
    pool:
      name: DiastasysPool
    steps:
    - task: 6d15af64-176c-496d-b583-fd2ae21d4df4@1
      inputs:
        repository: self
        clean: true
    - task: 6d15af64-176c-496d-b583-fd2ae21d4df4@1
      inputs:
        repository: git://Navins/SCRIPTS
    - task: DownloadPipelineArtifact@2
      displayName: "Download previous version"
      continueOnError: true
      inputs:
        buildType: "specific"
        project: "$(System.TeamProjectId)"
        definition: "$(System.DefinitionId)"
        buildVersionToDownload: "latestFromBranch"
        branchName: "refs/heads/main"
        allowPartiallySucceededBuilds: true
        itemPattern: "**/*.app"
        targetPath: '$(Build.Repository.Name)\.alpackages\Prev'
    - task: PowerShell@2
      displayName: "Check previous artifact"
      inputs:
        targetType: inline
        script: |
          $Folder = '$(Build.Repository.Name)\.alpackages\Prev\Dynamics 365'
          "Check if [$Folder] exists"
          if (Test-Path -Path $Folder) {
            echo "##vso[task.setvariable variable=prevartifactexists]true"
            "Found Prev. Artifact"
          } else {
            echo "##vso[task.setvariable variable=prevartifactexists]false"
            "Prev. Artifact not exists"
          }
    - task: CopyFiles@2
      displayName: "Copy AppSourceCop rules"
      inputs:
        SourceFolder: '$(Build.Repository.LocalPath)\SCRIPTS'
        Contents: "appsource.default.ruleset.json"
        TargetFolder: '$(Build.Repository.Name)\.codeAnalysis'
        OverWrite: true
        ignoreMakeDirErrors: true
    - task: DeleteFiles@1
      displayName: "Delete AppSourceCop.json"
      condition: eq(variables.prevartifactexists, 'false')
      inputs:
        SourceFolder: $(Build.Repository.Name)
        Contents: "AppSourceCop.json"
    - task: ALOpsAppCompiler@2
      displayName: "ALOPS - Compile Extension: App"
      inputs:
        artifactversion: $(artifactversion20)
        artifactcountry: "W1"
        appversiontemplate: "?.?.?.?"
        updatebuildnumber: false
        appfilenametemplate: "%APP_PUBLISHER%_%APP_NAME%_%APP_VERSION%.app"
        failonwarnings: False
ps610 commented 1 year ago

Similar problem on our side: compiler warnings are now printed as errors, although the parameter "failed_on_warnings" is not set (default = false).

waldo1001 commented 1 year ago

Similar problem on our side: compiler warnings are now printed as errors, although the parameter "failed_on_warnings" is not set (default = false).

It might seem similar, but it's different: can you please create a new ticket, with full yaml and output?

waldo1001 commented 1 year ago

@panas78 , we can't say why this is failing in the container. It's a code customized baseapp, so it doesn't comply with A LOT of things. Hard to say why the dlls are ignored in the container - it's not something we manage.

What I would suggest, is to use the compilerv2, and use that generated app to publish in the container. Do you think that would be an option?

panas78 commented 1 year ago

@waldo1001 . The customized Baseapp is mostly a baseapp as it comes from MS and our addittions are mainly the requested events that MS did not yet delivered. The objects with the error are pure MS code nothing custom from our side. You can easily reproduce the error by trying to compile a base app source code in the pipeline using these preprocessor symbols in app.json. "preprocessorSymbols": ["CLEAN17","CLEAN18","CLEAN19","CLEAN20","CLEAN21" ] Version 21.0.46256.46853

i am pretty sure it's just a mixup with dll's inside the container if you cant figure out the issue i will be forced to use your approach in using the v2 compiler but this is something i would like not to do.

panas78 commented 1 year ago

Any news on this ?

waldo1001 commented 1 year ago

It's either an issue with the container, or an issue with the compiler in the container. ALOps "just" uses these tools - we don't do anything fance to make "code customized baseapps" work..

Idea: why not using the "on-the-fly-compiler" and use those artifacts to install the app within the container? Then you avoid having to use the container-bits..

panas78 commented 1 year ago

Ok i will try using the v2 compiler But for the record , we do not have any fancy code customized baseapp... it's just a baseapp with the requested events asked from MS...

waldo1001 commented 1 year ago

I'm not saying it's your fault, i meant it's MS's fault that we can't fix.. . If they - for some reason - do not set up the container to be able to compiler a complete BaseApp, then our hands are tide .. .

That's also why we invested quite some time in the v2 Compiler - to be able to be much more flexible .. (and faster)