# RhinoScriptCompiler CI/CD Pipeline Issues

**URL:** <https://discourse.mcneel.com/t/rhinoscriptcompiler-ci-cd-pipeline-issues/127346>\
**Category:** Rhino Developer\
**Tags:** windows, featurerequest, rhinoscriptcompiler, package-manager\
**Created:** [July 13, 2021, 1:46am UTC](https://discourse.mcneel.com/t/rhinoscriptcompiler-ci-cd-pipeline-issues/127346 "2021-07-13T01:46:06Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris.welch](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/chris.welch/32/772822_2.png) [@chris.welch](https://discourse.mcneel.com/u/chris.welch)\
**Post date:** [July 13, 2021, 1:46am UTC](https://discourse.mcneel.com/t/rhinoscriptcompiler-ci-cd-pipeline-issues/127346/1 "2021-07-13T01:46:06Z")

</div>

Hi there,

I’ve been trying to set up a CI/CD pipeline for our team so that they can push grasshopper and python scripts to a git repo and then have the repo automatically compile all the scripts into a valid Rhino Plugin and then deploy that to our modellers.

The issue is, the script compiler is hardcoded to build to the temp drive, which our build machine doesn’t have access to, and breaks the whole endeavor.

I see two solutions to this:

- one is to allow local pathing for the temp directory in the RhinoScriptCompiler and testing it in a system account environment
- two is, if the team is comfortable, just open sourcing the compiler so people can make changes as necessary

When (eventually, I presume) we can host our own internal package managers, this will be an important part of the code deployment process.

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/772741_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [July 13, 2021, 3:47pm UTC](https://discourse.mcneel.com/t/rhinoscriptcompiler-ci-cd-pipeline-issues/127346/2 "2021-07-13T15:47:33Z")

</div>

@will - is this something you can help with?

---

<div class="post-metadata">

**Author:** ![will](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/will/32/479454_2.png) [@will](https://discourse.mcneel.com/u/will)\
**Post date:** [July 13, 2021, 4:34pm UTC](https://discourse.mcneel.com/t/rhinoscriptcompiler-ci-cd-pipeline-issues/127346/3 "2021-07-13T16:34:34Z")

</div>

I checked the RhinoScriptCompiler code and I found two references to the system temporary files directory – [`Path.GetTempPath()`](https://docs.microsoft.com/en-us/dotnet/api/system.io.path.gettemppath?view=net-5.0&tabs=windows) and `CSharpCodeProvider` ([which apparently uses the system temp folder by default](https://social.msdn.microsoft.com/Forums/vstudio/en-US/3bfbd81d-69be-4aa7-8478-991e5ffb1b3a/csharpcodeprovider-and-temporary-files?forum=netfxbcl)). In both cases, I wonder if manually setting the `TMP` and/or `TEMP` env var(s) would fix things. That seems to be the approach taken by others…

> <https://github.com/actions/virtual-environments/issues/712>
>
> This was originally \[posted on the community forum\](https://github.community/t5/…GitHub-Actions/TEMP-is-broken-on-Windows/m-p/30432) last year. Since the forum seems to be winding down in activity, and I never got a response, I'm reposting it here.
> 
> \--
> 
> I was running into some test failures when migrating my Windows tests from Travis to GitHub Actions. I ended up narrowing down the breakage to this simple env var:
> 
> \`\`\`
> $ echo %TEMP%
> C:\\Users\\RUNNER~1\\AppData\\Local\\Temp
> \`\`\`
> 
> This was causing me issues because the actual home dir is \`C:\\Users\\runneradmin\`, which I checked via \`echo %USERPROFILE%\`. Note that the case sensitivity here doesn't matter for my purposes; it's the short path (the \`~1\`) that's breaking my code.
> 
> Is there a reason that the environment is inconsistent like this? I think both \`%TMP%\` and \`%TEMP%\` should be \`C:\\Users\\runneradmin\\AppData\\Local\\Temp\`. In other words, they should have \`%USERPROFILE%\` as a prefix.

As for private package repositories, have you seen this?

> **[Custom Package Repositories](https://developer.rhino3d.com/guides/yak/package-sources/)**
>
> This is a quick guide to configuring custom package repositories in Rhino.

---

<div class="post-metadata">

**Author:** ![chris.welch](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/chris.welch/32/772822_2.png) [@chris.welch](https://discourse.mcneel.com/u/chris.welch)\
**Post date:** [July 13, 2021, 7:54pm UTC](https://discourse.mcneel.com/t/rhinoscriptcompiler-ci-cd-pipeline-issues/127346/4 "2021-07-13T19:54:48Z")

</div>

Cheers Will I’ll check that approach today.

Regarding private yak servers, see Dharman’s statement here (we’re both at the same firm) : [Yak for private distribution? - #11 by dharman](https://discourse.mcneel.com/t/yak-for-private-distribution/118697/11)

Happy to elaborate on this further if you would like.

---

<div class="post-metadata">

**Author:** ![stevebaer](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/stevebaer/32/473567_2.png) [@stevebaer](https://discourse.mcneel.com/u/stevebaer)\
**Post date:** [July 13, 2021, 8:04pm UTC](https://discourse.mcneel.com/t/rhinoscriptcompiler-ci-cd-pipeline-issues/127346/5 "2021-07-13T20:04:40Z")

</div>

> [@chris.welch](#):
>
> Cheers Will I’ll check that approach today.

We can always change the code to use a different directory for temporary work if this approach doesn’t pan out.

---

<div class="post-metadata">

**Author:** ![chris.welch](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/chris.welch/32/772822_2.png) [@chris.welch](https://discourse.mcneel.com/u/chris.welch)\
**Post date:** [July 15, 2021, 2:59am UTC](https://discourse.mcneel.com/t/rhinoscriptcompiler-ci-cd-pipeline-issues/127346/6 "2021-07-15T02:59:34Z")

</div>

Hey folks we’re going to take some time to test this properly on our end as a number of things could be causing issues - we’ll report back once we have identified what we think are any specific problems related to the exe itself.

General takeaway for now is, a version of the rhino compiler designed specifically for build machines would be a very cool thing to exist - would allow us to push .gh files to git and wrap all our hard work into shiny plugins for our team!

---

<div class="post-metadata">

**Author:** ![will](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/will/32/479454_2.png) [@will](https://discourse.mcneel.com/u/will)\
**Post date:** [July 15, 2021, 4:37pm UTC](https://discourse.mcneel.com/t/rhinoscriptcompiler-ci-cd-pipeline-issues/127346/7 "2021-07-15T16:37:37Z")

</div>

@chris.welch I tried setting up a GitHub Action that uses RhinoScriptCompiler.exe. With the benefit of debug builds, I found that all the errors happened when writing output – the design of the application expects an interactive terminal, but this isn’t the case when running CI builds. I fixed the errors and I’ll send a daily build when I have one, so you can try it out.

---

<div class="post-metadata">

**Author:** ![chris.welch](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/chris.welch/32/772822_2.png) [@chris.welch](https://discourse.mcneel.com/u/chris.welch)\
**Post date:** [July 15, 2021, 8:00pm UTC](https://discourse.mcneel.com/t/rhinoscriptcompiler-ci-cd-pipeline-issues/127346/8 "2021-07-15T20:00:58Z")

</div>

That would be fantastic Will, thank you very much!

---

<div class="post-metadata">

**Author:** ![chris.welch](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/chris.welch/32/772822_2.png) [@chris.welch](https://discourse.mcneel.com/u/chris.welch)\
**Post date:** [July 15, 2021, 10:45pm UTC](https://discourse.mcneel.com/t/rhinoscriptcompiler-ci-cd-pipeline-issues/127346/9 "2021-07-15T22:45:46Z")

</div>

The custom build that Will sent me worked perfectly on our build machine.

---

<div class="post-metadata">

**Author:** ![chris.welch](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/chris.welch/32/772822_2.png) [@chris.welch](https://discourse.mcneel.com/u/chris.welch)\
**Post date:** [July 15, 2021, 10:46pm UTC](https://discourse.mcneel.com/t/rhinoscriptcompiler-ci-cd-pipeline-issues/127346/10 "2021-07-15T22:46:47Z")

</div>

Now if only we had a private yak server to deploy this to 😉

---

<div class="post-metadata">

**Author:** ![will](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/will/32/479454_2.png) [@will](https://discourse.mcneel.com/u/will)\
**Post date:** [July 16, 2021, 10:43am UTC](https://discourse.mcneel.com/t/rhinoscriptcompiler-ci-cd-pipeline-issues/127346/11 "2021-07-16T10:43:10Z")

</div>

Fantastic. The updated RhinoScriptCompiler.exe will be included in next week’s Rhino 7.9 RC release.
