BSA tool in rust

Not about OpenMW? Just about Morrowind in general? Have some random babble? Kindly direct it here.
arviceblot
Posts: 3
Joined: 12 Apr 2020, 21:41

BSA tool in rust

Post by arviceblot »

Hey all, I spent the weekend trying to learn rust. To get started I decided to try converting the bsatool from the openmw source.

If you are interested you can check out the source here: https://github.com/arviceblot/bsatool_rs

If you have rust installed you can try it out from the crate with:

Code: Select all

crate install bsatool_rs
bsatool_rs —help
It seems to work on the main Morrowind.bsa on macOS and Linux, but I make no guarantees :roll:
User avatar
psi29a
Posts: 5356
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: BSA tool in rust

Post by psi29a »

Cool! <3 Rust :)
User avatar
bmw
Posts: 81
Joined: 04 Jan 2019, 19:42
Contact:

Re: BSA tool in rust

Post by bmw »

Brilliant, that actually resolves an issue in one of my projects (https://gitlab.com/portmod/portmod/-/issues/108). I'll let you know if I find any bugs.

It was mildly problematic that bsatool was, to my knowledge, the only cli tool that could handle bsa files, but isn't distributed with all the release variants of OpenMW, so it's not guaranteed that everyone will have access to it (it included with the Linux builds, if I recall, but not Windows builds). I probably should have requested that it be included, but I never got around to it.

Welcome to the world of Rust!
User avatar
psi29a
Posts: 5356
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: BSA tool in rust

Post by psi29a »

bmw wrote: 15 Apr 2020, 15:19 It was mildly problematic that bsatool was, to my knowledge, the only cli tool that could handle bsa files, but isn't distributed with all the release variants of OpenMW, so it's not guaranteed that everyone will have access to it (it included with the Linux builds, if I recall, but not Windows builds). I probably should have requested that it be included, but I never got around to it.
All you had to do was ask man... I guess I'll make a point of it that 0.46, nightlies and rest all ship with it.
arviceblot
Posts: 3
Joined: 12 Apr 2020, 21:41

Re: BSA tool in rust

Post by arviceblot »

bmw wrote: 15 Apr 2020, 15:19 It was mildly problematic that bsatool was [...] the only cli tool that could handle bsa files, but isn't distributed with all the release variants of OpenMW
This was actually my primary motivator, second was to learn rust, and third was to have an excuse to start poking around the OpenMW source.
psi29a wrote: 15 Apr 2020, 15:30 0.46, nightlies and rest all ship with it.
Wooh! That'll make testing a lot faster. I never got the macOS dependencies figured out so I've been comparing tool outputs on a Linux VM.
User avatar
bmw
Posts: 81
Joined: 04 Jan 2019, 19:42
Contact:

Re: BSA tool in rust

Post by bmw »

psi29a wrote: 15 Apr 2020, 15:30 All you had to do was ask man... I guess I'll make a point of it that 0.46, nightlies and rest all ship with it.
.

Thanks, that sounds great.
I get distracted easily, and find communication difficult, so I just kept putting it off in favour of working on other things.

I don't suppose it would be possible to have the install directory added to the Windows PATH variable as well, or should I just try to detect it's location? For that matter, would the macOS version also have that issue, or does macOS have applications in the path by default?
User avatar
AnyOldName3
Posts: 2668
Joined: 26 Nov 2015, 03:25

Re: BSA tool in rust

Post by AnyOldName3 »

Generally, it's not considered a good idea for installers to add things to the path on Windows without asking. The character limit used to be pretty short, so it risked breaking things.
User avatar
Capostrophic
Posts: 794
Joined: 22 Feb 2016, 20:32

Re: BSA tool in rust

Post by Capostrophic »

Going off-topic, but if we're going to enable bsatool, let's include esmtool as well, it can do some things OpenMW-CS can't.
User avatar
psi29a
Posts: 5356
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: BSA tool in rust

Post by psi29a »

Capostrophic wrote: 16 Apr 2020, 06:34 Going off-topic, but if we're going to enable bsatool, let's include esmtool as well, it can do some things OpenMW-CS can't.
Already done on the Linux side of things, just need MacOS and Windows to follow. We can verify in our 0.46 thread for RCs.
User avatar
AnyOldName3
Posts: 2668
Joined: 26 Nov 2015, 03:25

Re: BSA tool in rust

Post by AnyOldName3 »

The main thing is changing these lines, then: https://gitlab.com/OpenMW/openmw/-/blob ... h#L762-765
Post Reply