Skip to content

Warning: Path is not a file: AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\bin\gcc, despite IntelliSense working #3825

Closed

Description

Type: LanguageService

Describe the bug

  • OS and Version: Windows 10 1903
  • VS Code Version: 1.35.1
  • C/C++ Extension Version: 0.23.1
  • Other extensions you installed (and if the issue persists after disabling them): None

I'm getting this warning when trying to set "compilerPath": "/usr/bin/gcc":

Path is not a file: "C:\Users\felix\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\bin\gcc".

The warning is actually incorrect: This file exists, and IntelliSense works fine. If I remove "compilerPath": "/usr/bin/gcc" from my configuration, IntelliSense no longer works, and I get build errors, so the configuration is used despite this warning.

To Reproduce

I'm pretty sure these steps don't suffice, but here's what I did:

  1. Install Ubuntu through WSL.
  2. Create this c_cpp_properties.json:
    {
        "configurations": [
            {
                "name": "tool",
                "defines": [],
                "compilerPath": "/usr/bin/gcc",
                "cStandard": "c11",
                "cppStandard": "c++17",
                "intelliSenseMode": "gcc-x64"
            }
        ],
        "version": 4
    }
    

That's it.

Screenshots

image

Activity

  1. sean-mcmanus commented on Jun 25, 2019

    @sean-mcmanus
    Contributor

    I don't repro this problem, with Ubuntu or Ubuntu 18.04. The only way I was able to repro it was when I did not have gcc installed. Can you run the C/C++: Log Diagnostics command to see what gcc path it is using when you use the "/usr/bin/gcc"?

  2. added
    Feature: ConfigurationAn issue related to configuring the extension or IntelliSense
    more info neededThe issue report is not actionable in its current state
    not reproingWe're not able to reproduce the issue (it's unlikely to get fixed until we find one).
    on Jun 25, 2019
  3. fefrei commented on Jun 25, 2019

    @fefrei
    Author

    This is the output (with a configuration that also has some includePath entries, previously omitted because the problem happened without them):

    -------- Diagnostics - 2019-6-25 23:10:13
    Version: 0.23.1
    Translation Unit Mappings:
    [C:\Users\felix\git\draisine-hypro\tool\src\lib\verifier\ForwardVerifier.cpp]:
        C:\Users\felix\git\draisine-hypro\tool\src\lib\verifier\ForwardVerifier.cpp
        C:\Users\felix\git\draisine-hypro\tool\src\lib\verifier\Chunk.h
        C:\Users\felix\git\draisine-hypro\tool\src\lib\verifier\ForwardVerifier.h
        C:\Users\felix\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\include\c++\7\stdexcept
    [C:\Users\felix\git\draisine-hypro\tool\src\lib\verifier\PendulumVerifier.cpp]:
        C:\Users\felix\git\draisine-hypro\tool\src\lib\verifier\PendulumVerifier.cpp
        C:\Users\felix\git\draisine-hypro\tool\src\lib\verifier\Chunk.h
        C:\Users\felix\git\draisine-hypro\tool\src\lib\verifier\ForwardVerifier.h
        C:\Users\felix\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\include\c++\7\stdexcept
        C:\Users\felix\git\draisine-hypro\tool\src\lib\verifier\PendulumVerifier.h
    Translation Unit Configurations:
    [C:\Users\felix\git\draisine-hypro\tool\src\lib\verifier\ForwardVerifier.cpp]:
        Process ID: 2376
        Memory Usage: 82 MB
        Compiler Path: /usr/bin/gcc
        Includes:
            C:\Users\felix\git\hypro\src
            C:\Users\felix\git\hypro\src\hypro
            C:\Users\felix\git\hypro\build\resources\src\glpk_download\include
            C:\Users\felix\git\carl\src
            C:\Users\felix\git\carl\build\resources\include
            C:\Users\felix\git\carl\build\resources\src\CoCoALib-EP\include
            C:\Users\felix\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\include\c++\7
            C:\Users\felix\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\include\x86_64-linux-gnu\c++\7
            C:\Users\felix\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\include\c++\7\backward
            C:\Users\felix\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\lib\gcc\x86_64-linux-gnu\7\include
            C:\Users\felix\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\local\include
            C:\Users\felix\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\lib\gcc\x86_64-linux-gnu\7\include-fixed
            C:\Users\felix\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\include\x86_64-linux-gnu
            C:\Users\felix\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\include
        Standard Version: c++17
        IntelliSense Mode: gcc-x64
        Other Flags:
            --g++
            --gnu_version=70400
    [C:\Users\felix\git\draisine-hypro\tool\src\lib\verifier\PendulumVerifier.cpp]:
        Process ID: 8528
        Memory Usage: 40 MB
        Compiler Path: /usr/bin/gcc
        Includes:
            C:\Users\felix\git\hypro\src
            C:\Users\felix\git\hypro\src\hypro
            C:\Users\felix\git\hypro\build\resources\src\glpk_download\include
            C:\Users\felix\git\carl\src
            C:\Users\felix\git\carl\build\resources\include
            C:\Users\felix\git\carl\build\resources\src\CoCoALib-EP\include
            C:\Users\felix\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\include\c++\7
            C:\Users\felix\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\include\x86_64-linux-gnu\c++\7
            C:\Users\felix\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\include\c++\7\backward
            C:\Users\felix\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\lib\gcc\x86_64-linux-gnu\7\include
            C:\Users\felix\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\local\include
            C:\Users\felix\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\lib\gcc\x86_64-linux-gnu\7\include-fixed
            C:\Users\felix\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\include\x86_64-linux-gnu
            C:\Users\felix\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\include
        Standard Version: c++17
        IntelliSense Mode: gcc-x64
        Other Flags:
            --g++
            --gnu_version=70400
    Total Memory Usage: 122 MB
    
  4. sean-mcmanus commented on Jun 25, 2019

    @sean-mcmanus
    Contributor

    That output looks correct. Hmm, not sure why the config squiggle would appear, but you could get the incorrect squiggle to go away via "enableConfigurationSquiggles": false in the root (or the matching C_Cpp.default.enableConfigurationSquiggles setting).

    Michelle Matias (@michelleangela) Colen Garoutte-Carson (@Colengms) Any ideas how this incorrect squiggle could occur or are you able to repro it?

  5. fefrei commented on Jun 25, 2019

    @fefrei
    Author

    While I don't know the internals, I find it really suspicious that I configure /usr/bin/gcc, and the debug output lists /usr/bin/gcc, but the squiggle complains about the Windows version of that path.

  6. sean-mcmanus commented on Jun 25, 2019

    @sean-mcmanus
    Contributor

    The code that implements this squiggle is in our open source TypeScript, so theoretically you could debug it to see why it's failing for you if you use the "release" branch. The code runs on Windows so we need to convert the path to the Windows path, which appears to work successfully, so I don't know why it would fail to be found.

  7. fefrei commented on Jun 25, 2019

    @fefrei
    Author

    Hm, OK. Another thought: While the file does exist, it's a 0-byte file, because it's a symbolic link on the Linux side. Maybe this is tripping something up?

  8. sean-mcmanus commented on Jun 25, 2019

    @sean-mcmanus
    Contributor

    That should still work. It's a symbolic link to gcc-7 for me as well. The only case it would fail is if there was a symbolic link in the WSL version of the path that we would need to translate on the WSL side in order to get the correct Windows path. Your OS matches mine as well, so I don't know what is different that could be causing the failure.

  9. sean-mcmanus commented on Jun 25, 2019

    @sean-mcmanus
    Contributor

    Oh, wait, it shouldn't be 0 bytes -- are you sure it's really 0 bytes? Size on Disk can be 0 bytes, but it should contain text when opened in notepad (i.e. Size not 0).

  10. fefrei commented on Jun 25, 2019

    @fefrei
    Author

    It appears to have 0 bytes:

    image

    And – suspiciously – Notepad cannot touch it:

    image

    However, the files look fine with WSL goggles on:

    image

  11. sean-mcmanus commented on Jun 25, 2019

    @sean-mcmanus
    Contributor

    It might be because you upgraded to the "WslFs file system format"...I'm checking that out now...

  12. sean-mcmanus commented on Jun 25, 2019

    @sean-mcmanus
    Contributor

    I reproed it -- the WslFs file system format is the cause.

  13. removed
    not reproingWe're not able to reproduce the issue (it's unlikely to get fixed until we find one).
    on Jun 25, 2019
  14. bobbrow commented on Feb 5, 2020

    @bobbrow
    Contributor

    Can you try using the Remote-WSL extension? We're not likely to make any changes to our WSL support now that that extension exists.

  15. fefrei commented on Feb 6, 2020

    @fefrei
    Author

    I’m using that right now, currently without issues. Thanks!

  16. locked and limited conversation to collaborators on Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature: ConfigurationAn issue related to configuring the extension or IntelliSenseLanguage Servicebughelp wantedCan be fixed in the public (open source) repo.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions