Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue: Upgrade to language-ext 4.2.8 (codegen) ended in error while build #1071

Open
LaszloLueck opened this issue Jun 27, 2022 · 14 comments
Open

Comments

@LaszloLueck
Copy link

After updating to laguage-ext 4.2.8 i cannot build any project anymore.
Error is
CGR1001 CodeGeneration.Roslyn.BuildTime.targets(73, 5): [CGR1001] CodeGeneration.Roslyn.Tool (dotnet-codegen) is not available, code generation won't run. Please check https://github.com/AArnott/CodeGeneration.Roslyn for usage instructions.

I will figure out if it is a specific (sub) library of language-ext

@LaszloLueck LaszloLueck changed the title Upgrade to language-ext 4.2.8 ended in error while build Issue: Upgrade to language-ext 4.2.8 ended in error while build Jun 27, 2022
@LaszloLueck
Copy link
Author

Here it is a more specific information:
Currently the build fails after updating
LangguageExt.CodeGen to version 4.2.8
After downgrade to 4.2.7 all works fine

@LaszloLueck LaszloLueck changed the title Issue: Upgrade to language-ext 4.2.8 ended in error while build Issue: Upgrade to language-ext 4.2.8 (codegen) ended in error while build Jun 27, 2022
@louthy
Copy link
Owner

louthy commented Jun 27, 2022

I’ll check (I have to run a manual step to the codegen package, which I’m sure I ran, but it must have broken somehow).

@louthy
Copy link
Owner

louthy commented Jun 27, 2022

I've checked the package, and it all looks good. Have you done anything differently with this upgrade? Also, make sure these dependencies are on the correct version:

@LaszloLueck
Copy link
Author

Hi,
thats crazy.
Before,
CodeGeneration.Roslyn was implicitly installed as version 0.7.63
CodeGeneration.Roslyn.BuildTime was implicitly installed as version 0.6.1

I´ve downgraded CodeGeneration.Roslyn as you suggested to version 0.6.1 but without luck.
Any version combination fails with LanguageExt.CodeGen version 4.2.8

I´ve tested that issue with an new, empty dotnet (6) core console app.
Insert the following imports:
image

And the build failed.
If i downgrade LanguageExt.CodeGen to version 4.2.7 --> the build failed.
If i remove the explicit added
CodeGeneration.Roslyn
CodeGeneration.Roslyn.BuiltTime
than the build succeeded.
If i changed the implicit imports to the following versions, the build would also be succeeded:
image

But, as i update LanguageExt.CodeGen to >4.2.7 the build would failed!

Regards,
Laszlo

@louthy
Copy link
Owner

louthy commented Jun 27, 2022

Have you recently moved to a new machine? The code-gen library needs the .NET 2.1 SDK to run.

@LaszloLueck
Copy link
Author

LaszloLueck commented Jun 28, 2022

No,
i´ve not moved or removed to or from a machine.
You wrote:

The code-gen library [needs the .NET 2.1 SDK] https://github.com/AArnott/CodeGeneration.Roslyn#prerequisites) to run.

That´s confusing, because the version 4.2.7 does not need the .NET 2.1 SDK (because it is working on my machine)?

Here are some informations about my setup.
Ah, and yes, it is on aarm

dotnet --info
.NET SDK (gemäß "global.json"):
 Version:   6.0.301
 Commit:    43f9b18481

Laufzeitumgebung:
 OS Name:     Mac OS X
 OS Version:  12.4
 OS Platform: Darwin
 RID:         osx.12-arm64
 Base Path:   /usr/local/share/dotnet/sdk/6.0.301/

Host (useful for support):
  Version: 6.0.6
  Commit:  7cca709db2

.NET SDKs installed:
  6.0.201 [/usr/local/share/dotnet/sdk]
  6.0.202 [/usr/local/share/dotnet/sdk]
  6.0.203 [/usr/local/share/dotnet/sdk]
  6.0.300 [/usr/local/share/dotnet/sdk]
  6.0.301 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download

