1

I am working on a CI pipeline for my flutter desktop app, currently it's Windows only but this will soon change to be Windows/Linux. I was planning to use the GitLab shared runners with the cirrusci/flutter docker image to automate this.

Unfortunately, when running the command I am greeted with this log: "build windows" only supported on Windows hosts.

Which makes total sense, since flutter builds native apps and likely requires the SDKs.

I was wondering if anyone is familiar with how to set up a pipeline for Windows desktop applications to be built. I can switch GitLab to use a Windows shared runner, but this doesn't have a flutter install.

Just wondering what the path of least resistance is here.. I've reached the end of my surface-level understanding of these systems (Docker + GitLab CI)

Thank you, David

1 Answer 1

1

I'm trying to do the same. I took this project as an example https://gitlab.com/famedly/fluffychat/-/blob/main/.gitlab-ci.yml

I ended up with a job looking like this (in the .gitlab-ci.yml):

build_test_app_win_job:
  stage: build
  tags: 
    - shared-windows
    - windows
    - windows-1809
  before_script:
    # Install flutter (using Chocolatey and confirming all prompts)
    - choco install flutter --confirm --no-progress
    - Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
    - refreshenv
    # Disable Google Analytics report for Flutter
    - flutter config --no-analytics
  script:
    - cd test_app/
    - flutter pub get
    - flutter build windows -v >> debugCiLog.txt

However I'm stuck with a weird error during build (despite all being ok on my local computer):

[ +321 ms] C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(231,5): error MSB6006: "cmd.exe" exited with code 1. [C:\GitLab-Runner\builds\TestProject\test_app\build\windows\flutter\flutter_assemble.vcxproj]

With verbose on:

[  +74 ms]   [   +8 ms] Error parsing assemble command: your generated configuration may be out of date. Try re-running 'flutter build ios' or the appropriate build command.
[   +8 ms]   [   +3 ms] 
[        ]              #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
[        ]              #1      AssembleCommand.runCommand (package:flutter_tools/src/commands/assemble.dart:295:7)
[        ]              #2      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1374:12)
[        ]              <asynchronous suspension>
[        ]              #3      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1209:27)
[        ]              <asynchronous suspension>
[        ]              #4      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[        ]              <asynchronous suspension>
[        ]              #5      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
[        ]              <asynchronous suspension>
[        ]              #6      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)
[        ]              <asynchronous suspension>
[        ]              #7      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[        ]              <asynchronous suspension>
[        ]              #8      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
[        ]              <asynchronous suspension>
[        ]              #9      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
[        ]              <asynchronous suspension>
[        ]              #10     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[        ]              <asynchronous suspension>
[        ]              #11     main (package:flutter_tools/executable.dart:91:3)
[        ]              <asynchronous suspension>
[   +2 ms]   [  +67 ms] "flutter assemble" took 621ms.
[        ]   [   +5 ms] ensureAnalyticsSent: 2ms
[        ]   [   +1 ms] Running shutdown hooks
[        ]   [        ] Shutdown hooks complete
[        ]   [   +6 ms] exiting with code 1

The following error is probably wrong, I can not find something relevant on google (I have no space or special character in the path):

Error parsing assemble command: your generated configuration may be out of date. Try re-running 'flutter build ios' or the appropriate build command.

Maybe this can help you despite I fail on my setup. I would be interested if you have more success than me 😉

Also, I try flutter doctor and all seems ok:

  • Visual Studio - develop for Windows (Visual Studio Build Tools 2019 16.6.4)
  • Flutter (Channel stable, 3.3.10, on Microsoft Windows [Version 10.0.17763.1339], locale en-US)
Sign up to request clarification or add additional context in comments.

3 Comments

I get stuck at command not found: choco... How did you go beyond that ?
As specify here Windows shared runners come with Chocolatey v0.10.15 pre-installed. Thus the command ´choco´ should be available. Have you set the job tags correctly?
I used my organization's private Gitlab which has no windows runner that's why...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.