Add 'compile-slice' Script for Slice Compiler Definitions#4723
Add 'compile-slice' Script for Slice Compiler Definitions#4723InsertCreativityHere wants to merge 9 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new repository-local helper script to regenerate the C# sources under src/ZeroC.Slice.Symbols/Compiler from the Slice compiler definition files using the slicec binary downloaded by the build.
Changes:
- Add
build/compile-slice.pyto locateslicec, locate theZeroC.Slice.Generatorcode generator script, and compileslice/Compiler/*.sliceintosrc/ZeroC.Slice.Symbols/Compiler. - Update
build/sync-slice.py’s docstring usage paths to referencebuild/instead oftools/. - Remove a couple of VS Code workspace settings related to Rust Analyzer, and remove unused
_SliceCExeproperties fromIceRpc.Slice.Tools.csproj.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| src/IceRpc.Slice.Tools/IceRpc.Slice.Tools.csproj | Removes no-longer-used properties related to slicec executable naming. |
| build/sync-slice.py | Docstring usage text updates to match the script’s actual location under build/. |
| build/compile-slice.py | New script to regenerate compiler-symbol C# sources by invoking slicec + the C# generator. |
| .vscode/settings.json | Removes Rust Analyzer-related VS Code settings (not mentioned in PR description). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -1,11 +1,5 @@ | |||
| { | |||
| "dotnet.defaultSolution": "IceRpc.sln", | |||
There was a problem hiding this comment.
While looking for where we store slicec, I stumbled across this.
Leftover from the old slicec-cs tool. So these are no longer doing anything for us.
| <_IceRpcOSArch>$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString().ToLower())</_IceRpcOSArch> | ||
| <_SliceCExe Condition="'$(_IceRpcOSName)' == 'windows'">slicec.exe</_SliceCExe> | ||
| <_SliceCExe Condition="'$(_IceRpcOSName)' != 'windows'">slicec</_SliceCExe> | ||
| </PropertyGroup> |
There was a problem hiding this comment.
I couldn't find a single reference to this _SliceCExe property anywhere.
Is there something special I'm missing or is this just properly dead code?
| @@ -4,13 +4,13 @@ | |||
| """Synchronize vendored Slice files (*.ice, *.slice) based on slice.toml. | |||
|
|
|||
| Usage: | |||
There was a problem hiding this comment.
This file was moved from tools to build some time ago.
Also there were some sentences that ended with 2 spaces instead of 1?
If this is intentional I can revert, but it seemed like just a typo to me.
|
Replaced by #4725. I still like my script, but it's easier to do this regeneration with a build task. |
This PR adds a new
build/compile-slice.pyscript which will automatically regenerate the C# code insrc/ZeroC.Slice.Symbols/Compilerbased on the existing compiler definitions, and the version ofslicecdownloaded in the repository.The script should be runnable anywhere from within the repository. It will automatically figure out the pathing.
I also made sure to have it forward any errors, not that there should ever be any.
Normal output:
Output if there were errors: