Add NUKE build aligned with pipenv build products - #3129
Conversation
|
Unable to trigger custom agent "Code Reviewer". You have run out of credits 😔 |
|
Important note: |
|
Hi @OnePowerUser88 , thanks for the contribution. The goal of using nuke is to completely remove the pipenv environment, also in the CI/CD. There are other commands in the Do you think you can address these as well, or do you believe it should be done on a separate PR? Also, can you please omit the not strictly needed files? This move to nuke should't change the DLLs. |
|
Will look into it! Just to make sure: |
- build/: Build.cs, README, csproj, nuget.config - build.ps1: bootstrap for .NET NUKE runner - .gitignore: .nuke/, build/bin/ No DLL or source changes. Remaining pyrevit.py commands to be ported in follow-up for full pipenv removal. Co-authored-by: Cursor <cursoragent@cursor.com>
167995c to
1226691
Compare
I'm not able to find a solution to build without editing mongo.go and ScriptConsole.cs without it failing. Anyone have any input? |
What is the error |
…dTelem in full build, README
Summary of source file changes (this branch)This comment describes the source code changes introduced alongside the NUKE build. These are product improvements and bug fixes that apply whether you use pipenv or NUKE. Verified in Revit 2024 and 2026 after build. 1.
|
| File | What changed | Why |
|---|---|---|
| ScriptConsole.cs | Theme loaded via TryAddThemeResource (canonical + lowercase fallback); theme added before Controls.xaml |
Fix “Cannot locate resource 'styles/themes/light.blue.xaml'” in Revit 2024/2026 |
| mongo.go | v2 driver imports; mongo.Connect(opts); mongoDatabaseFromURI instead of connstring; error handling and defers |
Telemetry server Go build was broken; v2 API and no deprecated connstring |
| go.mod / go.sum | go.sum updated via go mod tidy |
Reproducible build with v2 driver |
| Build.cs | BuildProducts depends on BuildTelem again | Full build produces telemetry exe like pipenv |
| build/README.md | “Source code used by this build” section | Clarify that changes are product improvements, not Nuke workarounds |
…ng config guards, remove nuget.config Made-with: Cursor
|
I’ve pushed a follow‑up commit to address the review feedback and harden a couple of edge cases: Mongo telemetry (
|
Let me rephrase: ScriptConsole.cs, the telemetry server files and tabs.py should not be edited by this PR! this only should add the build script using nuke, nothing more, nothing less. |
|
Thank you for the pushback @sanzoghenzo :) pipenv doesn't check the go build exit code. utils.system() returns (stdout, returncode) but the return value is ignored, so the script always prints success. Pipenv was never building telem successfully, it was masking the failure? Do you want this to be handled in a separate PR? |
|
Extra info on building telem, when I added exception handleing to pipenv build: |
|
I wouldn't worry about the telemerty server, since we're in the process of moving it to another repository. In fact, you could already remove that build step 😉 |
|
Removed Telem build and updated PR description. |
- Refined .gitignore to include specific NUKE build files and directories. - Updated variable name in build.ps1 for consistency with script context. - Added .gitkeep to .nuke directory to ensure it is tracked in version control.
sanzoghenzo
left a comment
There was a problem hiding this comment.
I finally had time to take a look at this, but I soon stopped because this is clearly AI generated code without much thought on it.
Nuke provides many facilities in order to call tools like dotnet, so you don't need to call the processes manually yourself.
Sure, the documentation is a bit lacking (The cli tools page has some non-exhaustive examples), but the tools are there and using any IDE with dotnet support you can find the namespaces, classes and methods available.
For cli tools not supported (such as go), you can use the Lightweight API to wrap the commands into a Tool.
Note that these are my change requests based on the first 90 lines of Build.cs, there colud be other things that need to be changed, but I value my time and I won't waste it on AI generated slop.
There was a problem hiding this comment.
AI slopped documentation interspersed with implementation details, unneeded references to the previous states (pipenv replacement, telemetry server) and design considerations/TODOs that have no place on a developer guide to document a tool usage. Please review it and get straight to the point.
|
Sorry I totally forgot about the disclaimer in the PR description, but this still holds. I understand you just wanted to actually do things instead of keep reading us only thinking and talking about this changes, but you can't vibe code your way through uncharted territories and then drop the ball to others to review. |
|
Thank you for your honest reply @sanzoghenzo To be honest, I have been thinking that I got carried away seeing a problem some of you mentioned needed handleing, and I wanted to help, but underestimating what it takes to do it properly... I have set up a few WiX installers at work, and at a first glance I thought this was not that different... 🤦♂️ I'm open to scrapping the whole PR, but I also kind of want to dig into it some more and see what I can learn how to do it properly. 😂 I don't expect anyone to pick it up and fix it! If you think it's at a point where it is possible for me to keep working on it and get it to an acceptable solution, I'm happy to do so. If you think it is better letting someone with actual NUKE experience tackeling it from scratch, I totally understand. |
|
No worries @OnePowerUser88 you're good willing. |
No need to trash the pr, just converting the calls to dotnet to the proper For the plan, other than reading the documentation, the resources and act upon the acquired knowledge, I don't have any... |
|
Oh, another thing that should be used along with DotNetTask is the Solution & Project model A silly example for a single project [Solution]
readonly Solution Solution;
AbsolutePath OutputDirectory => RootDirectory / "output";
readonly string ProjectName = "MyBeautifulProject";
Target Publish => _ => _
.Executes(() =>
{
var version = "0.0.0"; // obviously this needs to be calculated/read somehow
DotNetTasks.DotNetPublish(_ => _
.SetProcessWorkingDirectory(Solution.Directory)
.SetProject(ProjectName)
.SetConfiguration(Configuration)
.AddProperty("VersionPrefix", version)
.SetOutput(OutputDirectory));
}); |
|
Thank you both for your input. |
|
@OnePowerUser88 well well well. |
Are you sure about that? |
Never sure. Never am until I try it myself. |
|
@sanzoghenzo convince me otherwise |
|
Well, since we have little to no knowledge with both, I'm not willing to convince anyone 😅 it was just a sanity check... I hope Roman can help you/us with this! |
Description
Disclaimer: This PR was largely created with Cursor; someone familiar with the build process should review it.
The main reason for this PR is problems with pipenv; @jmcouffin and @sanzoghenzo had mentioned NUKE as an option.
This PR adds a NUKE-based build so the repo can be built without Python or pipenv. Running
.\build.ps1 BuildProductsfrom the root folder produces the same artifacts aspipenv run pyrevit build products. Pipenv is not removed or changed developers can use eitherpipenv run pyrevit build productsor.\build.ps1 BuildProducts.Included
Build.cs,build.ps1,README.md,build.csproj. Targets: BuildDeps → BuildLabs → BuildLoaders → BuildRuntime → DeployLibsToEngines → BuildAutocmp, plus Clean, Check, and release-related targets (SetVersion, SetYear, SetProducts, BuildInstallers, CommitAndTagBuild, etc.).RunProcesswith captured MSBuild output on failure and/m:1so Deploy targets don't race; Clean then BuildProducts succeeds on first run.pyrevit-autocomplete.exefrom the checked-in Go source (regenerate viapipenv run pyrevit build autocmpwhen CLI usage changes)..nuke/,build/bin/(NUKE runner output; not committed).No product source or DLL changes.
CI can be switched to NUKE later if desired.
Checklist
Before submitting your pull request, ensure the following requirements are met:
.\build.ps1 Checkpasses (dotnet and go on PATH)..\build.ps1 Cleanthen.\build.ps1 BuildProductssucceeds.Related Issues
Additional Notes
.\build.ps1 Checkthen.\build.ps1 BuildProducts(requires .NET SDK and Go). No pipenv needed.build/README.mdhas the full target list, examples, and troubleshooting.