hamler
hamler copied to clipboard
Set custom lib directory - Creation of asdf-hamler
Hello,
I've created a recipe for the asdf version manager as you can find here.
ASDF would allow us to use multiple versions of hamler at the same time in different directories. You can read more about ASDF in their website.
However I couldn't figure out how to deal with the lib
directory that is required in the installation. Specifically /usr/lib/hamler
for Linux and /usr/local/lib/hamler
for OSX.
I need to somehow tell hamler that it should look for the lib
directory in another path.
Each installation will point to a lib
directory, that's needed to avoid having hamler 0.1
using the 0.2.1
library for example.
Is there a way I can do that already? Something like setting an environment variable or something similar?
BTW: The idea behind Hamler is amazing! Keep up the amazing work!
Hi, @scudelletti
Thank you very much for your attention to hamler.
When building hamler, you can modify the lib path of hamler by setting the environment variable HAMLER_HOME
. Can this achieve your goal?
Looking forward to your reply
Hi @zhanghongtong, thank you for the reply and for your time.
I'm currently installing the binary instead of building the whole project to avoid having dependencies such as haskell stack. It's a recipe quite similar to the homebrew and the linux installation guide.
I was thinking about installing it a folder inside ASDF_DATA_DIR
environment variable so the whole installation would be in the same folder and the user would be able to configure it.
Hi, @scudelletti
Do you think we should distinguish lib path by version number? I'm not sure if this is correct
Or we can soft link different versions of lib path to /usr/lib/hamler
?
I currently soft link the /usr/lib/hamler
(here and here) and that works until someone decides to have 2 different hamler versions active at the same time.
Example: Terminal 1
cd ~/projects/hello-world-hamler
asdf local hamler 0.2.1
hamler repl
Terminal 2:
cd ~/projects/hamler-example
asdf local hamler 0.1
hamler repl
Both terminal 1 and 2 are running repl
at the same time however they rely in different lib directories. So linking /usr/lib/hamler
directly won't work.
Also ASDF documentation suggests that we install all files of a specific version in a single place, so would be nice to have the binary installed beside the lib directory. That structure is exactly the current structure of the tar
file.
If possible the script should only place files in the ASDF_INSTALL_PATH directory once the build and installation of the tool is deemed successful by the install script. Quote from ASDF documentation
I was thinking about having something like HAMLER_HOME
/HAMLER_LIB
or something similar which would be used during runtime when and only if it is set.
I believe ruby has something similar with an environment variable called RUBYLIB
. More info: https://stackoverflow.com/a/901109/1464792
CC @EMQ-YangM
Can hamler
dynamically set the lib path at runtime?
@scudelletti I can add a HAMLER_HOME environment variable. You can use this environment variable to specify the location of the hamler library file. Do you think this can solve your problem? #425
@EMQ-YangM That's perfect! 🎉 🎊
Thank you both!
@scudelletti We released a new version. This may help you.