ExRam.Gremlinq icon indicating copy to clipboard operation
ExRam.Gremlinq copied to clipboard

Build failed to compile on GitHub Actions after last runner upgrade

Open krukowskid opened this issue 1 year ago • 4 comments

Describe the bug Since May 15/16, after the latest update of the runner hosted by GitHub (ubuntu22.04) the build of my application started to fail with errors related to Gremlinq code. There were no changes in the codebase. Rerun on last sucessful run ends with same errors.

error CS0121: The call is ambiguous between the following methods or properties: 'IVertexGremlinQueryBase<TVertex>.Properties<TValue>(params Expression<Func<TVertex, TValue>>[])' and 'IVertexGremlinQueryBase<TVertex>.Properties<TValue>(params Expression<Func<TVertex, TValue[]>>[])'

code:

    public async Task RemoveEdgeHints<T>(string id, string[] hintNames) where T : IEdgeHints
    {
        await _g.V<T>().Where(x => x.Id == id).Properties(p => p.EdgeHints!).Where(x => hintNames.Contains(x.Value)).Drop();
    }

and:

error CS1061: 'PartnerProfile' does not contain a definition for 'Coalesce' and no accessible extension method 'Coalesce' accepting a first argument of type 'PartnerProfile' could be found (are you missing a using directive or an assembly reference?) 

Tried also on macos runner with same result, but it works on windows-2022.

Version information 11.2.5 with package.lock restore

Minimal working example

    - name: dotnet ♻️ restore 
      run: dotnet restore --locked-mode

    - name: dotnet 📖 publish 
      run: dotnet publish "${{ inputs.dotnetWorkingDirectory }}" --no-restore `
            --configuration ${{ inputs.dotnetConfiguration }} `
            --output "${{ inputs.dotnetWorkingDirectory }}/publish"

Does anyone experience a similar issue? There are no issues during local build both on windows and macos machine.

krukowskid avatar May 22 '24 12:05 krukowskid

It's this issue. It has been fixed in Roslyn sources but still found it's way into SDK 8.0.300. A possible solution is to fix the SDK to 8.0.204 with a global.json. Another temporary solution is presented here. Beyond that, all that remains is to wait for the fix to make it into the tooling.

danielcweber avatar May 22 '24 13:05 danielcweber

I have noticed SDK change between runner versions and tried the below step but it didn't help.

      - uses: actions/setup-dotnet@v4
        with:
          dotnet-version: '8.0.204'

I thought it would be enough, but will still use 8.0.300. I wish I had asked earlier.... The above step + global.json solved my problem.

{
  "sdk": {
    "version": "8.0.204"
  }
}

Thank you!

krukowskid avatar May 22 '24 13:05 krukowskid

Tip: actions/setup-dotnet@v4 can be configured to take its version from global.json.

danielcweber avatar May 22 '24 13:05 danielcweber

Update: Visual Studio 17.11.0 Preview 2.0 and .NET 9.0.100-preview.5 have the compiler fix.

danielcweber avatar Jun 13 '24 11:06 danielcweber

Fixed in Visual Studio 17.11.0 and .NET SDK 8.0.400.

danielcweber avatar Aug 14 '24 11:08 danielcweber