WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Extension Testing Without Rebooting  (Read 2261 times)

Offline CNK

  • Wiki Author
  • Sr. Member
  • *****
  • Posts: 281
Extension Testing Without Rebooting
« on: November 28, 2020, 05:02:10 PM »
For a number of reasons (some probably common, others more specific to the system I have CorePure64 installed on and how I access it) rebooting with the "base" and "norestore" bootcodes in order to test extensions promises to be a multi-pronged pain in the rear end. As such it just hasn't happened and I'm building up a backlog of packages that are otherwise ready but probably won't be submitted any time soon, if ever.

It seems to me that the following should provide an equivalent to a "base" environment, run after a normal boot:
Code: [Select]
cd /usr/local
sudo rm -r *
sudo mkdir tce.installed

The .tczs could be unmounted too ("sudo umount /dev/loop*"?), but I don't think there's any reason to after deleting the links to them in /usr/local. Unless some extensions do place things in other locations than /usr/local.

I'm not really sure about the necessity of "norestore", but I suppose I could also do (untested):
Code: [Select]
filetool.sh -b
sudo rm -f `sudo tar tzf /etc/sysconfig/tcedir/mydata.tgz`

Then after loading the extension to be tested and confirming that it works with only the dependencies loaded from its .dep file, the regular system can be restored with:

Code: [Select]
tce-load -i < /etc/sysconfig/tcedir/onboot.lst
filetool.sh -r

So my question is - will that be good enough for testing an extension before submission? The only potential issue that I can imagine is that extensions that run scripts when loaded could modify files from the base system, and these modifications wouldn't be reverted. So if a program depends on the modification made by installing another extension, it might be missed from the .dep, but only if the program doesn't also depend on any files from that extension, which seems unlikely.
« Last Edit: November 28, 2020, 05:05:00 PM by CNK »

Offline andyj

  • Hero Member
  • *****
  • Posts: 1036
Re: Extension Testing Without Rebooting
« Reply #1 on: November 28, 2020, 07:17:16 PM »
You might be making it harder than it needs to be. Either the extensions you are building require some of the base extensions, or they don't. If they do, then they need to be loaded. If they don't, then why does it matter if they are loaded or not if there is no dependency or interaction? Do you expect that the extensions you are building will be used only in a "base" environment? Probably not. Watch out for side effects when other extensions are loaded. I've been bit by this a few times.

Offline CNK

  • Wiki Author
  • Sr. Member
  • *****
  • Posts: 281
Re: Extension Testing Without Rebooting
« Reply #2 on: November 29, 2020, 02:29:37 AM »
Basically I'm just following the guide on the Wiki which says to boot with "base" and "norestore" to test. I don't need to for my own use of course, but I understand that testing that way is expected if you're submitting extensions. Personally I think "norestore" is a bit extreme, but I understand that "base" is in order to pick up any required extensions missing from the .dep file.

Maybe an example would be best: Two programs that I've made extensions for, but not submitted, are gv and Sylpheed.

After wiping out everything in /usr/local I can run "tce-load -i gv" and all the dependencies load up. Then I run "gv &" and up pops my favourite ps/pdf viewer, displaying pdfs nicely.

Again I wipe out /usr/local (so running "gv &" now just gives me "gv: not found"), and this time I do "tce-load -i sylpheed". Now I run "sylpheed &" and Sylpheed pops up, but... argh! All the text is just little boxes, so obviously it relies on another extension to provide fonts or something, and even though it starts it's not usable. Now I do "tce-load -i `cat /etc/sysconfig/tcedir/onboot.lst`" (I stuffed that line up in the last post, will edit now [EDIT: Rats! I can't edit it now, oh well]) to load all the extensions that I normally have installed, and Sylpheed loads with text visible instead of box characters. So I now know that I'm definately missng an extension somewhere in Sylpheed's .dep file, which should be added before I submit it.

My question is about gv. To my standard I've tested it enough - I expect that it will work on any base system with only the extensions listed in the .dep file loaded. But I didn't use the same method as described in the Wiki so I don't know if I might just be ignorant and potentially introducing extensions with non-working .dep lists. I don't think so, but I'm looking for an official word.

PS. Someone's probably confused about how I'm testing graphical programs without any X server extension loaded. I'm accessing them over the network by setting the "DISPLAY" environment variable to another computer on my LAN that has an X server listening for connections over TCP. As such, all that should be needed on a "base" system are the extensions listed in the .dep file (plus their automatically loaded dependencies).
« Last Edit: October 27, 2022, 10:42:29 PM by Rich »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Extension Testing Without Rebooting
« Reply #3 on: November 29, 2020, 03:11:29 AM »
Your method should be close enough to submit those extensions. However you may also try a VM if your native install isn't easy to reach.
The only barriers that can stop you are the ones you create yourself.

Offline CNK

  • Wiki Author
  • Sr. Member
  • *****
  • Posts: 281
Re: Extension Testing Without Rebooting
« Reply #4 on: November 29, 2020, 05:36:08 PM »
Thanks, that's what I wanted to hear.