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

Skipping target "BicepCompile" because all output files are up-to-date with respect to the input files #10686

Closed
abatishchev opened this issue May 13, 2023 · 8 comments
Assignees
Labels
Needs: Attention 👋 Needs: Author Feedback Awaiting feedback from the author of the issue Needs: Triage 🔍

Comments

@abatishchev
Copy link

Bicep version

Bicep CLI version 0.17.1 (d423d61)

Describe the bug

Following the doc for NoTargets. I've created a simple project:

<Project Sdk="Microsoft.Build.NoTargets">

  <PropertyGroup>
    <TargetFramework>net7.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Azure.Bicep.CommandLine.win-x64" Version="0.13.1" />
    <PackageReference Include="Azure.Bicep.MSBuild" Version="0.17.1" />
  </ItemGroup>

  <ItemGroup>
    <Bicep Include="..\Application\ServiceGroupRoot\Template\main.bicep" OutputFile="..\Application\ServiceGroupRoot\Template\ResourceProvider.json" />
  </ItemGroup>

</Project>

However nothing happens when I press F5 in VS. When I run the following command in console:

msbuild /t:build .\src\Bicep\Bicep.proj

I'm seeing the following outputs:

MSBuild version 17.5.1+f6fdcf537 for .NET Framework
Build started 05/12/2023 23:21:43.
Included response file: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\MSBuild.rsp

Project "src\Bicep\Bicep.proj" on node 1 (build target(s)).
BicepCompile:
Skipping target "BicepCompile" because all output files are up-to-date with respect to the input files.
Done Building Project "src\Bicep\Bicep.proj" (build target(s)).

Why it's getting skipped?

@ghost ghost added the Needs: Triage 🔍 label May 13, 2023
@stephaniezyen
Copy link
Contributor

Does the output file exist? If it is newer than the input file, it can be skipped by Visual Studio.

@majastrz
Copy link
Member

@abatishchev, in addition to the above, can you increase the verbosity of up-to-date checks under Tools | Options and send us the logs from the Output window when this happens?

image

@abatishchev
Copy link
Author

> Build started...
1>FastUpToDate: The 'DisableFastUpToDateCheck' property is 'true', not up-to-date. (Bicep)
1>FastUpToDate: Up-to-date check completed in 0.2 ms (Bicep)
1>------ Build started: Project: Bicep, Configuration: Debug Any CPU ------
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Build started at 11:36 AM and took 00.597 seconds ==========

> Build started at 11:36 and took 0.417 seconds

@abatishchev
Copy link
Author

First, I though, could this be the culprit?

image

But unchecking did nothing.

@abatishchev
Copy link
Author

Flipping <DisableFastUpToDateCheck> to either true or false also did nothing.

@majastrz
Copy link
Member

majastrz commented Jun 6, 2023

It seems that both the input and output files are outside of your project judging by their relative paths. I'm not seeing a behavior like you're observing when the input files are under the project directory and when using standard output directory.

<Project Sdk="Microsoft.Build.NoTargets">

  <PropertyGroup>
    <TargetFramework>net7.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Azure.Bicep.CommandLine.win-x64" Version="0.17.1" />
    <PackageReference Include="Azure.Bicep.MSBuild" Version="0.17.1" />
    <PackageReference Include="Microsoft.VisualStudio.SlnGen" Version="10.0.0">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
    </PackageReference>
  </ItemGroup>

  <ItemGroup>
    <Bicep Include="main.bicep" />
  </ItemGroup>

</Project>

@majastrz
Copy link
Member

majastrz commented Jun 6, 2023

@abatishchev Does that change the behavior that you're seeing?

@abatishchev
Copy link
Author

@majastrz it totally does, thanks!! Here's what I've got:

<Project Sdk="Microsoft.Build.NoTargets">

  <PropertyGroup>
    <TargetFramework>net7.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Azure.Bicep.CommandLine.win-x64" Version="0.17.1" />
    <PackageReference Include="Azure.Bicep.MSBuild" Version="0.17.1" />
  </ItemGroup>
  
  <ItemGroup>
    <Bicep Include="main.bicep" OutputFile="..\Application\ServiceGroupRoot\Template\ResourceProvider.json" />
  </ItemGroup>
  
</Project>

@ghost ghost locked as resolved and limited conversation to collaborators Jul 6, 2023
@StephenWeatherford StephenWeatherford added Needs: Author Feedback Awaiting feedback from the author of the issue and removed awaiting response labels Oct 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs: Attention 👋 Needs: Author Feedback Awaiting feedback from the author of the issue Needs: Triage 🔍
Projects
Archived in project
Development

No branches or pull requests

4 participants