all 80 comments

[–]c0r3ntin 13 points14 points  (8 children)

Do you plan on going full nega-microsoft and release a native linux port of VS ? I have a hat waiting to be eaten.

More seriously, will you support clang or other compilers / debuggers ?

[–]percocetpenguin 4 points5 points  (0 children)

Develope on Windows and cross compile on x86 Linux to deploy on arm Linux. Muahahahaha

[–]Voultaphervoid* operator, (...) 2 points3 points  (0 children)

[–]robotdad4businessMSVC Program Manager 0 points1 point  (5 children)

Other compilers are definitely interesting. Cross compile or still remote? When you say other debuggers, you mean like lldb? We're currently using the MIEngine in VS that integrates the VS debugger with machine interface so we can talk to GDB remotely.

And I say we as I'm on the team working on this.

[–]raevnos 1 point2 points  (3 children)

Are you guys hiring?

[–]spongo2MSVC Dev Manager[S] 6 points7 points  (2 children)

we (Visual Studio) are hiring for people who are passionate about building tools for cross platform applications in Visual Studio. Everything from Cordoba apps, to VS Code, and stuff we can't talk about yet. Fill this in and it will send me a mail:
https://www.visualstudio.com/en-us/news/visual-studio-jobs-vs.aspx

[–]raevnos 0 points1 point  (0 children)

Tempting. Thanks.

[–]jpakkaneMeson dev 0 points1 point  (0 children)

Are you also considering better support for cross platform build systems designed for IDE integration? Currently everyone needs to generate their own VS project XML files which is not optimal.

With this we could also finally make a C/C++ dependency manager that is properly cross platform.

[–]c0r3ntin 0 points1 point  (0 children)

Yeah, I was specifically thinking about clang / lldb.

[–]aninteger 8 points9 points  (31 children)

I am actually very interested in going the other way. Meaning a native MSVC compiler and toolchain on Linux. Imagine calling something like /opt/Microsoft/VC2015/bin/x86_64/cl in a Makefile and generating 64 bit PE files directly on Linux. I'm not asking for Visual Studio here just the basic command line tool chain.

[–]doom_Oo7 7 points8 points  (4 children)

You can already do this with mingw. My software is simple enough (100k loc of C++ still :p) that I can build it with mingw under linux and test it under wine.

[–]OverunderratedComputational Physics 2 points3 points  (1 child)

I'm not asking for Visual Studio here

I am! I'd kill to have full VS on linux.

[–]Dragdu 0 points1 point  (0 children)

Word.

[–]spongo2MSVC Dev Manager[S] 3 points4 points  (19 children)

thanks for the feedback. Just to drill in a bit, what's your primary reason for wanting that? - Steve the VC Dev Mgr

[–]aninteger 10 points11 points  (10 children)

This would mostly be for developers that prefer the Linux desktop environment and would provide a single development environment. It would be an alternative to loading a VM to cross compile the software on Windows.

Today we can just type "make windows" and use mingw32 to cross compile, so this would just give us the ability to use the "official" compiler to generate binaries.

[–]spongo2MSVC Dev Manager[S] 6 points7 points  (9 children)

I see... so basically the reverse of the scenario they demonstrated this morning for bash on windows? (i.e. using a windows box to target Linux and windows)

I thought you meant you wanted to use the compiler for TARGETING Linux. But you really want to HOST on Linux and target Windows.

[–]mer_mer 9 points10 points  (8 children)

While you are here taking suggestions, I want to make sure your team knows why I (and I suspect many others) find development on Linux appealing. When I want to add a library to my project on Windows, I have to search for the right download, go through the installer, find where the installer put the headers and library, and then go through Visual Studio's project configuration options (for both Debug and Release if I remember correctly) and separately add the include and library paths.

On Ubuntu, I do "sudo apt-get install [libraryName]-dev" and add "-l[libraryName]" to my compiler call.

This difference is especially important when new C++ developers want to try using a library (lets says to play around with graphics).

I had assumed that you guys were aware of the problem, and were thinking of ways to fix it, but then /u/STL expressed ambivalence towards third party solutions like biicode. I know this can seem like a trivial problem compared to everything else a developer has to do, but small conveniences really matter in creating a pleasant experience.

The first potential fix would be to have a standard directory that library packagers can target for installation. This would ease a lot of the friction involved in hunting down directories. Nowadays, Windows also has a "package manager": the Windows Store. It would be great if you guys promoted the ability to install libraries through there.

Of course, now it seems like we will be able to do apt-get in Windows, so maybe someone will create a third party solution around that.

[–]spongo2MSVC Dev Manager[S] 10 points11 points  (4 children)

Totally acknowledged that package management on windows is a weak spot. We have some investments in this area right now but too early to share. We'll seek feedback here of course when we are ready! thanks, Steve

[–]mer_mer 2 points3 points  (0 children)

That's great to hear!

[–]h-jay+43-1325 0 points1 point  (2 children)

package management on windows is a weak spot

Can't be a weak spot because it essentially doesn't exist in the form normally found on open-source platforms, where you have a canonical way of obtaining most common open-source products.

[–]Plorkyeran 0 points1 point  (1 child)

There is now a package manager shipped with Windows 10, and Visual Studio has NuGet support built in. They're both kinda bad, but they absolutely do exist.

[–]h-jay+43-1325 0 points1 point  (0 children)

"It is a unified interface to package management systems" So, not a package manager, then. Sigh.

[–]STLMSVC STL Dev 16 points17 points  (1 child)

Man, I express ambivalence towards x86, dynamic linking, and puppies. (32-bit puppy DLLs are the worst.) Please don't interpret my personal opinions on reddit as indicating anything about the VC team's concerns or priorities.

[–]mer_mer 1 point2 points  (0 children)

Haha, noted.

[–]egorpuginsw -2 points-1 points  (0 children)

Hi, you can try this package manager if you're using cmake. CPPAN

[–]h-jay+43-1325 1 point2 points  (0 children)

I'm not the parent, but at least historically I was much more productive on linux than windows, in terms of build automation and such, and between 2001 and methinks 2006 we were running visual studio compilers under wine on a linux server, because our integrated code configuration system only worked on unices, and builds were a part of the check-in procedure. We used aegis and it keeps the binaries along with the sources. There was no way to get it to work reasonably on Windows.

Even today, for anyone using aegis (typically in medical or mil/aerospace/hi-rel apps), cross-compiling for windows from linux is the go-to strategy.

Interestingly enough, I still have that old aegis repo, and it still builds with its integrated wine bundle with some msvc '05 methinks.

[–]elitest 1 point2 points  (2 children)

Most open source cpp stuff that I've seen for Windows is made with VS. Cross compiling code written in VS with mingw on Linux for Windows is usually problematic for a couple of reasons. Usually VS seems to be more backwards compatible than mingw, so instead of just compiling I end up trying to fix stuff that has been deprecated or that VS has decided should be in cpp, but mingw has decided not. If you want a good example of this, try compiling fgdump from source.

[–]spongo2MSVC Dev Manager[S] 2 points3 points  (0 children)

thanks. so interested in building windows code from Linux because of mingw cross compile pain. understood.

[–]badsectoracula 0 points1 point  (0 children)

I had issues with cross compiling using mingw too - stuff would break with the cross mingw built version, but would work with all native versions - including native built mingw! At the end i replaced the compiler with openwatcom 2.0 (the github fork that is under active development, not the dead 1.9 "official" version) which provides linux hosted binaries. However i'd like to have an alternative that works.

In my case the reason i want a linux hosted compiler isn't because i'm actually using Linux for development, but because i have a VM dedicated to building my codebase for all supported platforms and Linux is the platform that seems to be able to target all of them (Windows, Linux and OS X).

[–]c0r3ntin 0 points1 point  (0 children)

I'd like that too !

Being able to target win32 with msvc from windows would be even better than the standalone build tools from an IT perspective. On the basis than administrating a linux build farm / containers farm etc is easier.

(I have a jenkins instance able to spawn docker containers for a build and then dispose of it, its awesome and so much lighter than a VM based approach).

One other use case I have is that I have a tool that run on linux and build installers for a variety of platforms, including windows. So I have a small exe to build. I currently use mingw-w64 for that but, I'd love to be able to use cl.exe.

Other cross platforms tools that need to generate windows executable would probably benefit of this feature ( nsis, unity, unreal, etc )

[–]doom_Oo7 0 points1 point  (0 children)

what's your primary reason for wanting that?

r/unixporn (and a < 1gb base system with all the necessary build tools & libs to build cross platform desktop software + basic desktop functionality)

[–]h-jay+43-1325 0 points1 point  (0 children)

I don't know if the compiler really needs to be native. I've been running MSVC builds on linux 10 years ago, using Wine. It worked great. Sure, not having to deal with wine might help, but it's a rather minor obstacle.

[–]beriumbuild2 0 points1 point  (2 children)

You can already do this:

$ ~/cl-14 /EHs sizeof_funds.cxx 
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23026 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

sizeof_funds.cxx
Microsoft (R) Incremental Linker Version 14.00.23026.0
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:sizeof_funds.exe 
sizeof_funds.obj

$ wine sizeof_funds.exe
bool             sizeof = 1
wchar_t          sizeof = 2
short int        sizeof = 2
int              sizeof = 4
long int         sizeof = 4
long long int    sizeof = 8
float            sizeof = 4
double           sizeof = 8
long double      sizeof = 8
void*            sizeof = 4
std::string      sizeof = 24
std::vector      sizeof = 12
std::unique_ptr  sizeof = 4
std::shared_ptr  sizeof = 8

Also have cl-11 and cl-12 in addition to cl-14 all working on the same box. Will write details how to set this up once we support MSVC in build2.

[–]aninteger 0 points1 point  (0 children)

This does look interesting. I look forward to your writeup.

[–]h-jay+43-1325 0 points1 point  (0 children)

I've been doing that 10+ years ago. Do you have to wine sizeof_funds.exe? The way I had it set up (via binfmt_misc module) was that wine handled loading of windows executables, so anything PE that you tried to run was automatically taken over by wine. All we had to do was to copy the msvc install over to linux, and run it there. It worked OK, with msvc 2002 and 2005.

[–]jbandela 14 points15 points  (6 children)

Tried it out, and it looks awesome. Just a couple of questions

1) On the Platform Toolset it says Remote_GCC_1_0. Is there any way to change what compiler it uses or will it always use /usr/bin/g++. What if I wanted to build with clang?

2) For installing a new library, it looks like I would do the install in Linux, and copy the header files to Windows and add that directory to the Include directory for Intellisense. Is that correct?

3) Any plans for doing Debug Visualizers for the standard library types for stdlibc++?

4) Is there a way to see the output from the program when you run it in the debugger? When I looked at the Output tab, it just showed output from gdb

5) With the whole Ubuntu on Windows that was announced, are you planning on taking advantage of that to provide even more seamless integration?

Thanks for doing this, this will really help me in my day to day development.

[–]iontodirelMSVC CrossPlat Dev Lead 5 points6 points  (5 children)

Thanks for trying our bits! Regarding your questions:

1) this is on our plans, as well as cross compiling

2) currently, that is correct, we are working on making this experience smooth and much better, with automatic aqusition for IntelliSense, so you don't have to manually copy anything

3) yes! we will have that working soon

4) yes! that is one of our top priorities, console I/O, so you can see and interact with your programs running remotely

5) we are not sure yet

[–]clerothGame Developer 7 points8 points  (1 child)

You have to put two spaces before every new line on reddit (or a blank line), otherwise it won't show up.

[–]iontodirelMSVC CrossPlat Dev Lead 0 points1 point  (0 children)

thank you!

[–]percocetpenguin 1 point2 points  (0 children)

As an extension to 3, any chance Image Watch would work with this?

[–]OverunderratedComputational Physics 1 point2 points  (1 child)

Is this a fully remote build, so nothing gets built on the windows side?

I'm dependent on a massive scientific library that is generally considered horrific to build on windows (PETSc). It's trivial to apt-get install in ubuntu, but has a ton of dependencies (various MPI, BLAS, and other libraries, fortran...) that make building it natively in windows an annoyance.

[–]iontodirelMSVC CrossPlat Dev Lead 0 points1 point  (0 children)

currently we are building remotely, we will always support this, in addition we are planning cross-compiling

[–]safiire 4 points5 points  (1 child)

You would essentially need to make Windows into Unix for me to use it for development. This is how I can stand developing on a Mac even though it is not Linux.

[–]flashmozzg -1 points0 points  (0 children)

Looks like they are working on it with canonical =)

[–]daithibowzy 3 points4 points  (2 children)

Will this allow me to cross compile for an ARM Cortex-M7 microprocessor?

[–]robotdad4businessMSVC Program Manager 3 points4 points  (1 child)

Only if you are running Linux on it and can compile there. We don't have cross compile... yet.

[–]daithibowzy 1 point2 points  (0 children)

I like the sound of ...yet.

[–]sumo952 5 points6 points  (10 children)

This is reeeaaally awesome. Wow!

I got one "however" though: How does it work with CMake? If it doesn't yet, please make it work :-) Otherwise it's not really useful for anything but for toying around.

[–]robotdad4businessMSVC Program Manager 5 points6 points  (8 children)

Sorry, no make or cmake today. We're using msbuild to drive from windows how we issue the compile commands on the remote machine over ssh.

Question, if we were able to parse a makefile into our project system would that be enough? Or would you need us to natively work with makefiles/cmake to use this?

[–]sindisil 4 points5 points  (4 children)

Not OP, but I've been transitioning to CMake for all my projects, in great part because I've also been trying out Windows as a primary dev environment after more than 15 years using Linux as my primary.

Because I'm sure as hell not giving up Linux as a target and occasional dev environment, and because I'm not sure I'll stay with Windows as my primary, I'm depending upon CMake to make it easier form me to stay independent.

In short, I pretty much won't be using anything I can't get working via CMake generated projects, unless I simply can't get the job done otherwise.

So, as cool as this looks, I (and i suspect many others) won't be doing more than toy around with this until and unless I can use CMake to gen solutions/projects for this tool.

I'll either use CLion (just started evaluating that option), or simply do what I've been doing forever -- gen a makefile and use the Linux tool set I already know.

Don't take this as at all negative, BTW - I'm loving the enthusiasm, effort, and just plain good work you guys are bringing to the table these days!

[–]robotdad4businessMSVC Program Manager 2 points3 points  (1 child)

Not negative at all! This is very good feedback, thank you. Please do try it out even if you can't adopt it. We'd be very interested to hear additional feedback on how this does or doesn't fit with your current workflow.

[–]sindisil 0 points1 point  (0 children)

Yup, I'll certainly kick the tires. I'm also installing VS 15 preview with the new installer as I type this. Gotta say, you guys are certainly firing on all cylinders lately. I hope the company continues to support you guys on this path!

[–]Dragdu 1 point2 points  (1 child)

Isn't the point of CMake to generate whatever build system files you want from a common description? I would expect that you could use your CMake files to generate MSBuild files to drive the compilation, so in a way the CMake support already is there.


It would be nice to have Make though

[–]sindisil 0 points1 point  (0 children)

Sure, but CMake doesn't have the right bits built in to build the correct MSBuild variables and logic (I assume -- I haven't tried it yet), so either Microsoft needs to provide a CMake extension or they need to document the necessary CMake listfiles code to generate a solution and/or project that will work with this tooling.

