Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn down ruby support #2081

Closed
27 tasks done
myk002 opened this issue Apr 7, 2022 · 20 comments · Fixed by DFHack/scripts#562
Closed
27 tasks done

Turn down ruby support #2081

myk002 opened this issue Apr 7, 2022 · 20 comments · Fixed by DFHack/scripts#562
Labels
idea Suggestions, etc.

Comments

@myk002
Copy link
Member

myk002 commented Apr 7, 2022

If you intend to port a script, please make a comment on this bug to "claim" it so others don't start working on it too.

@myk002 myk002 added the idea Suggestions, etc. label Apr 7, 2022
@lethosor
Copy link
Member

lethosor commented Apr 7, 2022

has multiple external dependencies that users have to separately install on their systems

It's not supposed to. libruby is the only one I can think of - we try to provide a build that should work for everyone, but it isn't always possible. It doesn't work out of the box on some uncommon Linux situations and new versions of macOS: #1742, #1718

Edit: I see #2023 as well. Missed those replies. I guess this falls under "uncommon Linux situations"?

@myk002
Copy link
Member Author

myk002 commented May 5, 2022

We'll need a deprecation plan to inform users that ruby is going away and give them time to rewrite any personal ruby scripts. How about we do this in stages, one stage per release:

  1. port all in-repo ruby scripts to lua; print a deprecation notice to the dfhack console whenever a ruby script is run.
  2. require specific action by the user to load the ruby plugin. e.g. they have to manually move the file to the plugins directory or run a specific dfhack command
  3. remove the ruby plugin from the repo

@myk002 myk002 added this to To do in 0.47.05-r6 via automation May 9, 2022
@myk002 myk002 moved this from To do to In progress in 0.47.05-r6 May 10, 2022
@lethosor
Copy link
Member

Removed rbsandbox.rb from the list - that was a private script of mine.

I think multicmd should be a built-in - I may have expressed this before. I'm willing to take on some of these.

@myk002
Copy link
Member Author

myk002 commented May 10, 2022

I think multicmd should be a built-in - I may have expressed this before.

Ha, I should have read this before I did that last port. We can choose to merge that PR (or not) and make multicmd a builtin later.

@lethosor
Copy link
Member

I guess what I really should have decided on is "not Ruby". It's pretty safe to rely on Lua being available - much more so than Ruby. String manipulation is also a bit easier/safer in Lua, as I'm sure you've found with argument parsing. Really the only risk I see is that people can edit/delete multicmd.lua, but it's not essential enough in my book that we should rewrite it.

@myk002
Copy link
Member Author

myk002 commented May 10, 2022

I'm willing to take on some of these.

There are some that could certainly use your expertise:

  • startdwarf does some direct memory manipulation that I haven't tried before
  • ban-cooking comments are full of conjecture that might benefit from your knowledge
  • create-items needs a decision on whether it should be replaced by the existing modtools/create-item.lua script (or the plugin? see Deduplicate scripts and plugins #1012)

@lethosor
Copy link
Member

Looking at startdwarf now. Not a one-to-one API change, apparently

@warmist
Copy link
Member

warmist commented May 11, 2022

huh... i was sure that there was startdwarf in lua already...

Edit; seems that i failed to port it from an old many-in-one tool

@myk002
Copy link
Member Author

myk002 commented May 22, 2022

I'm looking at superdwarf next. It looks like most of the functionality is copied from the fastdwarf plugin. I think the best way forward for this one is to move the superdwarf command to the fastdwarf plugin and just have that plugin provide both commands.

lethosor added a commit to lethosor/scripts that referenced this issue May 27, 2022
myk002 pushed a commit to DFHack/scripts that referenced this issue May 27, 2022
DFHack/dfhack#2081

* Add tests for startdwarf

* Use mock.observe_func() to verify that patchMemory() has the intended effect

* Clarify docs and consolidate argument validation
@myk002 myk002 moved this from In progress to Bug shortlist in 0.47.05-r6 May 29, 2022
@myk002 myk002 moved this from Bug shortlist to To do in 0.47.05-r6 May 31, 2022
@myk002 myk002 removed this from To do in 0.47.05-r6 Jun 10, 2022
@myk002 myk002 added this to To do in 0.47.05-r7 via automation Jun 19, 2022
@myk002 myk002 removed this from To do in 0.47.05-r7 Aug 23, 2022
AridTag added a commit to AridTag/dfhack_scripts that referenced this issue Dec 20, 2022
AridTag added a commit to AridTag/dfhack_scripts that referenced this issue Dec 20, 2022
myk002 added a commit to DFHack/scripts that referenced this issue Dec 20, 2022
@arekatir
Copy link
Contributor

arekatir commented Jan 8, 2023

I guess I'll claim stripcaged.rb as I might be halfway finished now. If anyone else has started it as well or wants to, contact me in the discord and we can share notes.

@vallode
Copy link
Contributor

vallode commented Jan 8, 2023

Claiming masspit.rb, I will take a crack at this week.

EDIT: DFHack/scripts#531

arekatir added a commit to arekatir/scripts that referenced this issue Jan 9, 2023
@hawkowl
Copy link
Contributor

hawkowl commented Jan 9, 2023

Lever is at DFHack/scripts#515

myk002 pushed a commit to myk002/scripts that referenced this issue Jan 10, 2023
also I think this has been broken indefinitely because the item part of the ruby script doesn't seem like it would have worked ever as doors are items and would have shown in the tile being searched

part of efforts for DFHack/dfhack#2081
arekatir added a commit to arekatir/scripts that referenced this issue Jan 11, 2023
Includes some squashed changes based on feedback received.
arekatir added a commit to arekatir/scripts that referenced this issue Jan 15, 2023
Includes some squashed changes based on feedback received.
@vallode
Copy link
Contributor

vallode commented Jan 15, 2023

I took spawn-liquid.rb too, DFHack/scripts#532

@vallode
Copy link
Contributor

vallode commented Jan 15, 2023

scanitemother.rb is done over at DFHack/scripts#533

@vallode
Copy link
Contributor

vallode commented Jan 16, 2023

I will tackle starvingdead.rb and exterminate.rb this week.

starvingdead.rb ported over at DFHack/scripts#537
exterminate.rb over at DFHack/scripts#541

myk002 added a commit to DFHack/scripts that referenced this issue Jan 18, 2023
myk002 added a commit to DFHack/scripts that referenced this issue Jan 18, 2023
myk002 added a commit to DFHack/scripts that referenced this issue Jan 18, 2023
vallode pushed a commit to vallode/scripts that referenced this issue Jan 20, 2023
Includes some squashed changes based on feedback received.
vallode pushed a commit to vallode/scripts that referenced this issue Jan 20, 2023
myk002 added a commit to DFHack/scripts that referenced this issue Jan 22, 2023
myk002 added a commit to DFHack/scripts that referenced this issue Jan 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea Suggestions, etc.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

8 participants