C Visual Studio Code

I've been successfully using Visual Studio Code on Linux and Windows and I assume Mac works as well.

I've seen instructions to compile it on raspbian, but it did not work for me.

So, I'd love to compile Visual Studio Code on FreeBSD 11. If anybody has instructions I would gladly try it.

IMO VSC has become on of the best modern emacs/vim and even IDE replacements.

Thank you
 
It popped up a few times here since it was released but I don't think anybody is working on it. If you have some experience building it on Linux you could have a go at it yourself. Install its dependencies using the normal FreeBSD packages and see how for you can get. Once you get it to build properly you can start creating a port for it. The actual porting is relatively easy, figuring out how to build it without errors is probably going to take most of the time.
 
I tried on TrueOS (Current). A node.js package (npm) called electron is failing to install. The toolchain is quite unfamiliar to me so I can't say too much more. There is no binary download for electron for FreeBSD apparently (shock!). Steps:

Requirements as used from pkg:
  • python 2.7
  • node 7.10
  • npm 4.5
Code:
cd /storage/russellh/Git
git clone https://github.com/microsoft/vscode

./scripts/npm.sh -> change shebang

Full build output is here: https://pastebin.com/F08zbncB

This is the error at the bottom of the VSCode build:

Code:
115137 verbose stack Error: electron-mksnapshot@1.7.1 install: `node ./download-mksnapshot.js`
115137 verbose stack Exit status 1
115137 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
115137 verbose stack     at emitTwo (events.js:106:13)
115137 verbose stack     at EventEmitter.emit (events.js:194:7)
115137 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
115137 verbose stack     at emitTwo (events.js:106:13)
115137 verbose stack     at ChildProcess.emit (events.js:194:7)
115137 verbose stack     at maybeClose (internal/child_process.js:899:16)
115137 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
115138 verbose pkgid electron-mksnapshot@1.7.1
115139 verbose cwd /storage/russellh/Git/vscode
115140 verbose FreeBSD 12.0-CURRENT
115141 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--arch=x64"
115142 verbose node v7.10.0
115143 verbose npm  v4.5.0
115144 error code ELIFECYCLE
115145 error errno 1
115146 error electron-mksnapshot@1.7.1 install: `node ./download-mksnapshot.js`
115146 error Exit status 1
115147 error Failed at the electron-mksnapshot@1.7.1 install script 'node ./download-mksnapshot.js'.
115147 error Make sure you have the latest version of node.js and npm installed.
115147 error If you do, this is most likely a problem with the electron-mksnapshot package,
115147 error not with npm itself.
115147 error Tell the author that this fails on your system:
115147 error     node ./download-mksnapshot.js
115147 error You can get information on how to open an issue for this project with:
115147 error     npm bugs electron-mksnapshot
115147 error Or if that isn't available, you can get their info via:
115147 error     npm owner ls electron-mksnapshot
115147 error There is likely additional logging output above.
115148 verbose exit [ 1, true ]


This is the result of trying to install electron outside the VSCode build. The error is explicit and the I checked, there is no file. :(

Code:
russellh@prescott:/storage/russellh/Git/vscode% npm install electron
> electron@1.7.9 postinstall /storage/russellh/Git/vscode/node_modules/electron
> node install.js /storage/russellh/Git/vscode/node_modules/electron/install.js:48
  throw err
  ^
Error: Failed to find Electron v1.7.9 for freebsd-x64 at https://github.com/electron/electron/releases/download/v1.7.9/electron-v1.7.9-freebsd-x64.zip
    at Request.<anonymous> (/storage/russellh/Git/vscode/node_modules/nugget/index.js:169:61)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:191:7)
    at Request.onRequestResponse (/storage/russellh/Git/vscode/node_modules/nugget/node_modules/request/request.js:1068:10)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:191:7)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:522:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)
    at TLSSocket.socketOnData (_http_client.js:411:20)
    at emitOne (events.js:96:13)
code-oss-dev@1.18.0 /storage/russellh/Git/vscode
└─┬ node-pty@0.7.1
  └── nan@2.7.0

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@github:bpasero/fsevents#vscode (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@0.3.8: wanted {"os":"darwin","arch":"any"} (current: {"os":"freebsd","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron@1.7.9 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron@1.7.9 postinstall script 'node install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the electron package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs electron
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls electron
npm ERR! There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /usr/home/russellh/.npm/_logs/2017-10-11T05_34_19_078Z-debug.log

I have no plans to take this any further so good luck! The electron people seem to have spent a great deal of effort to support a number of OSes. Perhaps they are agreeable to the idea of another one?

dinsdale
 
Don't know if anyone's familiar with this project on Git: https://github.com/atom/atom/blob/master/docs/build-instructions/freebsd.md
...but, the posted link provides access to some instructions on getting something Atom running in the FBSD env. The Atom project seems to have slight issues running flawlessly in the FBSD space as well --maybe low level dependencies IDK.

There is still the issue of Linux compatibility (with both Atom and VSCode apparently), but that can't happen until the systems can at least be built as noted earlier in this thread. The dev groups for both Atom and VSCode seem active enough, but bounties for the underlying systems reinforce my suspicion that low level dependencies are creeping upward.

Must agree with most that VSCode would be nice to have in the BSD realm especially considering the awesome plugins base and the fact that they should be mostly platform agnostic due to their JSON format (most as there are surely exceptions).
 
Looking through some of those patches... Ugh why has it originally been written in such an awkward way. Not only does the code have portability issues (why? the darn thing is just a text editor) but the entire build system is hardcoded to be naive of almost any platform other than Windows, Ubuntu and Mac OS X.

Isn't atom, javascript and all the webby cruft meant to have a decent packaging / build system?

Perhaps their solution is to package up the text editor into a Docker container and use it through that haha ;)

I think I will stay away from unportable text editors. Too much of a faff. I have a few colleagues who like the Microsoft branding but I guess I just don't quite get why.
 
Neither Atom nor Sublime work here. Kate isn't bad, though.

However, the CV (CodeView) component of MSC that got integrated into VC I am missing since I do no more DOS/Windows programming.
I'd love to have it on FreeBSD!
 
You might post a request to the Visual C++ Team on vcblog, they own VSCode and they are usually responsive. They might be able to move things along with regards to the dependency mentioned or suggest a workaround.

On a side note, I must admit that I do chafe a bit when I hear about how the next great IDE makes vim obsolete. I would argue that "its apples and oranges."

Vim is for editing text at the speed of thought. An IDE is a different animal for a different mode of activity. An IDE is mostly mouse driven with actions like context menus that offer browsing and autocomplete. When I am in vim, I am primarily editing text. When I am in an IDE, I shift to Windows user mode. I use the mouse a lot, and use the stock Windows keybindings. Its two different modes, two different mindsets, at least for me.

So I get it. An IDE can be quite helpful on large projects and even more so with languages with a big object model. I mean, who wants to type out something like:

Code:
Platform::Object::Application::Foundation::Library::Class::Containers::Sequential::ForwardIterator::NoResizeUberVector<Platform::Object::Numerics::Unsigned::Long::Integer>  mycontainer = 0;
in vim when an IDE will provide autocomplete.

But for C and assembly, vim is great. I can run it everywhere, on gui-less servers, embedded, etc., virtual machines, whatever. I cannot run an IDE thru SSH.
 

Since Atom "build" script assumes existence of a precompiled Electron binary at the hardcoded location, these instructions never worked in the first place. Not even when they were originally written (yeah, I specifically checked that). Why would anybody submit a pull request with nonworking build instructions is beyond me, but that is the case here.
 
Pre-built binaries for Atom, and the standalone electron can be found here on the releases page. It works just to extract the compiled release, and run it on CURRENT for AMD64.

Code:
fetch https://github.com/prash-wghats/Electron-VSCode-Atom-For-FreeBSD/releases/download/v1.10/VSCode-freebsd-x64_1.10.tar.xz
tar -xf VSCode-freebsd-x64_1.10.tar.xz
cd VSCode-freebsd-x64/bin
./code-oss
 

Attachments

  • vscode.png
    vscode.png
    256.3 KB · Views: 1,055
morteza-bsd Now you have Microsoft hooks in your nose to lead you around. Pretty soon you'll be doing .NET and write programs for BSD that require Mono cause it will be essentially a square Windows program pounded into a BSD round hole.
 
morteza-bsd Now you have Microsoft hooks in your nose to lead you around. Pretty soon you'll be doing .NET and write programs for BSD that require Mono cause it will be essentially a square Windows program pounded into a BSD round hole.
In a perfect world, there is no Window$ or Gates, but unfortunately we don't live in that world... So make your life easier, even with Windows!
 
morteza-bsd Not my point. My point is this infiltration of Microsoft into the Linux world that is so prevalent that it seems Linux users themselves can hardly wait for Microsoft to completely swallow them whole, as Microsoft has done by embedding Linux, because Linux tools are, apparently, not up to the task and they can't get the job done without Microsoft, .NET and Windows itself.

If one needs Microsoft to start developing on BSD, then that's when I'll find another OS to work with.
 
How much space (MB/GB) does the port VSCode occupy on disk?

Someone told me that it is very big
Hi, Martin.

Yes, that's right; and it may be inconsistent with the Unix ecosystem.
The compiled version, occupies about 1.4GB in size, regardless of the time, you spend during compile!
 
Back
Top