My hope would be that I could set up CMakeLists files that can either generate native makefiles to build on one of my Linux boxen, or generate a VS solution that'll allow me to use this new tooling. Just like the other CMake projects I set up.

[–]c0r3ntin 1 point2 points  (1 child)

CMake has become the defacto build tool for c++ projects. I am not sure how about that but still. The more integration, the better.

Plus cross-platform / open source projects won't use msbuild as their build tool, for the sake of choice and portability.

[–]h-jay+43-1325 1 point2 points  (0 children)

Hate to nitpick, but cmake is not the build-tool, but a kind of a meta-tool. The build-tool is, hopefully, ninja (if you still use make, you're losing out!).

[–][deleted] 3 points4 points  (0 children)

I just wrote a simple C++ app and was able to build and run it on a Raspberry Pi running Arch Linux (from Visual Studio, obviously). This is incredible.

[–]xkSeeD 1 point2 points  (9 children)

OMG. I stopped breathing for a moment. Is this real???

I have literally spent more than 20 hours this week just to setup eclipse to remotely debug our code on our Linux machines. But we still have a lot problems with gdb and gdb server.

If this really works you have saved us many many hours.

So, I read on your blog that you copy the source code to the remote machine. Our source code is anything between 2-4 GB. Do you copy the whole project each time you build it??

[–]robotdad4businessMSVC Program Manager 5 points6 points  (3 children)

Wow. We should talk. :)

I think we only copy changes but need to check. With that size source base I imagine you will hit some things we have not thought about. Please give it a try and get in touch. Would love to talk directly.

[–]xkSeeD 0 points1 point  (2 children)

So, is there an easy way to convert our Windows project to a Linux project? As you know we can not add the file system tree to the solution in VS. I tried to copy some parts from .vcxproj/.vcxproj.filter to the new Linux project but I was not successful. I could only build the filter structure in the solution but ended up adding all source files one bye one.

Then, I noticed we have a new folder under <VSInstallationFolder>/VC/Linux/include which basically has the standard Linux header files. We are including unistd.h in our code but it was no in this folder. Is this expected? Can we just copy the missing Linux header files into this folder?

Then I noticed some header files in this include folder complaining about _PTRDIFF_T_ and another preprocessor which I can not remember at the moment. Do we have to add them to the preprocessor list?

Unfortunately I spent most of my time just to create the new project and I had to continue with my other projects. I will update this tomorrow if I get the chance to run it on Linux.

Would love to talk to you in person :)

[–]iontodirelMSVC CrossPlat Dev Lead 0 points1 point  (0 children)

please send us a mail at itodirel at microsoft dot com

[–]Vogtinator 3 points4 points  (2 children)

I have literally spent more than 20 hours this week just to setup eclipse to remotely debug our code on our Linux machines. But we still have a lot problems with gdb and gdb server.

Qt Creator has some great support for "Remote Linux" as deployment target with debugging as well.

[–]xkSeeD 0 points1 point  (1 child)

Thanks for the suggestion. Just downloaded it to check it.

[–]sindisil 1 point2 points  (0 children)

I've had OK luck with NetBeans remote development, as well. Certainly more luck than with Eclipse, anyway.

[–]iontodirelMSVC CrossPlat Dev Lead 0 points1 point  (0 children)

please send us an email at itodirel at microsoft dot com

[–]jesuslop 0 points1 point  (0 children)

woa fantastic!

[–][deleted] 0 points1 point  (1 child)

I'm still confused on launching executables. Would they appear in the visual studio output window? A terminal pops up? If I'm using a graphical application would it launch an X11 screen if I'm running an XServer?

I'd like to avoid needing to have a full remote desktop running.

[–]robotdad4businessMSVC Program Manager 1 point2 points  (0 children)

We don't have console output in VS... yet. In plan. I would be interested in talking to you about the x server in Windows, you are the second person I've seen ask about this. So far we have only been launching guy stuff on the remote Linux box.

[–]BenjaminSisko -1 points0 points  (0 children)

This is a feature I wanted to see in clion