Feral-Lang/Feral

Add my installer script to README.md

ImMaax opened this issue ยท 15 comments

Hi :)
Even though building Feral isn't too hard, I've created an installer script that builds Feral and its standard library automatically.
I thought it may be a good idea to add it to README.md as an alternative installation option, especially for people who just want to get started real quick.

Or better yet, why don't you create a PR for it and I'll add it to the repository itself. ๐Ÿ˜„
Of course, I'll give you the credits for writing it ๐Ÿ˜

Btw, the script is macOS specific (which is fine, can be extended later), and you might wanna merge the 3 brew install commands into a single one ๐Ÿ˜‰

Also, if this script can be extended for Linux and BSD, I would actually like to use this in the CI system instead of having to write so many commands ๐Ÿค”.

Thanks a lot for the work you did! โค๏ธ

@Electrux it should run just fine on other *nix systems too. I've only tested it on macOS 10.14 Mojave, but I'll test it on Debian 10 too.
I'll do the PR just after that.

Okay sure, thanks!
Btw, brew is used mainly with macOS systems only.
For example, Debian (and based) OS uses apt for package management.
Anyway, thank you very much for this ๐Ÿ˜

I know that it's mainly used with macOS and that Debian uses Aptitude, but Homebrew should run just fine on Debian too...

Technically, yes it should ๐Ÿค”
Oh well, please comment when you are done :)

The script seems to fail on Debian, I have no idea why, though. The problem is not with Homebrew. I'll probably look into this in the coming days.
Should I still PR? I'd add a note that it has only been successfully tested with macOS.

Could you tell/show me the error that came up?
If we are going to have it as the first option in installation section, we'll need to ensure it works on Linux, BSD, as well as macOS. ๐Ÿค”
And, since the installer is still building from source (internally), a better title perhaps would be Automated Build from Source.

That seems to be the task where it fails:

[INFO] Creating temporary directory at ~/.feral-installer...
./feralinstaller.sh: 22: cd: can't cd to ./feralinstaller.sh

Line 22:

mkdir ~/.feral-installer && cd $_

well, perhaps use

mkdir ~/.feral-installer && cd ~/.feral-installer

instead?

That actually seems to be the problem! It seems like $_ was still set to the last parameter the user entered, which, in my case, was feralinstaller.sh. Changing that works fine.
I'm getting another error, though:

CMake Error at CMakeLists.txt:39 (find_package):
  By not providing "FindMPFR.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "MPFR", but
  CMake did not find one.

  Could not find a package configuration file provided by "MPFR" with any of
  the following names:

    MPFRConfig.cmake
    mpfr-config.cmake

  Add the installation prefix of "MPFR" to CMAKE_PREFIX_PATH or set
  "MPFR_DIR" to a directory containing one of the above files.  If "MPFR"
  provides a separate development package or SDK, be sure it has been
  installed.


-- Configuring incomplete, errors occurred!

I've tried installing it using Homebrew and using the default package sources of Aptitude, but it doesn't seem to work.
I've uploaded the CMake error log to my server.

Weird, I just removed the brew part and ran the script on a machine with Arch Linux. It worked just fine ๐Ÿค”

Let me fire up a docker container for Debian and see if it works there. In any case, we cannot rely only on brew. So we should either remove the brew part entirely (leaving the user to download the packages themselves), or write distribution specific commands for downloading the packages. I'd vote for the first option personally as there are way too many distributions to write commands for. What do you think?

That's probably the best solution at this point.
I think it would be an option to include extra install scripts in the future (a Homebrew one, an Aptitude one, ...).
I would close the current PR and open a new one with the install script excluding the dependency installation process.

Okay I think I found the issue with that. In this particular case, I think you don't have sudo command because of which the make install command is failing, and the FindMPFR.cmake file is not being installed. Due to that, Feral-Std is unable to find that file which is why it fails to build.
I wonder if I can perhaps remove that dependency between Feral and Feral-Std though.
Doing some more tests for that.
Thanks for pointing that out ๐Ÿ˜