Author Topic: WTF, software updates breaking all my SW projs in 6 to 12 moths top!  (Read 13660 times)

0 Members and 2 Guests are viewing this topic.

Offline alm

  • Super Contributor
  • ***
  • Posts: 2903
  • Country: 00
Re: WTF, software updates breaking all my SW projs in 6 to 12 moths top!
« Reply #25 on: October 13, 2022, 11:38:01 pm »
another thing is if the developer dont allow you to do full offline installer download nor letting to install older version, like Python does.
What language are you talking about? Python offers version going back to 2001 right on their website. You can download them for offline installation if you want. The tool PyEnv makes it trivial to install different versions. It will even compile them from source if there's no suitable binary release for your system. But the changes between Python releases are so minor that I don't even pay attention to the version for personal use. My desktop runs Python 3.10, but my data acquisition code runs on Python 3.7. Never ran into a problem as long as I don't use the new features that have been recently introduced, which are generally easy enough to avoid.

Can you give an example of any Python 3.x program that you wrote that does not run in Python 3.10? The only thing I can remember is the Python 2.x to 3.x migration, which was over a decade ago and was well documented with tools to help.

Of course you need to manage dependencies, but that applies to any program that uses a non-trivial number of dependencies. Tools like Poetry and Pipenv are available to take care of this.
« Last Edit: October 13, 2022, 11:58:06 pm by alm »
 

Offline Ed.Kloonk

  • Super Contributor
  • ***
  • Posts: 4000
  • Country: au
  • Cat video aficionado
Re: WTF, software updates breaking all my SW projs in 6 to 12 moths top!
« Reply #26 on: October 14, 2022, 04:43:16 am »
Can you give an example of any Python 3.x program that you wrote that does not run in Python 3.10? The only thing I can remember is the Python 2.x to 3.x migration, which was over a decade ago and was well documented with tools to help.
As someone who drops into Python occasionally and very begrudgingly, the examples all over the web, frankly, are hit and miss when trying to solve a problem by yourself, as a python novice.

Quote
Of course you need to manage dependencies, but that applies to any program that uses a non-trivial number of dependencies. Tools like Poetry and Pipenv are available to take care of this.

At the risk of getting shouted at, if I invest time looking up how to use these depends managers and what not, is the same thing going to happen to these tutes and the tools breaking when Python has again moved on but certain info on the internet hasn't.

I'm not trying to throw shade. I too may find myself in George's shoes some day if I get around to learning Python instead of just using C. Shouldn't these tools be included in the language if it wants to be regarded as a higher level language?

iratus parum formica
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11725
  • Country: my
  • reassessing directives...
Re: WTF, software updates breaking all my SW projs in 6 to 12 moths top!
« Reply #27 on: October 14, 2022, 09:12:19 am »
Of course you need to manage dependencies, but that applies to any program that uses a non-trivial number of dependencies. Tools like Poetry and Pipenv are available to take care of this.
i dont program in python, but there's lecroy dso hack tool scripted in python that i downloaded here. It relies on some encryption library and another one i cant recall... to add the libraries, i have to type command line in console to install them (after i installed python environment) .. from the time taken, i felt its an online install with silent report, no option no version to choose from. Its just wait few seconds and done.. my thinking is that if those libraries are upgraded with no back compatibility in mind, my hack tool can easily break anytime.. i just need to pray and finger cross they will not major upgrade anytime soon.

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3958
  • Country: de
Re: WTF, software updates breaking all my SW projs in 6 to 12 moths top!
« Reply #28 on: October 14, 2022, 09:34:22 am »
Of course you need to manage dependencies, but that applies to any program that uses a non-trivial number of dependencies. Tools like Poetry and Pipenv are available to take care of this.
i dont program in python, but there's lecroy dso hack tool scripted in python that i downloaded here. It relies on some encryption library and another one i cant recall... to add the libraries, i have to type command line in console to install them (after i installed python environment) .. from the time taken, i felt its an online install with silent report, no option no version to choose from. Its just wait few seconds and done.. my thinking is that if those libraries are upgraded with no back compatibility in mind, my hack tool can easily break anytime.. i just need to pray and finger cross they will not major upgrade anytime soon.

