Skip to content
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

advancedExecutables doesnt seem to support symlinked executables #400

Open
5 tasks done
delfu opened this issue Oct 17, 2023 · 4 comments
Open
5 tasks done

advancedExecutables doesnt seem to support symlinked executables #400

delfu opened this issue Oct 17, 2023 · 4 comments
Labels
bazel Bazel build system related enhancement New feature or request

Comments

@delfu
Copy link

delfu commented Oct 17, 2023

Checklist

  • The issue is about this extension and NOT about a fork.
  • Checked the ALL the SUPPORT document.
  • The latest version of the extension was used.
  • It is not related to remote-vscode or I checked the following issue
  • Imagine yourself into my position and think how hard to debug the issue without insufficient information.
    I understand that you have privacy concerns and I expect you to understand that this extension is developed for free.
    Thanks.

Describe the bug

Using the setting testMate.cpp.test.advancedExecutables, setting a pattern to be a symlink to an executable, the test doesnt seem to be picked up.

If instead, i set the pattern to the absolute path of the executable, the Test Explorer works as expected

To Reproduce

  1. add this setting
"testMate.cpp.test.advancedExecutables": [
      {
        "pattern": "build/linkToExecutable",
        "catch2": {
          "testGrouping": {
            "groupByExecutable": {
              "groupBySource": {
                "label": "${sourceRelPath[-1]}",
                "groupByTags": true
              }
            }
          }
        }
      }
    ],

expected:

  • the test to be surfaced in Test Explorer

result:

  • the test does not surface

Desktop

  • Extension Version: latest
  • VS Code Version: latest
  • Catch2 / Google Test / DOCTest Version: catch2@3.1
  • OS Type and Version: mac, arm
  • Using remote-ssh/docker/wsl?: no

Logs
[2023-10-17 23:12:57.057] [INFO] Activating extension
[2023-10-17 23:12:57.058] [INFO] Activation finished
[2023-10-17 23:12:59.505] [INFO] context:executables [
{
pattern: 'build/linkToExecutable',
catch2: { testGrouping: { groupByExecutable: [Object] } }
}
]
[2023-10-17 23:12:59.507] [DEBUG] ExecutableConfig.resolveVariable: {
value: 'build/linkToExecutable',
resolved: Promise { },
strictAllowed: false
}
[2023-10-17 23:12:59.507] [INFO] pattern build/linkToExecutable /Users/delongfu/workspace {
isAbsolute: false,
absPath: '/Users/delongfu/workspace/build/linkToExecutable',
isPartOfWs: true,
relativeToWsPosix: 'build/linkToExecutable'
}

@matepek
Copy link
Owner

matepek commented Oct 18, 2023

vscode.workspace.findFiles ignores them. But there are other issues with symlinks. The symlink is not updated when the source has been changed. Would you tell me more about your use case? Have you considered hard links?

@matepek matepek changed the title [bug] advancedExecutables doesnt seem to support symlinked executables advancedExecutables doesnt seem to support symlinked executables Oct 18, 2023
@matepek matepek added the enhancement New feature or request label Oct 18, 2023
@delfu
Copy link
Author

delfu commented Oct 18, 2023

thank you for the reply! we use bazel for building and the output folder isnt deterministic (differs person to person) . so this was the only way i could think of for testmate to discover the executable. What would be downsides to using a hardlink?

@matepek
Copy link
Owner

matepek commented Oct 19, 2023

What would be downsides to using a hardlink?

Probably nothing. Should be fine.

Also you could use something like build/user_*/**/test*.
Or build/${os_env:USER}/**/test*.

Also you could customise .vscode/settings.json content.

@matepek
Copy link
Owner

matepek commented Dec 31, 2023

might interesting to check #414

@matepek matepek added the bazel Bazel build system related label Dec 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bazel Bazel build system related enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants