New program to help set up VASL scenarios

punchdrunk

Recruit
Joined
Jul 30, 2022
Messages
8
Reaction score
2
Country
llCanada
I'm guessing you're running from source. Python often has problems with SSL certificates, so try some of the things suggested on this page. If you're using an old version of Python, that might be causing it as well (since it may not have the latest certs).
I am using a fresh Python 3.10 install. I had to go into the Applications folder and there's an 'Install Certificates.command". Ran that (which is just a pip install command) and all good now.

I am running from source. I thought running from source was the only option on Mac right now. Is there another way?
 

Pacman Ghost

Senior Member
Joined
Feb 25, 2017
Messages
569
Reaction score
287
Location
A maze of twisty little passages, all alike
Country
llAustralia
I am running from source. I thought running from source was the only option on Mac right now. Is there another way?
You can run it using Docker, like Graystonw is :)

You can also run a pre-compiled binary, but since I don't have a Mac, I can't produce these. However..., since you've got it running from source, if you make one of these (one command, see the bottom of the For developers page) and send it to me, I'll make it available on the Github release page (make sure you build from the v1.9 tag).

It'll be a ZIP or TAR, but it looks like it's not too hard to convert that into a DMG. I'm sure Graystonw would be good for a slab of beer for such a thing. Granted, it'll be American beer, but it's still (maybe) better than nothing... 💡
 

punchdrunk

Recruit
Joined
Jul 30, 2022
Messages
8
Reaction score
2
Country
llCanada
You can run it using Docker, like Graystonw is :)

You can also run a pre-compiled binary, but since I don't have a Mac, I can't produce these. However..., since you've got it running from source, if you make one of these (one command, see the bottom of the For developers page) and send it to me, I'll make it available on the Github release page (make sure you build from the v1.9 tag).

It'll be a ZIP or TAR, but it looks like it's not too hard to convert that into a DMG. I'm sure Graystonw would be good for a slab of beer for such a thing. Granted, it'll be American beer, but it's still (maybe) better than nothing... 💡
That’s my hope, but there’s still some weirdness I need to figure out with the shim. My install was not working until I rebuilt, and then it began working. Now I just started with a “fresh” directory install and I am getting errors that it can’t find the shim even after rebuilding it. Plus my original working one can’t find the shim anymore and I didn’t touch it!

I noticed though that all the app directory settings (Vassal, vasl, extensions, boards) were set already in the new one as well, so some things are being cached outside the vasl-templates directory. I wonder if something is being shared or cached by Python and/or Java related to the shim. I’ll try again from a fresh reboot just in case some weird memory caching stuff is going on.

Also I am not a Mac expert. I use them now but none of my dev experience is in a Mac environment. I’ve got some actual work to do right now but will try and dig into this some more later tonight.
 

Pacman Ghost

Senior Member
Joined
Feb 25, 2017
Messages
569
Reaction score
287
Location
A maze of twisty little passages, all alike
Country
llAustralia
My install was not working until I rebuilt, and then it began working.
My first guess would be that the JAR that's in source control is not compatible with the version of Java you're using. Java compatibility goes back a few versions, but not indefinitely. The one in the repo was built using Java 14, against VASSAL 3.4.2. By rebuilding it, the resulting JAR artifact will, of course, be compatible with your version of Java.

The JAR can be found in the repo at $/vassal-shim/release/, and is located using relative paths (in vassal.py). So, if it's not a Java version problem, what is the exact error message you're getting?

so some things are being cached outside the vasl-templates directory.
If you use the desktop app, settings are stored in ~/.vasl-templates.conf. If you're running the webapp from source, they're in $/vasl_templates/webapp/config/*.cfg.
 

punchdrunk

Recruit
Joined
Jul 30, 2022
Messages
8
Reaction score
2
Country
llCanada
And I'm an anything-but-beer guy. I'll settle for some cider or a Churchill-style martini aka a glass of gin with some olives in it.

The error I'm getting is that it can't find the vassal-shim. There's also some weirdness on startup about a few things, but that was there even when the vassal-shim was found. . Everything except the last ERROR comes up immediately at startup. The ERROR is thrown once the window loads and tries to connect. I get the red error overlay message in the main app saying the same thing. The app still works for everything else (no crashing or anything.)
Here's the output from my terminal:
Code:
Unused VASL overrides: adf:1824, adf:1822, adf:1823, 08d:75
Expected multiple images but didn't find them: adf:1828, adf:1829, adf:1830
WARNING:vasl_mod:Unused VASL overrides: adf:1824, adf:1822, adf:1823, 08d:75
WARNING:vasl_mod:Expected multiple images but didn't find them: adf:1828, adf:1829, adf:1830
ERROR:root:Can't check the VASSAL version: Can't find the VASSAL shim JAR.
Using Python 3.10, Java 18.0.2 so should be ok there. The OS on this machine is still Catalina though (10.15.7). But I had it working yesterday!
 

punchdrunk

Recruit
Joined
Jul 30, 2022
Messages
8
Reaction score
2
Country
llCanada
Okaaaaay. So I just re-ran the dev setup from vasl-templates-1.9. pip install --editable .[dev]
Once that was done everything is fine again (aside from the warnings). But not just in that one directory. Now my several different installs all work and before that none of them did. So something is getting setup in the overall environment from running the dev install that is allowing vassal-shim to be found.

It is also then quite likely that what made it work for me yesterday was not re-building the shim but rather that I did the dev setup as step 1 of rebuilding, and didn't try the app again until I'd rebuilt. So, progress!
 

Pacman Ghost

Senior Member
Joined
Feb 25, 2017
Messages
569
Reaction score
287
Location
A maze of twisty little passages, all alike
Country
llAustralia
But not just in that one directory. Now my several different installs all work and before that none of them did. So something is getting setup in the overall environment from running the dev install that is allowing vassal-shim to be found.
I can't explain how this could be happening. vassal.py locates the JAR relative to itself, so there's no way it's going to find the JAR in another repo. Doing an editable install means that the code is run directly from where it is (instead of being copied over to site-packages/ and run there), so by definition, it's a local, non-global installation.

Have you set up separate virtualenv's for each repo? One thing I can think of is that you're running the program using the vasl-templates command, which is set up during the pip install, and is installed into the current virtualenv. So, if you activate the virtualenv for installation A, cd to installation B, then run the vasl-templates command, you will actually be running the code from installation A.

If you haven't created virtualenv's, each installation will be using the same site-packages/ (whether it be system or user), then that could maybe explain how fixing one installation magically causes the others to start working. But I don't think so, since the JAR doesn't get installed when you do a non-editable install, so it's never going to work anyway.

But all this is moot, since the code should've picked up the JAR that's in source control. And even if you've rebuilt it, it should've overwritten the old one i.e. it will still live at the same file path.

The only way I can think of to get the outcome you've reported is that you done a non-editable install (so the code has gone into site-packages/), the code complained about not finding the JAR (because it doesn't get installed into site-packages/), so you've cd'ed into site-packages/vasl-templates/vassal-shim/ and built the vassal-shim JAR from there (not $/vassal-shim/ in your local repo), thus creating a new JAR at a location where the code in site-packages/ can find it, and ta-da: things work. No. this doesn't make sense either, because the vassal-shim/ directory doesn't get installed into site-packages/. I'm stumped :(

I would:
  • delete all your installations
  • make sure all your site-packages/ are clean i.e. there is no vasl-templates package, nor a possible spurious releases/ directory that may have inadvertently been created (if my hypothesis above is correct)
  • clone the repo again, create a virtualenv, do an editable pip install
I just tried this on a clean installation of Fedora 36, and it works.
 
Last edited:
Top