question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UpToDateCheck does not work with CLI tools

See original GitHub issue

Visual Studio Version: 16.3.5

Summary: I found an article where they show how to use this new setting. The problem is that this setting restart build but only partially. This way build artifacts differs from when I use full rebuild.

Steps to Reproduce:

  1. git clone -b UpToDateCheckBug --single-branch https://github.com/Pzixel/Solidity.Roslyn.git
  2. cd Solidity.Roslyn
  3. dotnet run --project Solidity.SampleApp/Solidity.SampleApp.csproj
  4. touch Solidity.Roslyn.Example/Sample.sol
  5. dotnet run --project Solidity.SampleApp/Solidity.SampleApp.csproj

Expected Behavior: Buld timestamp will be different since rebuild caused CLI tool to regenerate BuildInfo class.

Actual Behavior: File don’t get regenerated and we get the old time stamp.

User Impact: Users are forced to rebuild the whole solution all the time because they can’t be sure if their code change should cause regeneration.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
rainersigwaldcommented, Nov 21, 2019

Firstly, I think you need to add your .sol file as both UpToDateCheckInput (for the VS fast up-to-date check) and as CustomAdditionalCompileInputs for the MSBuild up-to-date check. There was a time when VS considered CustomAdditionalCompileInputs too, but IIRC @rainersigwald Rainer Sigwald FTE advised against this. Rainer does it seem right that people should have to specify custom inputs in multiple item groups?

I think this was answered by further discussion, but: No, I don’t think this makes sense, but I don’t think it should be required. In the everything-is-behaving-correctly case:

  • The true inputs are known for the VS fast up-to-date check (via UpToDateCheckInput).
  • The code generator has correct incremental behavior and adds a generated source file to the normal compile inputs
  • The compiler then runs when the .sol file changed, because that resulted in an updated .g.cs file. But the compiler’s inputs don’t need to care about the .sol.

CodeGeneration.Roslyn is not updating the .generated.cs file in your repo because its internal incrementality check

https://github.com/AArnott/CodeGeneration.Roslyn/blob/246ca6a3a01b24f2793293f03ed80e99a7ba0ed1/src/CodeGeneration.Roslyn.Engine/CompilationGenerator.cs#L135-L138

considers only the input syntax tree (in this case Solidity.cs), not any additional inputs your particular generator may read from. I think that’s reasonably tracked by AArnott/CodeGeneration.Roslyn#127.

1reaction
drewnoakescommented, Nov 22, 2019

@rainersigwald thanks for your insight and for joining the dots to that existing issue. I missed that.

@Pzixel no bother at all. This was interesting and I learned a few things along the way. Good luck getting this resolved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio add pre-build event that always runs (C# ...
In my project, I am running an external tool to update some binary files. These files are included in the project as "content"....
Read more >
Troubleshoot and create logs for MSBuild problems
Create a detailed log · From the Visual Studio main menu, go to Tools > Options > Projects and Solutions >Build and Run....
Read more >
CLI tool to fix command line errors with ChatGPT
I feel making ChatGPT to be the initial debugger to guide whats the error means and what should I look for to fix...
Read more >
Fortnite Failed To Build Manifest For Host
Matchmaking does not work from this point and will give an error stating “Network ... Here's how to Fix Failed to build manifest...
Read more >
Simulink Performance Advisor Checks - MATLAB & ...
When choosing Rapid Accelerator with up-to-date check off, Performance Advisor does not perform an up-to-date check during simulation. You can run the Rapid ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found