Well, but that's a complaint you should take with the author of that tool. That's no fault of Python that the author of that thing doesn't do things right for their users.

Can you give an example of any Python 3.x program that you wrote that does not run in Python 3.10? The only thing I can remember is the Python 2.x to 3.x migration, which was over a decade ago and was well documented with tools to help.
As someone who drops into Python occasionally and very begrudgingly, the examples all over the web, frankly, are hit and miss when trying to solve a problem by yourself, as a python novice.

At the risk of getting shouted at, if I invest time looking up how to use these depends managers and what not, is the same thing going to happen to these tutes and the tools breaking when Python has again moved on but certain info on the internet hasn't.

That's sadly nothing specific or particular to Python. Did you try to follow some Javascript or even C++ tutorials? You will find tons of stuff online that is decades old and won't even compile with current tooling ...
That there is outdated information out there, whether in books or online is a fact of life and not only with computing. As always, it helps to search in the canonical sources (e.g. official Python documentation) first and not just grab whatever snippet from StackOverflow showed up on top in Google.

I'm not trying to throw shade. I too may find myself in George's shoes some day if I get around to learning Python instead of just using C. Shouldn't these tools be included in the language if it wants to be regarded as a higher level language?

That has nothing to do with it being a "higher level language". However, even then, those tools are part of the language installers and are shipped with it.

Pip and virtualenv are all you strictly speaking need to manage dependencies in Python - and both come standard with it even though they are not "included in the language" (similarly like make is not part of C yet it comes with the toolchains). And the documentation and best practices on using them have been around for ages.

Tools that have been mentioned above - poetry, pipenv or pyinstaller are only frontends to pip and virtualenv (the first two) that make the process a bit more convenient for the developer. Pyinstaller is one of the possible bundling utilities to build binaries. There are several. But as building binaries is both platform specific and not part of Python's mission (it is still an interpreted language, after all), I am fine with that being an external tool.

In the future it is possible that something like poetry will get bundled with Python installations by default but Python code packaging (not dependency management) is still a bit of an evolving target ("eggs" vs "wheels" vs setup tools. etc).
« Last Edit: October 14, 2022, 09:45:27 am by janoc »
 
The following users thanked this post: Ed.Kloonk

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11725
  • Country: my
  • reassessing directives...
Re: WTF, software updates breaking all my SW projs in 6 to 12 moths top!
« Reply #29 on: October 14, 2022, 10:00:10 am »
Of course you need to manage dependencies, but that applies to any program that uses a non-trivial number of dependencies. Tools like Poetry and Pipenv are available to take care of this.
i dont program in python, but there's lecroy dso hack tool scripted in python that i downloaded here. It relies on some encryption library and another one i cant recall... to add the libraries, i have to type command line in console to install them (after i installed python environment) .. from the time taken, i felt its an online install with silent report, no option no version to choose from. Its just wait few seconds and done.. my thinking is that if those libraries are upgraded with no back compatibility in mind, my hack tool can easily break anytime.. i just need to pray and finger cross they will not major upgrade anytime soon.
Well, but that's a complaint you should take with the author of that tool. That's no fault of Python that the author of that thing doesn't do things right for their users.
my point is that those libraries should be available for download too so we can make our own version control. so i dont have to blame anybody, not the author, not the library developer not the python.

Offline alm

  • Super Contributor
  • ***
  • Posts: 2903
  • Country: 00
Re: WTF, software updates breaking all my SW projs in 6 to 12 moths top!
« Reply #30 on: October 14, 2022, 11:35:46 am »
I too may find myself in George's shoes some day if I get around to learning Python instead of just using C. Shouldn't these tools be included in the language if it wants to be regarded as a higher level language?
Don't you have the problem with dependencies in C if you include huge, fast-moving external libraries like GTK, ffmpeg, etc? Does GTK 2.x software still run or compile? I remember plenty of problems with dynamic libraries and OS upgrades requiring rebuilding, and sometimes changing, C programs because the interface had changed. Python programs that only use the standard library (which is quite a bit more comprehensive than libc) are also easy to keep running.

I agree that some sort of dependency management / virtual environment management tool like poetry should be included.

i dont program in python, but there's lecroy dso hack tool scripted in python that i downloaded here. It relies on some encryption library and another one i cant recall... to add the libraries, i have to type command line in console to install them (after i installed python environment) .. from the time taken, i felt its an online install with silent report, no option no version to choose from. Its just wait few seconds and done.. my thinking is that if those libraries are upgraded with no back compatibility in mind, my hack tool can easily break anytime.. i just need to pray and finger cross they will not major upgrade anytime soon.

That key gen distribution was purposely obfuscated because of the intellectual property issues, hence the cumbersome installation without proper documentation. The original post said it was developed for Python 2.7.x with PyCrypto. This is a Python version from a decade ago, but you can still download it from the Python.org website (see the link I posted above). Same with the PyCrypto module. PyCrypto didn't become incompatible, but was discontinued and PyCryptodome came in its place. It's compatible, and you can replace the Crypto import by Cryptodome and make some other changes to get it working with Python 3. Admittedly those changes are a bit more complicated for this than for most programs, because it does byte-level string manipulation which is one of the things that changed with Python 3 due to the switch to unicode by default. But nothing prevents you from downloading Python 2.7.x and keep using that.

my point is that those libraries should be available for download too so we can make our own version control. so i dont have to blame anybody, not the author, not the library developer not the python.
If I search for PyCrypto with Google, I find this and from there this homepage, both of which contain download links for the almost-a-decade-old libraries. Which libraries are not available for download?
 
The following users thanked this post: Mechatrommer

Offline Ed.Kloonk

  • Super Contributor
  • ***
  • Posts: 4000
  • Country: au
  • Cat video aficionado
Re: WTF, software updates breaking all my SW projs in 6 to 12 moths top!
« Reply #31 on: October 14, 2022, 12:46:30 pm »
Don't you have the problem with dependencies in C if you include huge, fast-moving external libraries like GTK, ffmpeg, etc? Does GTK 2.x software still run or compile? I remember plenty of problems with dynamic libraries and OS upgrades requiring rebuilding, and sometimes changing, C programs because the interface had changed. Python programs that only use the standard library (which is quite a bit more comprehensive than libc) are also easy to keep running.
I only do very simple console stuff in C, though in the past year I've gotten a lot of help embracing simple, but effective GUI.  :)

Yeah, on other platforms (arm?) my own code might well bork cos I'm very lazy with variable types and endiness. Oh well.

Most of the time the source build tools and scripts are quite good that the ./configure script tells you which header file is missing and more often than not, what range of version it was really hoping for. I was using the same code for XMMS for 17 years or something. The distro maintainers are top notch though which helps in that you just bring in the dev packages your exotic source code asks for.

The point is, though, I expect push back from a compiler, but not an interpreter. Or am I being too harsh?

Edit:  ./configure not MAKE
« Last Edit: October 14, 2022, 12:56:19 pm by Ed.Kloonk »
iratus parum formica
 

Offline 50ShadesOfDirt

  • Regular Contributor
  • *
  • Posts: 111
  • Country: us
Re: WTF, software updates breaking all my SW projs in 6 to 12 moths top!
« Reply #32 on: October 14, 2022, 12:54:45 pm »
As others have mentioned, the idea is to "freeze" the environment, such that if you start it a year from now, it is the same as it was then. A "thought exercise" then, on how to do this ...

