3

I am starting out with F# and trying to get it to work with Sublime Text 3 with a package, https://github.com/fsharp/sublime-fsharp-package. After installing the package using Package Control, I see F# appear as an available language to use in Sublime Text's bottom bar, and syntax highlighting appears to work more or less, from what I can tell, but the build system for F# fails to appear as it should.

So, trying to fix things, I run "build.sh install" and get an error, "Cannot open assembly '.paket/paket.bootstrapper.exe': No such file or directory." I am sort of stuck. Many thanks for any help.

wander
  • 85
  • 5
  • Which directory were you in when you ran `build.sh install`? Also, I looked at the https://github.com/fsharp/sublime-fsharp-package build script, and it has a build target named `Install` (capital I), not `install`. – rmunn Jun 25 '17 at 06:19
  • 3
    The `paket.bootstrapper.exe` file should have been included with the `sublime-fsharp-package`. But if it wasn't, you can download it from https://github.com/fsprojects/Paket/releases/latest (you can also grab the `paket.exe` file directly while you're there; the bootstrapper's only job is to download `paket.exe` and verify that it has a correct checksum). Both files are expected to live in a `.paket` directory in the root of the project folder. – rmunn Jun 25 '17 at 06:21
  • Sorry, the error I described occurs when I manually download and unarchive the package to /Users/Username/Library/Application\ Support/Sublime\ Text\ 3/Packages/. In terminal, the command I ran then was `/Users/Username/Library/Application\ Support/Sublime\ Text\ 3/Packages/sublime-fsharp-package-master/build.sh install`. When using Package Control as an alternative way, the package installs itself in a different directory, ".../Application\ Support/Sublime\ Text\ 3/Installed\ Packages/sublime-fsharp-package.sublime-package," and `./build.sh install` gives "No such file or directory." – wander Jun 25 '17 at 21:18
  • I should also mention this seems to be related to Paket's installation. I ran git clone https://github.com/fsprojects/Paket.git, which cloned into "/Users/Username/Paket," but failed to include the .paket and .github directories, as Finder tells me directories beginning with "." are reserved for the system. – wander Jun 25 '17 at 22:40
  • Just posted a long answer, but I think I could have answered it in a 600-character comment. I think your problem was that you needed to do `cd /Users/Username/Library/Application\ Support/Sublime\ Text\ 3/Packages/sublime-fsharp-package-master` first, and *then* run `./build.sh Install`. Leaving out the `cd` was, I think, the root cause of your problem. – rmunn Jun 26 '17 at 02:47

1 Answers1

3

From the comments you've made, you appear to be a little unfamiliar with the Unix underpinnings of OS X. I'll explain those first, then I'll suggest something for you to try that may fix your problem.

Technically, files or directories whose name starts with . are not "reserved for the system" as you put it; they're hidden. Now, it's true that Finder won't allow you to create files or directories whose name starts with ., because Apple didn't want to have to field all the tech-support calls from people who didn't know about the hidden-files feature: "I named my file ... more important stuff for work and now it's gone! Help!!!" But if you're in the Terminal app, then you can easily create files or directories with . as their first letter: mkdir .foo should work. You won't see it when you do ls, but ls -a (a for "all") will show you all files, including hidden files. And you can also do cd .foo and create files inside the hidden .foo directory -- and while the .foo folder won't show up in Finder, it will be perfectly accessible in the Terminal, and to any F# programs you might write.

So when you say that you cloned https://github.com/fsprojects/Paket but it failed to include the .github and .paket directories, I think you just don't know how to see them. You can't see them in the Finder (well, you can if you jump through a couple of hoops but I don't think it's worth the effort), but you can see them with ls -a. Just open your terminal, run cd /Users/Username/Paket, and then run ls -a and I think you'll see that the .paket and .github directories were indeed created by your git clone command.

So what you should probably try is this:

  1. Go to https://github.com/fsprojects/Paket/releases/latest
  2. Download the paket.bootstrapper.exe and paket.exe files. Put them in /Users/Username/Downloads (or wherever the default OS X Downloads directory is if it's different -- just as long as it's somewhere where you can find them easily).
  3. Open the Terminal app.
  4. Go to the directory where you've unpacked the Sublime Text 3 package. I.e., in the Terminal app, run cd /Users/Username/Library/Application\ Support/Sublime\ Text\ 3/Packages/sublime-fsharp-package-master.
  5. Run ls -a and see if there's a .paket directory.
  6. If it does not exist, run mkdir .paket.
  7. Now do cd .paket so you're in the hidden .paket directory under sublime-fsharp-package-master.
  8. Now do ls and see if there's a paket.bootstrapper.exe file.
  9. If it doesn't exist, then copy in the .exe files you downloaded earlier:
    1. cp /Users/Username/Downloads/paket.bootstrapper.exe .
    2. cp /Users/Username/Downloads/paket.exe .
  10. Important: Now do cd .. to go back up to the /Users/Username/Library/Application\ Support/Sublime\ Text\ 3/Packages/sublime-fsharp-package-master/ directory.
  11. Now instead of running /Users/Username/Library/Application\ Support/Sublime\ Text\ 3/Packages/sublime-fsharp-package-master/build.sh install, try running it as ./build.sh install. (And also try ./build.sh Install, since I'm pretty sure the capital I is necessary).

(BTW, If you're not familiar with the syntax that I used in steps 9, 10 and 11, where I used a single . or two dots .. in commands, those are a long-standing Unix idiom: . means "the current directory", and .. means "the parent directory".)

I just looked at the build.sh script that you've been running, and it seems to assume that you've done a cd into the package's base directory (the sublime-fsharp-package-master directory) before running the script. So that could explain why it was failing: you were running it from a different directory, rather than doing a cd first. Hence why I marked step 10 as important: I think that was the root cause of the problem.

rmunn
  • 34,942
  • 10
  • 74
  • 105
  • Oh, I see – thank you. You're right, I had a feeling I was making an elementary mistake. `./build.sh install` works like a charm inside the package directory. On a somewhat separate note, for the record, I'm now getting two F# options in Sublime Text, weirdly enough, and there still is no F# build system. The package's Github folks say the package is a mess, so I'm thinking switching to Visual Studio/Visual Studio Code is probably a better bet at this point – would you agree? – wander Jun 26 '17 at 06:09
  • 1
    The Ionide-fsharp plugin for VS Code is actively maintained, whereas the last commit to https://github.com/fsharp/sublime-fsharp-package was over a year and a half ago. So while I can't compare the two from personal experience as I've never used Sublime Text, I think VS Code + Ionide is probably going to give you a better experience. (BTW, in addition to the main Ionide-fsharp plugin for VS Code, you'll also want to install the Ionide-Paket and Ionide-FAKE plugins, as they provide integration for the widely-used Paket and FAKE tools.) – rmunn Jun 26 '17 at 06:43
  • 1
    P.S. I suspect that the two F# options you're seeing in Sublime Text are because you tried two different ways of installing it: one by cloning the Github repo and running `./build.sh install`, and the second one by installing the package via Package Control. I suspect that both of them got registered as separate packages, and that you can remove one of them safely without losing F# integration. Though that will be a moot point if you switch to VS Code. – rmunn Jun 26 '17 at 06:45