postsharp / Metalama

Metalama is a Roslyn-based meta-programming framework. Use this repo to report bugs or ask questions.
175 stars 5 forks source link

Possible license issue with Metalama Free Edition (LAMA0806) #327

Open craigbehnke opened 2 months ago

craigbehnke commented 2 months ago

I just encountered an issue with Metalama Free v2024.1.23 where the builds on my machine kept failing with the warning message warning LAMA0806: The Metalama Ultimate Evaluation License has expired. This happened even after running dotnet tool run metalama license free.

Ultimately I traced it to a file in my ~/.metalama folder that was named designTime.json. After deleting this file, my local builds started passing again. (edit: sometimes)

The contents of the file prior to deletion were:

{
  "hideUnlicensedCodeActions": false
}

I've been able to fix this, but it still may be an issue for other people using Metalama so I'm letting you guys know.

Thank you!

EDIT: Since writing this issue, the problem has returned. Running the dotnet tool command no longer seems to make it work, but the tool itself is showing the correct license information:

% dotnet tool run metalama license list
The following license is currently registered:

┌────────────────────┬────────────────────────────────┐
│ Field              │ Value                          │
├────────────────────┼────────────────────────────────┤
│ Description        │ Metalama Free Personal License │
│ License Expiration │ Never (perpetual license)      │
└────────────────────┴────────────────────────────────┘

I also switched to another branch that was using v2024.1.18, cleaned the repo folder, and then tried to run a build. It worked without any issues.

My new fix is to use 2024.1.18 for now and not update to 2024.1.23.

Bizarrely, though, my build pipeline worked on 2024.1.23 with no issues.

TL;DR: Something strange is happening with the free license between 2024.1.18 and 2024.1.23.

prochan2 commented 2 months ago

Thank you for pointing this out. I'd like to ask you for some details:

Could you please share the logs with us? To capture the logs, close the IDE and call metalama kill, then enable logging and trace for all processes as described at https://doc.postsharp.net/metalama/conceptual/configuration/creating-logs, and then reproduce the issue.

craigbehnke commented 2 months ago

Which OS family and version are you running on?

I'm using macOS 14.5

Which IDE and version do you build with?

VS for Mac and VS Code, but most of my tests outlined above were using the terminal itself. My dotnet version is 8.0.204

Does the same happen both from the IDE and the command line (dotnet build)?

I experienced the issue while using VS for Mac, running the build using the VSCode task runner (that might not be the correct name for it, but it's defined in ./.vscode/tasks.json), and dotnet build in the terminal.

Could you please share the logs with us?

I'd love to, but when I follow the directions you linked and enable everything under logging, nothing is written to $TMPDIR/Metalama/Logs within folders for either version number (I deleted the existing folders and then recreated them to ensure I got the logs for this run and not an earlier run). However, when I downgrade to 2024.1.18 again, the logs for that build appear as expected. Do you have any suggestions on what could be happening there?

prochan2 commented 2 months ago

Thank you for the details. To make the logging work, you may try to change Metalama's temporary directory by setting an arbitrary path using the METALAMA_TEMP environment variable.

If that doesn't help, you can set up logging using the METALAMA_DIAGNOSTICS environment variable by setting the content of the diagnostics.json file as a value of the environment variable. The quotes in the content need to be escaped (\"). Make sure that the value is correct by calling echo $METALAMA_DIAGNOSTICS.

Please note that the Metalama Compiler may run in a different process, so you may need to set these variables on the user level - setting them in the console may be insufficient.

gfraiteur commented 1 month ago

@craigbehnke What's the status of this issue on your side? We have improved logging in the meantime; you might also try this approach.

Zu-Hy commented 1 day ago

Hello, This message reminds you that your request is pending and awaits your feedback. If we do not hear back from you, we will close this ticket. We look forward to your response.