icerpc-csharp icon indicating copy to clipboard operation
icerpc-csharp copied to clipboard

Using local slicec-cs to build tools/IceRpc/BuildTelemetry

Open bernardnormier opened this issue 1 year ago • 4 comments

It appears the build system is currently using some other slicec-cs, not the one you've just built from sources.

bernardnormier avatar Jul 30 '24 15:07 bernardnormier

Yes, the IceRpc.BuildTelemetry.Reporter.csproj seems to be pulling the IceRpc.Slice.Tools NuGet package:

<PackageReference Include="IceRpc.Slice.Tools" Version="0.3.*" PrivateAssets="All" />

instead of using the locally built one:

<Import Project="../../tools/IceRpc.Slice.Tools/IceRpc.Slice.Tools.targets" />

InsertCreativityHere avatar Jul 30 '24 15:07 InsertCreativityHere

Unfortunately, it's not as simple as updating these lines... IceRpc.Slice.Tools requires the IceRpc.BuildTelemetry.Reporter package (so it can report telemetry for compiled Slice)... So IceRpc.BuildTelemetry.Reporter can't depend on IceRpc.Slice.Tools (since that would be circular then).

The next easiest solution I see is to copy the core pieces of IceRpc.Slice.Tools into the Reporter, so it can run slicec-cs on it's own, with no dependency on IceRpc.Slice.Tools at all.

Do we even want to collect build telemetry for people building the telemetry task itself? I'm not sure we care about that.

InsertCreativityHere avatar Jul 30 '24 18:07 InsertCreativityHere

There is a circular dependency at the package level.

IceRpc.BuildTelemetry.Reporter needs to include the IceRpc assemblies and we need IceRpc.Slice.Tools to build them. But we also want to distribute IceRpc.BuildTelemetry.Reporter as part of the IceRpc.Slice.Tools package.

pepone avatar Jul 30 '24 18:07 pepone

I think we have to restructure things to:

  • Build IceRpc.Slice.Tools -> IceRpc -> IceRpc.BuildTelemetry.Reporter

IceRpc.Slice.Tools should have no dependencies on the build telemetry

  • For packaging, repackage IceRpc.Slice.Tools to include the telemetry reporter.

pepone avatar Jul 30 '24 18:07 pepone