Create your AI Cum Slut -70% for Mother's Day
x

Anyone here familiar with a tool called renpy-graphviz?

FaceCrap

Ghost of torrents passed
Donor
Oct 1, 2020
1,535
1,068
Purely by accident I stumbled on this tool . Pretty quick it became clear this tool is deliberately mangled. It removes underscores from labelnames for 'aestathic' resons...
After creating an for it in the github repo I got told by the dev he won't do anything about it but I was free to submit a PR.

Well, I know nothing about GO, but decided to take a look at the code.
looks like this line in ./parser/graph.go is responsible for it.
Code:
    labelName := beautifyLabel(label, tags)
My initial thought was I just needed to replace that with
Code:
    labelName := label
but the called function seems to do more than just strip underscores...
On top of that, when I tried to build the damn thing, the first time around I got
Revisiting that issue after , I tried the suggested workaround and suddenly GO began to complain it could not find gcc...
Ok, downloaded mingw64, added it to the path and got a whole slew of other errors... (see attachment)

At this point I throw the towell, I have even less knowledge about fixing errors spewed by gcc than I have about GO, which is zero.

So, if anyone here has used the tool, and maybe, (I fear I've got a snowball's hope in hell here) , maybe decided to build a personal copy that does NOT remove underscores from labelnames... I would very much appreciate to get a copy.
 
Last edited:

loveIsInTheAir

New Member
Aug 11, 2022
5
4
I don't know if this helps or create more problem for you but I have tried to create some script in c# with graphviz but I ended up abandoning it but it works somewhat well for very small project, but you can try this youtube video watch?v=7dfGgJRAEZY (I can't yet post a link) it is in python there is a link in the description

if you want mine c# script (works barely and needs other tools too) I will upload it here
 
Last edited:

FaceCrap

Ghost of torrents passed
Donor
Oct 1, 2020
1,535
1,068
I don't know if this helps or create more problem for you but I have tried to create some script in c# with graphviz but I ended up abandoning it but it works somewhat well for very small project, but you can try this youtube video watch?v=7dfGgJRAEZY (I can't yet post a link) it is in python there is a link in the description

if you want mine c# script (works barely and needs other tools too) I will upload it here
I know probably even less about C# then about GO. I can somewhat follow the logic in GO, but have no idea what most functions do.
And since I can't get the damn thing compiled, no way to experiment.
The thing is, it's the large(r) projects I wanted it for, as these are the ones where branches and multi-paths are fairly difficult to follow.

Fun fact though, the author of that vid points to a lemmasoft forum thread which then also points to the exact same tool I mentioned in my OP...
So we're back where I started... but thanks anyway for the pointer. If it didn't have the shortcomings the author pointed out, it might have been a good alternative.
 

loveIsInTheAir

New Member
Aug 11, 2022
5
4
I have never used go but have worked with the c and cpp build ports for windows

I just tried to build renpy-graphviz and go-graphviz it builds ok and works fine, so i'm guessing the problem is the dependency missing from your computer.

What I noticed is when building on my computer it uses my installation of winlibs (it is mainly mingw64 and other compiler tools).
cgo.exe calls gcc.exe

my suggestion
- instead of using choco or doing it manually, there is a package manager called scoop use it to install mingw-winlibs
- run => scoop install main/mingw-winlibs​
- restart your terminal/shell - to load the updated PATH
- use admin mode when starting new terminal - not always necessary but better safe than sorry​
- just for a test run => gcc -v​
- if you are not sure about scoop and wanna do it manually, you can download a zip from winlibs_com
- choose the download that says 'without LLVM/Clang/LLD/LLDB' and I say choose MSVCRT instead of the latest UCRT for compatibility with older windows - if you care about that​
- then all left is extracting it and adding to the bin folder to the path​

I read in go github issues you can use -x argument to list all subcommands run by go: go build -v -x

good luck
 
Last edited:

FaceCrap

Ghost of torrents passed
Donor
Oct 1, 2020
1,535
1,068
- instead of using choco or doing it manually, there is a package manager called scoop use it to install mingw-winlibs
- run => scoop install main/mingw-winlibs​
- restart your terminal/shell - to load the updated PATH
- use admin mode when starting new terminal - not always necessary but better safe than sorry​
- just for a test run => gcc -v​
Ok, I have never used scoop, but to prevent any missing dependencies I installed scoop, ran it as per your suggestion, and this time did a go build -v -x.

Sadly, just like the previous time, I ended up with the same boatload of errors (from the looks of it it seems to be the linking part)

cgo.exe calls gcc.exe
The only way I could get go to call gcc was by adding CGO_ENABLED=1 to my environment as per the tip in . I assume you have this set too? Since the cgo executable isn't in the bin folder, but I did find it in the pkg folder.

