-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
failure: Updating C/C++ dependencies in offline mode #298
Comments
Sounds like the Node.js OpenSSL library we depend on is failing. I haven't seen that before. What happens if you restart VS Code and try again? What are your VS Code "http." settings? Are you able to download these? |
On the topic of updating C/C++ dependencies, can we please have an offline install option that has all the dependencies bundled together? I work in a development environment intentionally disconnected from the internet. Right now I'm having to hack a solution by reading the package.json files to determine what I need to download and then reading the source for how the package manager works. It's slightly annoying to do for each release. I realize this is a special case, but anything you can do to make this a bit easier would be much appreciated. Example: if the "Download dependencies" vs "Install dependencies" functionality of the extension were split apart as separate functions (instead of a bunch of chained lines of code), a standalone script could be easily implemented to call the install functionality and point it at the downloaded zip files. Thanks. |
@Jevyn, @RyanSung , I'm sorry that you are experiencing these difficulties. Unfortunately, we depend on a number of native components that have to be compiled for each platform. If we shipped them all in the same extension, then a large portion of the extension would not be useable to you, and you would have to wait a long time for the initial download. @Jevyn, do you have a suggestion for the "offline" install? How would you forsee getting the files in the first place? |
@delmyers I get the files the same way I get vscode and extensions. I download them on an internet connected machine. Virus scan them, burn to CD and physically move them to the disconnected network. Don't get me wrong - it's not an ideal solution, but is the environment I have to work in. I'd need all of the dependencies for all platforms anyway - we have multiple developers using vscode who work on Windows, Mac and Linux platforms). I'm not concerned about the download size of the files. As for a suggestion. Have a look at the extensions main.js, you will see the function processRuntimeDependencies. Inside this function, it uses a bunch of anonymous functions for the various stages - downloadPackages, installPackages, etc. Suggestion 1: Convert the anonymous functions to named functions and export them. This way a standalone offlineDependenciesInstall.js could be made to call into the step after downloadPackages. I could download the files and run this script. The downside is that it would have to be kept insync with main.js. Suggestion 2: There is already a local variable that indicates the installationStage. Any chance this could be serialized to disk and loaded when the extension starts? Then someone could do the following. Download the dependencies and drop them in a known "downloaded" location inside the extension directory. Touch the installationStage file and give it "downloadedPackages" as the contents. Start vscode. cpptools extension reads installationStage file and continues to the next stage ("installPackages" as currently implemented in main.js). The advantage of this is that no extra script needs to be kept in sync. Lastly, all of this offline install stuff gets easier if there were a single bundle that had all the dependencies. That's a nice to have though - making the dependency install easier is much more important. |
@Jevyn, Can you explain to me in a little more detail your current workflow. What are the steps you use for "downloading them, and burning them to a CD"? How do you install vscode+extensions after you download and burn? And what do you download and burn? |
@delmyers Workflow is as follows
Segregated Workstation - using CD from above
Back on Internet Terminal:
Back on Segregated Workstation - using 2nd CD
I repeat the steps as necessary any time vscode or cpptools is upgraded. |
@RyanSung I come across the same situation, and I go around it by changing URL that causes failure from using https to using http. |
@Jevyn, can you email me at delmyers@microsoft.com? I can try and help you come up with a solution for your particular situation. |
I am also attempting to setup cpptools in an offline environment, I still haven't succeeded following Jevyn's instructions unfortunately. An offline bundle install would be excellent. |
The ms-vscode.cpptools-0.9.3/install.lock file should prevent any additional downloading. Does that not work? Where are you hitting a problem? |
I don't understand what this step is;
To the best of my knowledge i've followed every other step correctly. I did just notice a typo in the lock file (ugh), fixing that has stopped the output message. |
Open ms-vscode.cpptools-0.9.3/package.json, then open out/src/main.js and look at the rewriteManifest method and do the steps listed there (change the activationEvents and the contributes.debuggers values, "undefined" means remove it). Changing the activationEvents makes it so the C++ extension doesn't load unless it is in a valid scenario. Also, simply copying the entire ms-vscode.cpptools.<version> contents from a machine with internet access with a matching OS to the target machine should also work. |
Thanks for the info. Ill spin up a Centos VM on the weekend and go ahead with the copy/paste plan. |
FYI, if the target machine is CentOS then the language service will fail due to our requirement for glibc at least 2.18. Updating the glibc on the machine should fix it though (see #19 ). |
FYI, the vsix extensions can be opened as a zip file on your internet machine. I extract the extension and view the package.json file in order to determine the links to the runtime dependencies I will need. I then download all the runtime dependencies. This will reduce the need to burn files twice. Now back on my offline network I put the runtime dependencies on my local webserver. I then proceed to install code, and the cpptools.vsix extension. Prior to opening code, I modify the package.json for the cpptools extension to point to the new locations for the runtime dependencies (ex. http://localwebserver/mono-framework.zip). I also modify out/src/Debugger/packageManager.js to require('http') instead of require('https'). Restart code, and cpp extension will download the runtime dependencies from my webserver and do all the steps in main.js for me. |
@Jevyn I recently installed VS Code on my Windows 8.1 and I can't install any extension. |
You have the right folder. You can skip #3 on Windows (otherwise you have to run chmod 775 to set the binaries as executable). For #4, you should also make changes to the package.json (i.e. manifestObject below): For #5, you need to add an install.lock file in the same root directory to prevent the download from being reattempted. However, ideally you should get the download to work somehow or copy the installed extension files from a machine that is able to download them successfully. |
@sean-mcmanus Thanks for the response. After doing all, I have this error in the debug console: You may only use the C/C++ Extension for Visual Studio Code with Visual Studio |
That's just the license text. It appears in the Debug Console window when you start debugging. Afterwards it should show which symbols are loaded or not. What feature is not working for you? |
When I use the launch green bottom, it gives me this error: |
@Majid-Khosh The C++ extension doesn't provide build tools. Were you able to build using VS Code Tasks or an external command line? |
I also have the same requirement todo an offline airgapped install. Also paperwork is required so doing this in 10 piecemeal steps component by component is not ideal. In this day and age size of the download is less of a concern if it fits on a single sided DVD. |
@jdmairs You should be able to install the extension on the machine with internet access, zip the extension folder with a tool that preserves permissions, such as tar, burn the zip to cd, and then unzip on the target machine, although your source/target machines needs to be the same OS or you'd need to change the OS-dependent files that are downloaded (we might add a command to make that easier later). The size matters because VS Code imposes a 20 MB size limit for extensions and every update downloads the entire extension again. |
Thanks for the process and enlightening me on the restriction/requirement!
…On Mon, Apr 17, 2017 at 2:34 PM, Sean McManus ***@***.***> wrote:
@jdmairs <https://github.com/jdmairs> You should be able to install the
extension on the machine with internet access, zip the extension folder
with a tool that preserves permissions, such as tar, burn the zip to cd,
and then unzip on the target machine, although your source/target machines
needs to be the same OS or you'd need to change the OS-dependent files that
are downloaded (we might add a command to make that easier later). The size
matters because VS Code imposes a 20 MB size limit for extensions and every
update downloads the entire extension again.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#298 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFXT6JnTPw-Nf7oX11EU5tBaJbZPSQYFks5rw7CpgaJpZM4KagQO>
.
|
Does Centos 7.1 and Redhat 7.1 equal Same OS?
…On Mon, Apr 17, 2017 at 3:11 PM, John Mairs ***@***.***> wrote:
Thanks for the process and enlightening me on the restriction/requirement!
On Mon, Apr 17, 2017 at 2:34 PM, Sean McManus ***@***.***>
wrote:
> @jdmairs <https://github.com/jdmairs> You should be able to install the
> extension on the machine with internet access, zip the extension folder
> with a tool that preserves permissions, such as tar, burn the zip to cd,
> and then unzip on the target machine, although your source/target machines
> needs to be the same OS or you'd need to change the OS-dependent files that
> are downloaded (we might add a command to make that easier later). The size
> matters because VS Code imposes a 20 MB size limit for extensions and every
> update downloads the entire extension again.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#298 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AFXT6JnTPw-Nf7oX11EU5tBaJbZPSQYFks5rw7CpgaJpZM4KagQO>
> .
>
|
In the old times, it was impossible to just install an additional component from the Internet. In the modern times, it's impossible to install an additional component without the Internet. I am faced with the same problem of working in offline environment, but unfortunately no spare time to perform the above manual manipulations by hand... Would be nice to just have a download link per platform, copy to offline environment, install. |
@aaronniemiec What version number and bitness of RedHat Linux? Our Linux bits are generic to all distros, but require 64-bit and glibc 2.18 or greater (RHEL 8 works, but 7 requires a workaround). The easiest way is to do a clean install of the extension and then before VS Code is reloaded and it downloads the OS-specific files, you can delete the runtimeDependencies sections that match your download machine OS and change the ones that match your target os to values that match your target OS. For example, for Windows download machine targeting Linux your runtimeDependencies would look something like: |
So, just to be clear, you downloaded VS Code on your Windows machine with internet access; installed the C/C++ extension; then followed the steps outlined prior to re-loading VS Code. Once complete, you copied the resulting files onto your Linux machine. Does that sound right? Did you zip the entire .vscode/extensions/cpp-tools directory or just a subdirectory when going from Windows to Linux? Thanks for all your support... |
Also -- will this allow the "Auto Indent" functionality to be accessible in my Linux target VS Code? Still wondering if this provides a solution to that problem I had... Please advise! |
@aaronniemiec Yeah, what you say sounds correct. Let us know if you hit a problem. Only the ms-vscode.cpptools folder needs to be zipped/copied, since that is where our extension installs to, but you could zip the other extension folders too if you're using any and don't have the .vsix. What is "auto indent" functionality? If it works on Windows, it should work on Linux too. |
I'm talking about what I see here: If I insert an extra tab on a line, when I try Ctrl+K, Ctrl+F it does nothing to fix the incorrect indent. Why is that? Is it related to not having the C/C++ Extension installed correctly? |
Yes, our extension supports formatting via clang-format. Format document and format selection should work fine. Our formatOnType support is somewhat limited currently though (only formats the current line on ";" and not on "}"). Our formatOnSave may have some bugs. |
Here was the output after changing the package.JSON with the text above and reloading VS Code: Updating C/C++ dependencies... Downloading package 'C/C++ language components (Linux)' Failed at stage: downloadPackages Finished Doesn't look like it worked ... Or did it? |
@aaronniemiec Yeah, it is failing to download for some reason. It works for me. It looks like your computer/network you're trying to download from has some problem. I assume using the unmodified package.json also doesn't work? What about manually downloading the links in the package.json? |
I have manually downloaded the links in the package.json but not sure which ones I want... Can you direct me? I've downloaded the following .zip files: mono-runtime-linux-x86.zip Do I need any others or is that the complete list? |
The mono-runtime-Linux-x86.zip is for a 32-bit Linux machine, but our language service doesn't work on 32-bit Linux, so you'd only get the debugger stuff. We don't have a way to automatically install the .zips after downloading. It sounds like there's some issue with our package download code that is preventing a download? Have you setup your http.proxy settings correctly? |
Is this the right code to have in my package.json file? "runtimeDependencies": [ |
Yes, if you want to download/install for a 64-bit Linux target. It successfully downloads for me when I try on Windows. |
The worst thing is for every new version of vscode-cpptools, C++ dependencies should be installed again, although they were not updated at all. That's too bad for Internet-disconnected or tortoisely-connected environments. My workaround: |
So it tries to download the dependencies again even if the version didn't change? That's not good. Maybe they should consider adding version checking to the dependency installation so it won't try to pull down unnecessary packages. |
VS Code deletes the old extension's folder, which requires us to re-download dependencies even if they haven't changed since the last version. |
And usually, the language service dependencies change with every update. The 0.11.4 update was an exception. |
I've implemented something similar to what @ampatel21 mentions above. The only difference is I wrote a little bit of python (inherit from SimpleHttpServer) to mimic the way urls like: My steps are now the following:
Writing the python is an exercise left to the reader :) |
Using URL's with redirects in the package.json make this process much more complex. e.g. https://go.microsoft.com/fwlink/?linkid=847739 For other tools, such as Jenkins, I have used a NGINX to proxy_pass from the internet URL to a local mirror with the downloaded files. This works best if there is no redirects to mess with, just real URLs pointing at a versioned file names. As a bonus you can mirror documentation links aswell with the same approach, as the only configuration is to point at the proxy. |
We have a stretch goal to enable offline installs for our next update. I'm adding it to the December 2017 milestone. |
Fixed with 0.14.4. Offline installers are at https://github.com/Microsoft/vscode-cpptools/releases . |
Updating C/C++ dependencies...
Downloading package 'Mono Framework Assemblies' (4751 KB) .................... Done!
Downloading package 'Mono Runtime (OS X)' (1549 KB) .................... Done!
Downloading package 'LLDB 3.8.0 (OS X)' (18486 KB) .................... Done!
Downloading package 'C/C++ language components (OS X)' Failed at stage: downloadPackages
Error: write EPROTO 140735231705088:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure:../../vendor/node/deps/openssl/openssl/ssl/s23_clnt.c:769:
Finished
The text was updated successfully, but these errors were encountered: