Skip to content
Snippets Groups Projects

VSCode WorkDir Workspace, main branch (2025.03.06.)

All threads resolved!

Since I will need to do some "proper development work" on this repository in the coming weeks, I had another look at whether I could teach VSCode how to build the different projects for me by the click of a button. Just because in such a setup IntelliSense works in a much more robust way than in the way that we have it set up at the moment.

And this is when I learned about "Workspaces". :wink:

https://code.visualstudio.com/docs/editor/workspaces/workspaces

That it's possible to set up workspaces with multiple directories, and that Microsoft's CMake plugin has a way of handling such workspaces.

https://devblogs.microsoft.com/cppblog/visual-studio-code-cmake-tools-extension-multi-root-workspaces-and-file-based-api/

With this MR's addition, I can now do the following:

  • Set up the nightly in a terminal window that I want to work on.
[bash][Celeborn]:xaod > setupATLAS
lsetup               lsetup <tool1> [ <tool2> ...] (see lsetup -h):
 lsetup asetup        (or asetup) to setup an Athena release
 lsetup astyle        ATLAS style macros
 lsetup atlantis      Atlantis: event display
 lsetup centralpage   Find samples
 lsetup eiclient      Event Index
 lsetup emi           EMI: grid middleware user interface
 lsetup lcgenv        lcgenv: setup tools from cvmfs SFT repository
 lsetup panda         Panda: Production ANd Distributed Analysis
 lsetup pyami         pyAMI: ATLAS Metadata Interface python client
 lsetup root          ROOT data processing framework
 lsetup rucio         distributed data management system client
 lsetup scikit        python data analysis ecosystem
 lsetup views         Set up a full LCG release
 lsetup xcache        XRootD local proxy cache
 lsetup xrootd        XRootD data access
advancedTools        advanced tools menu
diagnostics          diagnostic tools menu
helpMe               more help
installPip           install relocatable pip modules locally
installRpm           install relocatable rpms locally
printMenu            show this menu
queryC               find / whatis container query
showVersions         show versions of installed software

[bash][Celeborn]:xaod > asetup AnalysisBase,main,latest
Using AnalysisBase/25.2.45 [cmake] with platform x86_64-el9-gcc13-opt
        at /cvmfs/atlas-nightlies.cern.ch/repo/sw/main_AnalysisBase_x86_64-el9-gcc13-opt/2025-03-06T0220
Unchanged: COOL_ORA_ENABLE_ADAPTIVE_OPT=Y
[bash][Celeborn]:xaod >
  • Put a package_filters.txt file beside the athena/ clone in my development directory, like I've always done. (And how I hope most people do this...)
[bash][Celeborn]:xaod > ls -l
total 20
drwxr-xr-x 38 krasznaa krasznaa 4096 Mar  6 13:36 athena
-rw-r--r--  1 krasznaa krasznaa 1051 Mar  6 13:08 package_filters.txt
[bash][Celeborn]:xaod >
  • Open the "workspace" from this terminal, in that environment.
[bash][Celeborn]:xaod > code athena/WorkDir.code-workspace
[bash][Celeborn]:xaod >

This would put me into a setup like:

image

I.e. the main athena/ directory and the Projects/WorkDir directory are opened alongside each other. This is a bit of overkill, since the athena/ directory also has access to the contents of Projects/WorkDir/. But in this setup, as long as one has a file open "from the WorkDir directory", like Projects/WorkDir/CMakeLists.txt as the easiest, one can just click on the "Build" button at the bottom of the window. :partying_face:

image

:tada: And it actually works! :tada: It builds the project in a directory called build/ beside the athena/ directory. And makes sure that IntelliSense would work as it should.

image

@fwinkl, @tadej, what do you guys think? Also, since @tadej is one of the power users, could you check that these additions would not interfere with how you use VSCode currently? Since my intention was not to break anybody's current setup. :thinking:

Merge request reports

Pipeline #11096930 passed

Pipeline passed for aef2bcde on akraszna:VSCodeWorkDirWorkspace-main-20250306

Approval is optional

Merged by Frank WinklmeierFrank Winklmeier 3 weeks ago (Mar 21, 2025 2:04pm UTC)

