www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Diva - D Language Interface for Versioned Applications

reply pineapple <meapineapple gmail.com> writes:
Basically, it's a version manager which currently supports DMD, 
LDC, and dub.

It's rough, but maybe in some ways a little less rough than 
install.sh, at https://dlang.org/install.html

https://github.com/pineapplemachine/diva
Jul 09
parent reply Bastiaan Veelo <Bastiaan Veelo.net> writes:
On Friday, 9 July 2021 at 23:59:55 UTC, pineapple wrote:
 Basically, it's a version manager which currently supports DMD, 
 LDC, and dub.

 It's rough, but maybe in some ways a little less rough than 
 install.sh, at https://dlang.org/install.html

 https://github.com/pineapplemachine/diva
Could it be that you have overlooked D Version Manager? https://code.dlang.org/packages/dvm — Bastiaan.
Jul 10
parent reply pineapple <meapineapple gmail.com> writes:
On Saturday, 10 July 2021 at 08:42:46 UTC, Bastiaan Veelo wrote:
 Could it be that you have overlooked D Version Manager? 
 https://code.dlang.org/packages/dvm

 — Bastiaan.
Oh, I hadn't picked up on that. That only manages DMD, though. Diva can manage DMD and LDC, as well as managing dub separately if you want it to. Personally I'll be using Diva in the future to manage my installations.
Jul 10
parent reply Bastiaan Veelo <Bastiaan Veelo.net> writes:
On Saturday, 10 July 2021 at 11:29:21 UTC, pineapple wrote:
 On Saturday, 10 July 2021 at 08:42:46 UTC, Bastiaan Veelo wrote:
 Could it be that you have overlooked D Version Manager? 
 https://code.dlang.org/packages/dvm

 — Bastiaan.
Oh, I hadn't picked up on that. That only manages DMD, though. Diva can manage DMD and LDC, as well as managing dub separately if you want it to. Personally I'll be using Diva in the future to manage my installations.
Thanks for clarifying the differences. — Bastiaan.
Jul 10
parent reply Jacob Carlborg <doob me.com> writes:
On Saturday, 10 July 2021 at 12:30:43 UTC, Bastiaan Veelo wrote:

 Thanks for clarifying the differences.
Some other differences: * DVM is cross-platform. Diva seems to only run on Ubuntu. * DVM is implemented in D (with a tiny shell script wrapper). Diva depends on Python * DVM does not use symlinks. When invoking the compiler it's the actual executable that's invoked directly * DVM provides a built-in command to install itself and do any setup -- /Jacob Carlborg
Jul 11
parent pineapple <meapineapple gmail.com> writes:
On Sunday, 11 July 2021 at 13:39:15 UTC, Jacob Carlborg wrote:
 Some other differences:

 * DVM is cross-platform. Diva seems to only run on Ubuntu.
 * DVM is implemented in D (with a tiny shell script wrapper). 
 Diva depends on Python
 * DVM does not use symlinks. When invoking the compiler it's 
 the actual executable that's invoked directly
 * DVM provides a built-in command to install itself and do any 
 setup

 --
 /Jacob Carlborg
Fair points here. It's stated in the readme but just to be really clear: I wrote this mainly for my own use. It may or may not work for you out-of-the-box. I put it on GitHub with an MIT license in case it might be useful to others. It's definitely not a polished production-ready piece of software.
 * DVM is cross-platform. Diva seems to only run on Ubuntu.
Well, not exactly. I wrote Diva in a couple of evenings this past week and I haven't had an opportunity to test it on other platforms than Ubuntu so far. I'm confident it will work with other Linux distros (though it might have problems on ARM platforms; it can't build DMD or LDC from source yet which means if there's not a prebuilt binary then Diva can't help you) and I'm reasonably sure it will work with MacOS without any changes. There's a fair chance it will break down on Windows. Even though there's some logic specifically to try to handle Windows, I just haven't tested it yet. If you want to use it on your platform and run into difficulties, the script is fairly simple and fairly well documented and so hopefully feasible to troubleshoot things for yourself. I'm happy to accept a PR if you find and fix issues like this.
 * DVM is implemented in D (with a tiny shell script wrapper). 
 Diva depends on Python
Yep. It was faster for me to write it in Python. I'm personally much more familiar with Python's tools for making HTTP requests and for extracting compressed archives than I am with D's, and my goal here was to just have something usable for myself in little time. If someone wanted to rewrite Diva in D and make sure there's a handy script to bootstrap it if a D compiler isn't already locally available, that would be fantastic.
 * DVM does not use symlinks. When invoking the compiler it's 
 the actual executable that's invoked directly
Yep, symlinking is a fairly standard way to handle this sort of thing, and it's how I wanted to do it on my system. If you prefer to do it differently on your system, you could take Diva's downloading and installation system as a starting point and revise its "use"/"disuse" logic. If it's compatible/configuration-switchable with the symlink implementation, I'd be happy to accept a PR that added this sort of thing.
 * DVM provides a built-in command to install itself and do any 
 setup
Yep, the Diva install process is very slightly more complicated in that you will have to find your bashrc (or equivalent) on your own after using `pip install .` and paste a few lines in according to the instructions in the readme.
Jul 11