Git Product home page Git Product logo

infersharp-vs-extension's Introduction

InferSharp Extension README

This is an extension which integrates InferSharp version 1.2 into Visual Studio. Currently, this extension has only been tested for Windows.

Demo

Getting Started

  1. Run automatic setup via the InferSharp Analysis command added to your Tools menu by the extension. Install progress is reported in the InferSharp channel within the Output tab. See Known Issues if you run into any issues. Wait for setup to complete.
  2. After setup is complete, running InferSharp Analysis will open File Explorer for you to select the root of the directory tree containing DLLs/PDBs to be analyzed.
  3. Analysis will run, with progress updates being reported in the InferSharp window within the Output channel of VSCode. When it is completed, the analysis will open a SARIF representation of the warnings via the SARIF Viewer extension. Additionally, it will copy the full analysis output infer-out/ directory to the directory you provided.

Overview

This extension adds the InferSharp Analysis command to the Tools menu.

If InferSharp has not yet been set up on the machine yet, this command will perform installation by installing WSL Ubuntu if it is not already present and then downloading and unpacking InferSharp binaries to the WSL Linux file system. Please note that a Ubuntu terminal will open as a part of this setup process and invite you to set up a username and password; you may close this terminal without providing any input after it has prompted you to provide a UNIX username.

After setup, subsequent invocations of the command prompt the user to provide the root of a directory tree which contains the .dll and .pdb files produced by the project's build system. Note that these files need only need be somewhere in the tree, as InferSharp will traverse the tree to find the binaries. It conducts the analysis through WSL and copies the resulting infer-out directory to the provided path. The bug report is located at infer-out/report.txt.

Requirements

Please see the requirements for WSL. In particular, please check that you have virtualization turned on and are running Windows 10 version 2004 or higher (Build 19041 or higher), or Windows 11. Otherwise, automated setup may fail and you will have to set up WSL manually.

Additionally, please ensure that Ubuntu 20.04 is your default distribution.

Known Issues

Automatic Setup Failure

Automatic setup may fail if your machine lacks the requirements for automatic installation of WSL. For example, your version of Windows may be older than Windows 10 version 19041 or virtualization may not be turned on. It may also fail because installing WSL requires elevated privileges (for example, wsl --install may come back with "The requested operation requires elevation"). In these cases, please try to run manual installation of WSL and set Ubuntu 20.04 as the default distribution via the -s flag. Note that if your Windows version is new enough (> build 19041), you may simply need to run wsl --install while running Powershell with administrator privileges.

After setup, please execute the following commands from Powershell (particularly note the rename of the binary folder to the correct version):

wsl ~ -u root wget https://github.com/microsoft/infersharp/releases/download/v1.2/infersharp-linux64-v1.2.tar.gz -O infersharp.tar.gz
wsl ~ -u root tar -xvzf infersharp.tar.gz
wsl ~ -u root mv infersharp infersharp1.2
wsl ~ -u root rm infersharp.tar.gz

The InferSharp Analysis command will now be ready for you to use.

GLIBC error

It's possible that you see the following issue upon attempting to run the analysis:

infersharp/infer/lib/infer/infer/bin/infer: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by infersharp/infer/lib/infer/infer/bin/infer)
infersharp/infer/lib/infer/infer/bin/infer: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /root/infersharp/infer/lib/infer/infer/bin/../libso/libsqlite3.so.0)

This indicates the version of GLIBC on WSL is too old for the InferSharp binaries to execute; this can happen because you installed Ubuntu 18.04, for which the highest version of GLIBC is 2.27. To resolve this, please ensure that you've installed WSL Ubuntu 20.04.

License

The extension is MIT-licensed.

Release Notes

1.0.0

Initial release.

infersharp-vs-extension's People

Contributors

matjin avatar

Stargazers

Exile avatar Andrii Rublov avatar  avatar

Watchers

 avatar

infersharp-vs-extension's Issues

What does { someSymbol -> 1 } mean?

Hey,

I'm trying to figure out what the -> 1 part means in DOTNET_RESOURCE_LEAK. For example Leaked { n$3 -> 1, n$4 -> 0 }. I think the n$k part represents the k-th value in the current stack frame (arguments and locals) but I don't know what the arrow and the number afterwards denote.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.