Sublime Forum

[Solved] My custom Build stopped working

#1

Hello all,
I am new to Sublime Text 3 - and, wanting to use it as a Python development environment I was delighted to find this YouTube tutorial from OdatNurd making a custom build environment with Terminus. I followed along and to my immense pleasure I was able to create not just one, but two, build environments (one where the input/output happens in the traditional bottom pane, and one where it opens a new tab. Both worked just fine!
That was yesterday.
Today I fired up ST3 to continue working and… nothing…CTRL B (I am on Linux) did nothing at all. No error message - just nothing…
The same is true for both my custom builds.
Switching to the standard Python build does work - but of course will not accept input.
Here is my build:
{
"target": "terminus_exec",
"cancel": "terminus_cancel_build",
"focus": true,

"shell_cmd": "python -u \"$file\"",
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",

"env": {"PYTHONIOENCODING": "utf-8"},

"variants":
[
	{
		"name": "Syntax Check",
		"shell_cmd": "python -m py_compile \"${file}\"",
	}
]

}

Why did it work yesterday but not today? I changed nothing.
How do I even troubleshoot this (there are no error messages).

Thanks in advance for any help…

0 Likes

#2

Well - a couple of days later and I’m still no nearer to a solution.

When I enable the console, I find that I get a load of error messages such as:
File "/home/mydir/.config/sublime-text-3/Installed Packages/Material Theme.sublime-package/utils/changelog.py", line 67, in is_enabled
AttributeError: 'module' object has no attribute 'version'

I don’t know if this is significant or not.

However - the most important piece of information I can give is this:
when I do CTRL B on one of my Python files using my custom build (copied from @OdatNurd’s video) I get this:

Unable to find target command: terminus_exec

(despite the fact that it was working previously).

So I think that perhaps the Terminus package has become corrupted somehow - OK let’s remove and re-install it…
I get this:
File "/home/MyDir/.config/sublime-text-3/Installed Packages/Package Control.sublime-package/package_control/commands/remove_package_command.py", line 58, in on_done
File "/home/MyDir/.config/sublime-text-3/Installed Packages/Package Control.sublime-package/package_control/package_disabler.py", line 76, in disable_packages
ImportError: No module named 'package_control'

and the Terminus package does not get removed.

So far I have been able to get no further.

Any ideas? What should I try next?

Thanks for any help or suggestions…

0 Likes

#3

The first thing to double check would be to go into your preferences (the standard Sublime ones) and make sure that neither 0_package_control_loader nor Package Control appear in the ignored_packages setting; if they do, remove them and restart Sublime.

The errors you’re seeing are related to plugins not being able to load, which is also the reason why terminus_exec doesn’t appear for example.

Sometimes this sort of thing can be caused by package control or it’s control package getting in the list of ignored packages, which can stop package control or anything that requires a dependency library from working.

0 Likes

#4

@OdatNurd Thanks for helping! It’s still not working, but I think we’re making progress…

There was indeed a 0_package_control_loader field in my ignored_packages. I removed it, restarted, and now I get a different set of errors:
File "/home/MyDir/.config/sublime-text-3/Installed Packages/Terminus.sublime-package/terminus/core.py", line 98, in <lambda>
TypeError: run_async() got an unexpected keyword argument 'debug'

As a sidenote, when I tried to examine some of the configuration files I got these messages in the console:

Unable to open /home/MyDir/.config/sublime-text-3/Packages/Default/Preferences.sublime-settings
Unable to open /home/MyDir/.config/sublime-text-3/Packages/Terminus/Terminus.sublime-settings

But actually ST3 did indeed open them for me (in a new window).

Are we making progress?

Thanks again…

0 Likes

#5

The error messages about not being able to open files are harmless; those files are stored in sublime-package files, but if they were to exist outside of their packaged files (i.e. if you created an override to modify them at the source) that’s the place where they would live. The command that opens files looks there first and then falls back to opening them from the sublime-package file if it fails.

This seems like you might have a key named debug in your build system; anything that’s in the build gets passed as an argument to the build command, but the terminus_open command (terminus_exec executes terminus_open to actually run the build) doesn’t accept an argument of debug, which would make it throw that error.

If that’s the case, removing that key from the build should solve the problem.

0 Likes

#6

Thank you so much @OdatNurd! I now have, once again, a working system. I really appreciate your help.

I have to confess to something of a “senior moment”. When trying to work out what was going on, I wondered if there was a debug option in the build system - so (without bothering to do any research to see if such an option actually existed) I just tried it… I made a copy of my Terminus build system and put a “debug”: true, command in just to see what would happen. Of course nothing did (this is before I had discovered the console messages). So I forgot about it.

So, when I posted my last comment with that error message in it, not only had I forgotten that I had tried that, but I had also forgotten that I was still on the altered copy of my Terminus build system…

Anyway - it’s all working now - so thanks again!

Now, what was it I came here for again?..

1 Like