I would:
  - use VirtualBox (whether on Windows/Linux, doesn't matter)
  - build, for example, a Windows VM with the current set of updates, and with all your desired software components
  - freeze it, with a program like "Deep Freeze, by Faronics"; this would avoid any future updates to any of the Windows pieces (windows OS itself, your software components, etc) inside the VM.
  - save the vm disk file into your catalog of years/projects
  - additionally, use Macrium Reflect (free windows backup program) to create an image of the entire VM os and software, inside the vm, for a 2nd fallback.

At this point, nothing should change a year later, as Deep Freeze always sets it back to pristine start on reboot. It doesn't allow anything, even windows os updates, to take place. You could, with more effort, replace Deep Freeze with an imaging tool.

As further insurance for the host os that runs the vbox environment, as vbox might change over the years, use macrium (or any imaging tool of your choice) to capture the host os running the vbox environment as well.

You might also want to set aside a PC/Laptop from nearby years for the host os, or sort through vbox changes if you put a newer pc/laptop in place. Saving a pc from every 5 to 10 years ought to do it (complete mobo, cpu/ram, power supply, all internal drives ... don't need the entire pc shell).

Macrium is both a backup tool and an imaging tool, so before you think this is getting too circular, you can substitute any imaging tool, if you think another one has a better way of preserving file formats over the years. But, basically, if Macrium changes, you'll just restore each item in your catalog with the old macrium, image it with the new Macrium, and throw it back in the catalog.

I *think* I've covered all possible changes that might occur, at any point in the chain ... it is a thought exercise.

This process works for me when preserving ancient os's from decades past (dos, os/2, lan manager, netware, etc), and then pulling them out and running again for a bit. Can't yet see why it wouldn't work for this thread's premise as well.
 

Offline alm

  • Super Contributor
  • ***
  • Posts: 2903
  • Country: 00
Re: WTF, software updates breaking all my SW projs in 6 to 12 moths top!
« Reply #33 on: October 14, 2022, 01:01:59 pm »
Most of the time the source build tools and scripts are quite good that MAKE tells you which header file is missing and more often than not, what range of version it was really hoping for. I was using the same code for XMMS for 17 years or something. The distro maintainers are top notch though which helps in that you just bring in the dev packages your exotic source code asks for.

The point is, though, I expect push back from a compiler, but not an interpreter. Or am I being too harsh?
Linux distributions do package Python packages, for example I installed the PyCryptodome cryptography library for the scripts Mechatrommer mentioned in Ubuntu using apt install python3-pycryptodome. But the more obscure may not be there, and if you want the very latest version, that's probably also not available through your distribution. To be able to guarantee the same version on different operating systems and versions, Python programs will often install dependencies outside the OS. The Python package manager pip and wrappers around pip like pipenv and Poetry can be used to manage this. Obviously this does not apply by Python programs shipped as OS packages, which will depend on other packages just like any programming language.

Compilers and modern interpreters aren't that different, in that both will parse the code in some intermediate representation, but compilers will then translate this to machine code and generate a binary, while interpreters will run this byte code on a virtual machine. So the problems they encounter with language versions (K&R C, ANSI C/C89, C99, etc) and dependencies that need to be present and have a compatible version are actually quite similar.

One thing that is annoying about Python is that modules are installed in a directory for that specific minor version. So if you install Python 3.9, install a library, and then upgrade to Python 3.10 (for example an OS upgrade), that library won't be available in Python 3.10 until you reinstall. That's why I suggested either using a tool like pyenv to keep the Python version in your project independent from the system Python version, or using a tool like pipenv or Poetry that can reinstall all packages with the new Python version with minimal effort.

As others have mentioned, the idea is to "freeze" the environment, such that if you start it a year from now, it is the same as it was then. A "thought exercise" then, on how to do this ...

I would:
  - use VirtualBox (whether on Windows/Linux, doesn't matter)
[...]
Cuda is something that makes this a bit more complicated (you have to set up some sort of pass-thru, and hope this path-thru does not rely on compatible driver versions). I would like to add that to ease maintenance you ideally want to freeze as small an area as possible. Just like you wouldn't freeze your entire house to keep some frozen vegetables fresh. I gave some guidelines for that in an earlier post.

Offline Ed.Kloonk

  • Super Contributor
  • ***
  • Posts: 4000
  • Country: au
  • Cat video aficionado
Re: WTF, software updates breaking all my SW projs in 6 to 12 moths top!
« Reply #34 on: October 14, 2022, 01:02:11 pm »


I *think* I've covered all possible changes that might occur, at any point in the chain ... it is a thought exercise.


As I said above, you can snapshot the daylights out of VBox. This alleviates the inevitable crunch time when you realize the sanctuary is antiquated and want to update the underlying system.
iratus parum formica
 

Offline Ed.Kloonk

  • Super Contributor
  • ***
  • Posts: 4000
  • Country: au
  • Cat video aficionado
Re: WTF, software updates breaking all my SW projs in 6 to 12 moths top!
« Reply #35 on: October 14, 2022, 01:13:14 pm »
Also, you don't have to virtualize. There is timeshift and/or BTRfs, if set up properly can aid in walking back lots of system randomness.

I don't use them though. I'll reinstall the same way I'll get a new car because the ash tray is full.
iratus parum formica
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 6110
  • Country: nl
Re: WTF, software updates breaking all my SW projs in 6 to 12 moths top!
« Reply #36 on: October 14, 2022, 01:16:56 pm »
... I'll get a new car because the ash tray is full.

Best not to smoke then :-DD Modern cars might not even have an ash tray anymore >:D

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11725
  • Country: my
  • reassessing directives...
Re: WTF, software updates breaking all my SW projs in 6 to 12 moths top!
« Reply #37 on: October 14, 2022, 02:52:54 pm »
i dont mind modern car as long as i know how to open the window and commit the ashes to the air... i dont have time to learn python's mechanics, i'll learn as i encounter problem later. that pycryptodome may not be available in the next 2-5 years maybe they will rename to fancier name such as pycryptotray who knows. anyway thanks alm for the tips and chiming in that lecroy's thread.

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3958
  • Country: de
Re: WTF, software updates breaking all my SW projs in 6 to 12 moths top!
« Reply #38 on: October 14, 2022, 08:55:48 pm »
my point is that those libraries should be available for download too so we can make our own version control. so i dont have to blame anybody, not the author, not the library developer not the python.

Since you ran some commands from the console to install them, they are by definition available for download. Nothing prevents you from backing them up, ideally along with the rest of your system because they may have their own dependencies. Or get their source code so that you can compile them in the future.
« Last Edit: October 14, 2022, 08:59:05 pm by janoc »
 

Offline alm

  • Super Contributor
  • ***
  • Posts: 2903
  • Country: 00
Re: WTF, software updates breaking all my SW projs in 6 to 12 moths top!
« Reply #39 on: October 14, 2022, 09:37:24 pm »
i dont mind modern car as long as i know how to open the window and commit the ashes to the air... i dont have time to learn python's mechanics, i'll learn as i encounter problem later. that pycryptodome may not be available in the next 2-5 years maybe they will rename to fancier name such as pycryptotray who knows. anyway thanks alm for the tips and chiming in that lecroy's thread.
Which Python module did you find that is not available anymore? I showed you links to download PyCrypto. Links to Python going back to 2001. You seem to imagine problems that don't actually exist.

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11725
  • Country: my
  • reassessing directives...
Re: WTF, software updates breaking all my SW projs in 6 to 12 moths top!
« Reply #40 on: October 15, 2022, 07:05:15 am »
i dont mind modern car as long as i know how to open the window and commit the ashes to the air... i dont have time to learn python's mechanics, i'll learn as i encounter problem later. that pycryptodome may not be available in the next 2-5 years maybe they will rename to fancier name such as pycryptotray who knows. anyway thanks alm for the tips and chiming in that lecroy's thread.
Which Python module did you find that is not available anymore? I showed you links to download PyCrypto. Links to Python going back to 2001. You seem to imagine problems that don't actually exist.
i havent tried yet. maybe later when i do lecroy hack again, the older Python installer is now dormant in my external storage... you mentioned it yourself that the original pyCrypto is not available anymore (replaced with pyCryptoDome?), i'm not sure if its a problem or not, but i'm guessing a possibility (expect the worst so i can prepare at least mentally later) but if its no problem, then its no issue. cheers.

Offline alm

  • Super Contributor
  • ***
  • Posts: 2903
  • Country: 00
Re: WTF, software updates breaking all my SW projs in 6 to 12 moths top!
« Reply #41 on: October 15, 2022, 09:13:55 am »
you mentioned it yourself that the original pyCrypto is not available anymore (replaced with pyCryptoDome?), i'm not sure if its a problem or not, but i'm guessing a possibility (expect the worst so i can prepare at least mentally later) but if its no problem, then its no issue. cheers.
No, I said that PyCrypto was discontinued: it's no longer maintained or recommended to be used. But it's still available for download. I already gave you the links. You can download it in your archive.

It has a compatible successor PyCryptodome that you can use if you want to run the script in Python 3, like I did. But you can also still download and run Python 2 and PyCrypto.
 
The following users thanked this post: Mechatrommer


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->