So, unless someone comes along, manages to successfully compile renpy-graphviz after changing
this bit var replaceBlanks = regexp.MustCompile("[)(_=]") in parser/graph.go at ~line 58
into var replaceBlanks = regexp.MustCompile("[)(=]")
(presuming this is the needed change to prevent it from removing underscores from labelnames, and although I've never come across labels having any of these characters ) ( = maybe even remove the whole use of that variable?) I'll have to forget about renpy-graphviz.
 
Last edited:

loveIsInTheAir

New Member
Aug 11, 2022
5
4
Ok, I have never used scoop, but to prevent any missing dependencies I installed scoop, ran it as per your suggestion, and this time did a go build -v -x.

Sadly, just like the previous time, I ended up with the same boatload of errors (from the looks of it it seems to be the linking part)


The only way I could get go to call gcc was by adding CGO_ENABLED=1 to my environment as per the tip in . I assume you have this set too? Since the cgo executable isn't in the bin folder, but I did find it in the pkg folder.

So, unless someone comes along, manages to successfully compile renpy-graphviz after changing
this bit var replaceBlanks = regexp.MustCompile("[)(_=]") in parser/graph.go at ~line 58
into var replaceBlanks = regexp.MustCompile("[)(=]")
(presuming this is the needed change to prevent it from removing underscores from labelnames, and although I've never come across labels having any of these characters ) ( = maybe even remove the whole use of that variable?) I'll have to forget about renpy-graphviz.
I still think some other mingw, or other installation is interfering with your build

The only way I could get go to call gcc was by adding CGO_ENABLED=1 to my environment as per the tip in . I assume you have this set too? Since the cgo executable isn't in the bin folder, but I did find it in the pkg folder.
No, I didn't have, it is already enabled by default you can see that by running go env
You don't have permission to view the spoiler content. Log in or register now.

Okay as the last resort i come up with some options for you to go with
  1. Create isolated terminal to try build with scoop again this might work if give it a try
    • Run new terminal (NOT powershell) in the renpy-graphiz folder
    • Run %USERPROFILE%\scoop\shims;%USERPROFILE%\scoop\apps\mingw-winlibs\current\bin;%USERPROFILE%\go\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\OpenSSH\
    • The above command is already enough for me as my go installation is also installed by scoop
      • scoop install main/go - i recommend this one
    • If you're already installed go in another place or used official installation, even portable installation just by extraction, you need to add the folder go.exe exists into the path by - for example if it is in C:\go\go.exe
      • PATH = %PATH%;C:\go\
    • now just try building here
  2. Using github action for a build it is simple enough as renpy-graphviz guys already using it
    • If you look at the github repo of renpy-graphviz they are using a tool called xgo and have set up to run when new tagged commits pushed through
      • .github/workflows/go.yml
    • The build run tests on on every merge to master branch and create release on github for all tagged commits
    • First clone renpy-graphviz to new location
    • Replace go.yml file with the attached one - rename it back to go.yml from go.yml.txt
    • Delete dependabot.yml as it is already in original repo
    • Change the file you want to change i.e.: parser.go
    • Create a new EMPTY repo on your github, example: https://github.com/FaceCrap/renpy-graphiz
      • can be a private repo - no need
    • Open a command line in the cloned repo and change the origin by this command
      • git remote set-url origin https://github.com/FaceCrap/renpy-graphiz
    • Commit all of your changes and push them, it will be pushed to the new origin
    • Go to actions and manually run Build EXE workflow
  3. I've used google colab for building large project that consume large memory, but this will introduce more problems, you can try it out if you want
 
Last edited:
  • Heart
Reactions: FaceCrap

loveIsInTheAir

New Member
Aug 11, 2022
5
4
So, unless someone comes along, manages to successfully compile renpy-graphviz after changing
this bit var replaceBlanks = regexp.MustCompile("[)(_=]") in parser/graph.go at ~line 58
into var replaceBlanks = regexp.MustCompile("[)(=]")
(presuming this is the needed change to prevent it from removing underscores from labelnames, and although I've never come across labels having any of these characters ) ( = maybe even remove the whole use of that variable?) I'll have to forget about renpy-graphviz.
Oh, this is the edited and complied renpy-graphviz, I didn't test it just compiled and uploaded it

 

FaceCrap

Ghost of torrents passed
Donor
Oct 1, 2020
1,535
1,068
Oh, this is the edited and complied renpy-graphviz, I didn't test it just compiled and uploaded it
Thanks! I tried it, and indeed, it left the underscores in place. But I discovered that it did more unspeakable things with labelnames, so...

Using github action for a build it is simple enough as renpy-graphviz guys already using it
I tried this method. AND BINGO!
You're a GOD. THANK YOU SO MUCH for this option. Now that I have a repeatable option to generate an executable, I was able to experiment with the code, so now it leaves label names as they occur in the code.

For those that struggled with the same issue. here's the version resulting from the above method.

I'll see if I can make it configurable through either config file or commandline. But that is not high on my priority list.

EDIT: I have no idea why your version ended up being almost 3 times larger in size than the original. Using the Github method mine came in only a few KB smaller than the size of the original.
 
Last edited:
  • Like
Reactions: loveIsInTheAir

loveIsInTheAir

New Member
Aug 11, 2022
5
4
EDIT: I have no idea why your version ended up being almost 3 times larger in size than the original. Using the Github method mine came in only a few KB smaller than the size of the original.
You're right, I think the extra size is because of debugging info and the github method uses xgo, it removes this debugging info as debugging info is mainly used for development time, what I did was just go build, I'm guessing there are some option to remove debugging info to decrease the size

good luck on your game
 
Last edited:
  • Like
Reactions: FaceCrap