Open lGSMl opened 3 years ago
I also encountered this issue attempting to package a project with Nix. Nix support for F# packages does not work because of it.
We also experience the same issue when publishing Android target @vzarytovskii is SDK team or F# team area?
Our command is:
dotnet publish --no-build /p:Configuration=Release /p:TargetFramework=net8.0-android /p:PublishDir=$(Build.ArtifactStagingDirectory)\Android
We also experience the same issue when publishing Android target @vzarytovskii is SDK team or F# team area?
Not entirely sure. @baronfel is SDK doing something special here?
We'd need a binlog for erroring cases to tell in any case so we can do a proper investigation.
We're not doing anything special, but no build is a bit of a corner case so there may be gaps in the implementation or there may be requirements imposed by the android or F# targets that make an implicit build happen for some reason.
@baronfel, here are binlogs for build and publish tasks: Android build and publish logs.zip
If needed, the build command is the following (the problem is with the publish one that I wrote above):
- task: PowerShell@2
displayName: "Build Android platform"
inputs:
targetType: 'inline'
script: |
$msbuild = vswhere -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe
$collectionOfArgs = @("$(ConsoleApp)", "/p:TargetFramework=net8.0-android", "/p:Configuration=$(BuildConfiguration)", "/bl:$(Build.ArtifactStagingDirectory)\Android.build.binlog")
& $msbuild $collectionOfArgs
continueOnError: true
The error in question is triggered from this code:
<!-- TODO: this target should not check GeneratePackageOnBuild.
remove when https://github.com/NuGet/Home/issues/7801 is fixed.
-->
<Target Name="_CheckForBuildWithNoBuild"
Condition="'$(NoBuild)' == 'true' and '$(GeneratePackageOnBuild)' != 'true'">
<NETSdkError ResourceName="NoBuildRequested" />
</Target>
@nkolev92 it looks like https://github.com/NuGet/Home/issues/7801 has been fixed for quite a while, can we remove the GeneratePackageOnBuild
check from this target now safely?
Yeah, seems like it. I haven't manually verified any potential side effects but that should be something easily doable.
While trying to run
dotnet pack --no-build
on F# project with project reference - dotnet tries to build referenced project and errors on "NoBuild option in build target" check.Reproduction:
Env: Docker image
mcr.microsoft.com/dotnet/sdk:5.0
Steps:
Expected:
Successfully created package
Actual:Sample output on steps above:
Reproducible on Windows 10 as well. Not reproducible with C# projects.