Merge details

  • Changes merged into main with fc9cf4e0 (commits were squashed).
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • :white_check_mark: CI Result SUCCESS (hash cf9eacdb)

    Athena AthSimulation AthGeneration AnalysisBase AthAnalysis DetCommon
    externals :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    cmake :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    make :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    tests :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:

    Full details available on this CI monitor view. Check the JIRA CI status board for known problems
    :white_check_mark: Athena: number of compilation errors 0, warnings 0
    :white_check_mark: AthSimulation: number of compilation errors 0, warnings 0
    :white_check_mark: AthGeneration: number of compilation errors 0, warnings 0
    :white_check_mark: AnalysisBase: number of compilation errors 0, warnings 0
    :white_check_mark: AthAnalysis: number of compilation errors 0, warnings 0
    :white_check_mark: DetCommon: number of compilation errors 0, warnings 0
    :pencil: For experts only: Jenkins output (remote access info)

  • Please resolve the open threads. -L1

  • added 1 commit

    • 2f4668f0 - Introducing a WorkDir specific VSCode workspace.

    Compare with previous version

  • This merge request affects 2 packages:

    • .vscode
    • Projects/WorkDir

    Affected files list will not be printed in this case

    Adding @akraszna ,@fpastore as watchers

    • Resolved by Attila Krasznahorkay

      I also removed statements from Projects/WorkDir/.vscode/settings.json that were exactly the same as in .vscode/settings.json. Since I think in this case VSCode should be smart enough to "merge" the settings from the two files in an appropriate way.

      Though I'm not 1000% sure. :frowning2: Unfortunately I have near zero experience with flake8. :frowning2: So I'm not absolutely sure that the plugin is working as it should on my repository...

      While tweaking these settings files, I also saw this:

      image

      I.e. some of the settings are greyed out for me, with VSCode saying that they are ineffective. Should we then remove them? (Not in this MR necessarily, since they also don't seem to cause any problems at the moment.)

  • :white_check_mark: CI Result SUCCESS (hash 2f4668f0)

    Athena AthSimulation AthGeneration AnalysisBase AthAnalysis DetCommon
    externals :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    cmake :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    make :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    tests :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:

    Full details available on this CI monitor view. Check the JIRA CI status board for known problems
    :white_check_mark: Athena: number of compilation errors 0, warnings 0
    :white_check_mark: AthSimulation: number of compilation errors 0, warnings 0
    :white_check_mark: AthGeneration: number of compilation errors 0, warnings 0
    :white_check_mark: AnalysisBase: number of compilation errors 0, warnings 0
    :white_check_mark: AthAnalysis: number of compilation errors 0, warnings 0
    :white_check_mark: DetCommon: number of compilation errors 0, warnings 0
    :pencil: For experts only: Jenkins output (remote access info)

  • Hi @akraszna ! There are open threads. Could you please have a look? Thanks, L1 (Fábio).

  • Attila Krasznahorkay marked this merge request as draft

    marked this merge request as draft

  • I just made it a draft for now. No need for the L1 shifter to keep bumping into this MR...

  • added 1 commit

    • ab9db165 - Introducing a WorkDir specific VSCode workspace.

    Compare with previous version

  • added 744 commits

    Compare with previous version

  • Attila Krasznahorkay marked this merge request as ready

    marked this merge request as ready

  • This merge request affects 2 packages:

    • .vscode
    • Projects/WorkDir

    Affected files list will not be printed in this case

    Adding @fpastore ,@akraszna as watchers

    • Resolved by Attila Krasznahorkay

      It's not in the scope of this MR, but one can even twist the arm of VSCode to provide a graphical debugger for Athena jobs. :grin:

      image

      I'll likely start doing such things in the future. As clicking on a line to set up a breakpoint on it is just so much easier than anything I was doing in the past... :thinking:

  • Tadej Novak resolved all threads

    resolved all threads

  • :white_check_mark: CI Result SUCCESS (hash aef2bcde)

    Athena AthSimulation AthGeneration AnalysisBase AthAnalysis DetCommon
    externals :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    cmake :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    make :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    tests :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:

    Full details available on this CI monitor view. Check the JIRA CI status board for known problems
    :white_check_mark: Athena: number of compilation errors 0, warnings 0
    :white_check_mark: AthSimulation: number of compilation errors 0, warnings 0
    :white_check_mark: AthGeneration: number of compilation errors 0, warnings 0
    :white_check_mark: AnalysisBase: number of compilation errors 0, warnings 0
    :white_check_mark: AthAnalysis: number of compilation errors 0, warnings 0
    :white_check_mark: DetCommon: number of compilation errors 0, warnings 0
    :pencil: For experts only: Jenkins output (remote access info)

  • Approving for L1. -L1

  • Attila Krasznahorkay resolved all threads

    resolved all threads

  • mentioned in commit fc9cf4e0

  • Please register or sign in to reply
    Loading