#LDC version manager (ldcup)

1 messages · Page 1 of 1 (latest)

boreal dawn
brazen knoll
#

Nice!

#

Is this not on the registry?

#

I think there needs to be a way to run this from scratch. If I understand correctly, rustup has a bootstrapping curl line that will get it started.

boreal dawn
# brazen knoll I think there needs to be a way to run this from scratch. If I understand correc...

Yeah, it's assigned to rustup-init.sh.

The current status for ldcup is similar (in concept) to zigup by John Marler.

I was even reading dlang's official install.sh script and added something like that to generate the activation scripts.

# on linux (my host) test
➜  ldcup git:(main) ./bin/ldcup list --install-dir=$HOME/.ldc
["ldc2-6158df28", "ldc2-1.40.0"]
➜  ~ cd $HOME
➜  ~ ls .ldc/ldc2-1.40.0/           
activation  ldc2-1.40.0-linux-x86_64
➜  ~ ls .ldc/ldc2-1.40.0/activation/   
activate.bat  activate.fish  activate.sh
➜  ~ cat .ldc/ldc2-1.40.0/activation/activate.sh
#!/bin/bash
                export PATH="$PATH:/home/kassane/.ldc/ldc2-1.40.0/ldc2-1.40.0-linux-x86_64/bin"
                export DC_PATH=/home/kassane/.ldc/ldc2-1.40.0/ldc2-1.40.0-linux-x86_64
                %  
➜  ~ source $HOME/.ldc/ldc2-1.40.0/activation/activate.sh
➜  ~ ldc2 --version | head -n 3
LDC - the LLVM D compiler (1.40.0):
  based on DMD v2.110.0 and LLVM 19.1.3
  built with LDC - the LLVM D compiler (1.40.0)
brazen knoll
#

Yeah, so I ran the install, and it doesn't tell me how to use it, so I couldn't find out how to call ldc2 or whatnot...

brazen knoll
#

I still don't know where it is. the .ldc directory did not appear...

#

OK, I found it is in ~/.dlang. But the activate script doesn't override existing ldc2 path. I would recommend putting $PATH last, so it will replace any existing ldc2 you have in your path.

boreal dawn
#

I was thinking about prefixing a directory through an environment variable to be listed or creating a configuration file showing the current directory.

boreal dawn
boreal dawn
#

version 1.0.2, added shell detector and set on config-file (like .bashrc) exported PATH.

boreal dawn
#

Version 1.0.3 released.

boreal dawn
#

version 1.0.5 - install scripts added (powershell and shell)

boreal dawn
#

v1.0.6 - add FreeBSD(amd64) & Linux(arm64/aarch64) support w/ zip tarballs in releases

boreal dawn
#

v1.0.7 - alpine tarballs support and get non-host tarballs using --platform=<os>-<arch>

boreal dawn
#

latest v1.0.9 minor bug fixes for cross-tarballs

brazen knoll
#

OK, tried this again, and it seems to be working! A couple things: .bashrc did not work because I use .bash_profile. Also, I like the activation system that the dlang install.sh script does. Any chance you can clone that thing? Basically, you do . ~/.dlang/ldc-1.40.0/activate and it edits your path to use the correct bin. Then when you activate a different version, it deactivates the original (by removing the path). It also adds a nice message to the prompt to remind you which compiler is active.

boreal dawn
#

Thanks for the feedback.

A couple things: .bashrc did not work because I use .bash_profile.

Got it!

Also, I like the activation system that the dlang install.sh script does. Any chance you can clone that thing?

Previous version (v1.0.1) offered the option of generating activation scripts, which was subsequently removed by the system's shell detector. (dropped in v1.0.2)
check: https://github.com/kassane/ldcup/commit/86c63a311b81be7d250698dbfc01ae4294711ae9
However, it is possible to get this functionality back again. Compatibility assurance with supported shells.

Please, open an issue describing your experience with the application and suggestions for corrections (if interested).

#

Recently, I've been looking into the possibility of using symbolic links in master/nightly versions to rename folder path (like, zigup - rename zig-master-<hash> to master). If the user doesn't have the habit of checking ldcup list and tries to uninstall ldcup uninstall ldc2-<latest|master|nightly>, will surely get an error.
However, this is just a hypothetical idea. I'd need time to think about it, in case I don't get any feedback to contribute.

boreal dawn
#

version 1.1.0 - Add redub support (download releases and install in compilerPath).
Note: FreeBSD and Android no support yet - missing gh-release tarball.
cc: @barren vapor

barren vapor
boreal dawn
#

New version cleaned. Improvement msg errors

boreal dawn
#

v1.1.5 - tarballs updated:

  • win11-arm64 added
  • ubuntu 24.04 to 22.04
  • freeBSD 14.2 to 14.3