icerpc / icerpc-csharp

A C# RPC framework built for QUIC, with bidirectional streaming, first-class async/await, and Protobuf support.
https://docs.icerpc.dev
Apache License 2.0
102 stars 13 forks source link

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

Closed bernardnormier closed 6 days ago

bernardnormier commented 1 month ago

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

InsertCreativityHere commented 1 month ago

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 commented 1 month ago

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.

pepone commented 1 month ago

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 commented 1 month ago

I think we have to restructure things to:

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