@LaszloLueck
Copy link
Author

No matter what environment (linux, windows, macos, x64, aarm, arm64) I use, the problem is always the same.
I´ve created a completely new dotnet core 6 project, use languageext.codegen (4.2.8 or 4.2.9) from nuget and the build fails.
If i use languageext.codegen <4.2.8 the build works fine.

@louthy
Copy link
Owner

louthy commented Jun 29, 2022

Hmm, does seem odd. Nothing has changed in the CodeGen project. If using an old version works, it'd be best to stick with that for now.

I've frozen development on the CodeGen project, the new Source-Generators based project will eventually take it over and I'll maintain CodeGen in a frozen state for those that can't move over. The only reason the version number keeps going up is because it's part of my standard deployment tooling - it has no dependencies on the other libs, so staying on an old working version won't cause any problems at all.

I will try and find some time over the next few days to take a look though, it does seem a bit strange that it'd just stop working now.

@LaszloLueck
Copy link
Author

Fine for me. 4.2.7 works perfect for me.
Maybe someone else has the same problem, then it is already addressed here.
Thanks and regards,
Laszlo

@jvmlet
Copy link

jvmlet commented Jan 24, 2023

I've frozen development on the CodeGen project, the new Source-Generators based project will eventually take it over

@louthy , what is the up-to-date guidelines to integrate the source generations ?

@DannyMeister
Copy link

Thank goodness I ran into this thread which caused me to try downgrading to 4.2.7. That finally let me use codegen in a .NET 7 project. I had already tried DOTNET_ROLL_FORWARD=LatestMajor and --roll-forward LatestMajor to no avail (and verified with ProcMon that my msbuild file shenanigans had indeed been properly passed along to the dotnet codegen process). Requiring an older sdk version won't be an option for certain tightly controlled build environments.

@YkTru
Copy link

YkTru commented Jul 27, 2023

This way, I can get "[Union]" in the intellisense, and run the app:

    <PackageReference Include="LanguageExt.CodeGen" Version="4.4.3" />
    <PackageReference Include="LanguageExt.Core" Version="4.4.3" />
    <PackageReference Include="CodeGeneration.Roslyn.Tool" Version="0.7.63">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
    </PackageReference>
Though, I have this warning:
Severity	Code	Description	Project	File	Line	Suppression State
Warning	CGR1002	Using GeneratorAssemblySearchPaths is deprecated, please use CodeGenerationRoslynPlugin ItemGroup. See https://github.com/AArnott/CodeGeneration.Roslyn for more info. 
Suppress this warning by adding CGR1002 to MSBuildWarningsAsMessages PropertyGroup.	
MIF1.Modules	C:\Users\YT\.nuget\packages\codegeneration.roslyn.tool\0.7.63\build\CodeGeneration.Roslyn.Tool.targets	40

I honnestly don't know if I would need this: <Sdk Name="CodeGeneration.Roslyn.Plugin.Sdk" Version="0.7.63" />

Anyone? @louthy Am I missing something? This doesn't work at all:
`

<PackageReference Include="LanguageExt.CodeGen" Version="3.4.10"
                  PrivateAssets="all" />

<PackageReference Include="CodeGeneration.Roslyn.BuildTime"
                  Version="0.6.1"
                  PrivateAssets="all" />

<DotNetCliToolReference Include="dotnet-codegen" Version="0.6.1" />

`

Thanks!

@louthy
Copy link
Owner

louthy commented Jul 27, 2023

You need 0.6.1, the later CodeGeneration versions were broken.

@reza-repo
Copy link

I am also getting this: CodeGeneration.Roslyn.BuildTime.targets(73, 5): [CGR1001] CodeGeneration.Roslyn.Tool (dotnet-codegen) is not available, code generation won't run. Please check https://github.com/AArnott/CodeGeneration.Roslyn for usage instructions.

I tried setting DOTNET_ROLL_FORWARD=LatestMajor and it did not help.

I also tried downgrading to 4.2.7 as suggested above (#1071 (comment)) and it did not work either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants