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
python tools not functional from install (prefix) location when building from source #8813
Comments
|
There is no file in this case, but at least wmlindent is running as compared to the first case when it aborts due to missing module. |
Since the Python tools appear to run correctly in previous versions, it could be related to the new Python version (I haven't updated yet so I can't tell for sure). |
This isn't new. I'm not positive it goes back to 1.16, but I'm over 50/50. Or if you mean python version I didn't pay attention, but the issue goes back a couple years at least.
Oh, that's a different issue I guess. I thought that was just because I ran it without any input, but I just ran it on /usr/local/share/wesnoth/data/campaigns/Secrets_of_the_Ancients/scenarios/11_Battleground.cfg.out and it does error. I was only trying to show that /usr/local/bin/wml* and /usr/local/share/wesnoth/data/tools/wml* worked differently. Perhaps I just stumbled on this since I was working on u24.04 (python=3.12.3)? I haven't seen an issue with python=3.10.12 on an earlier 1.19 build. |
I tried to test this with cmake, but I can't find any way to build the WML tools other than scons. Perhaps that's documented along with the WML tools build instructions for scons. On a different note, I did try setting, for example export PYTHONPATH=/usr/local/lib/python/site-packages and I still got an error, but a different one. I'm wondering if no one notices /usr/local/bin/wmlindent not working (for them) because they have their environment set correctly, whereas I am working from a clean slate. If so, I think it's reasonable for the user to expect at least some directions on what to set up (though just doing something like installing links in $prefix/bin to $prefix/share/wesnoth/data/tools/ seems like a better approach since that just works without the user having to do anything -- unless perhaps there's a reason to respect their environment?). |
I've added the Linux label since this is clearly dependent on Linux's practice of distributing an installed program and its associated files across various places. I'd say the easiest fix is to just install a shell script that changes to the appropriate directory and runs the tool from there. There might be a better fix though. But I am wondering if this is specifically a Wesnoth issue at all. Unless you installed the Flatpak version, this is probably something to raise with the Ubuntu package managers rather than with Wesnoth. EDIT: Ah, it could still be a bug in |
This was compiled from git, no packages involved. I can't say for sure, but I seem to remember that the tools don't come with package versions. |
Still specific to Linux in any case. |
Running tools installed fails because it can't find the "wesnoth" module. The build script seems to be installing that module to site-packages, so this could be probably fixed by setting it to correct value for your environment. There's |
Game and System Information
Linux u2404 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Description of the bug
The python tools (wmlindent, etc) will not run from the install directory, at least not without customization that doesn't seem to be documented. They will run from $prefix/share/wesnoth/data/tools/. They also run fine if you remove the binary from $prefix/bin and replace it with a link to the working version.
Steps to reproduce the behavior
I've seen this for some time, there's nothing special about the versions listed above. I did, however, install a clean version of Ubuntu 24.04 (desktop, graphical install, all options left at default) and confirm the issue.
After installing ksh, openssh-server, git, I installed the following before building wesnoth:
g++ libboost-all-dev libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libcairo2-dev libpango1.0-dev libcrypto++-dev libssl-dev libvorbis-dev libreadline-dev python3-tk scons libcurl4-openssl-dev
Expected behavior
I'm sure there's some path that python depends on in case it doesn't find the wesnoth module "under" the directory the binary is running from. However, I don't see this documented anywhere, and I think it's reasonable to assume that if I install in $prefix, I want the versions (or links) in $prefix/bin to work without any customization. I would think scons could be configured to install symlinks from the $prefix/bin versions to the working versions.
Additional context
Could be related to #1988. Seemed like it was going to be at first at least.
I haven't tested cmake, but I will.
The text was updated successfully, but these errors were encountered: