Ignore build files for VS and VS Code #105513

Merged
Ray molenkamp merged 5 commits from bonj/blender:ignore-vs-and-vsc-build-files into main 2023-03-07 17:38:46 +01:00
Contributor

I like using these tools, but it's a bit tedious having to carefully avoid committing their build and config files.

Visual Studio:

  • The out folder is for build files.
  • The file CMakeSettings.json lets you configure your build, and has a handy UI in VS.
  • The file CMakeProperties.json does the same minus the UI, but is natively supported by CMake.

Visual Studio Code:

  • The folder build is for build files generated by the CMake Integration extension.
I like using these tools, but it's a bit tedious having to carefully avoid committing their build and config files. Visual Studio: - The out folder is for build files. - The file CMakeSettings.json lets you configure your build, and has a handy UI in VS. - The file CMakeProperties.json does the same minus the UI, but is natively supported by CMake. Visual Studio Code: - The folder build is for build files generated by the CMake Integration extension.
Jorijn de Graaf added 1 commit 2023-03-07 00:19:05 +01:00
I like using these tools, but it's a bit tedious having to carefully avoid committing their build and config files.

Visual Studio:
- The out folder is for build files.
- The file CMakeSettings.json lets you configure your build, and has a handy UI in VS.
- The file CMakeProperties.json does the same minus the UI, but is natively supported by CMake.
The file CppProperties.json is for configuring C/C++ related settings.

Visual Studio Code:
- The folder build is for build files.
- The file c_cpp_properties.json is for configuring C/C++ related settings.
Author
Contributor

Maybe I should move CMakeProperties.json into its own section, because it's supported by CMake natively.
I'm fine with the current placement too though.

Maybe I should move CMakeProperties.json into its own section, because it's supported by CMake natively. I'm fine with the current placement too though.
Ray molenkamp requested review from Jacques Lucke 2023-03-07 02:48:34 +01:00
Ray molenkamp requested review from Ray molenkamp 2023-03-07 02:48:34 +01:00
Member

VS looks fine, i'd like to get @JacquesLucke opinion on the vscode additions though

VS looks fine, i'd like to get @JacquesLucke opinion on the vscode additions though
Author
Contributor

I'll need to double check where those C/C++ json files go actually, because if they go in a .vs* folder, there's no need the ignore them explicitly.

I'll need to double check where those C/C++ json files go actually, because if they go in a .vs* folder, there's no need the ignore them explicitly.
Member

I gave you the greenlight for a single VS related ignore, you submitted a patch with a whole bunch of other stuff in it, which I had to ask a second reviewer time for, and you're now not sure about some of it, I gotta admit, this was supposed to be a 1 line patch, approved and landed in under 5 minutes, it wasn't supposed to drag and feature creep like this

I gave you the greenlight for a single VS related ignore, you submitted a patch with a whole bunch of other stuff in it, which I had to ask a second reviewer time for, and you're now not sure about some of it, I gotta admit, this was supposed to be a 1 line patch, approved and landed in under 5 minutes, it wasn't supposed to drag and feature creep like this
Member

My vscode config files are always in the .vscode which is ignore for me already. I never ran into the problem that vscode adds files to the repo. You should demonstrate how to reproduce how those files are added automatically.

My vscode config files are always in the `.vscode` which is ignore for me already. I never ran into the problem that vscode adds files to the repo. You should demonstrate how to reproduce how those files are added automatically.
Author
Contributor

My vscode config files are always in the .vscode which is ignore for me already. I never ran into the problem that vscode adds files to the repo. You should demonstrate how to reproduce how those files are added automatically.

The build folder is created by the CMake Integration extension.
The CPP json file probably goes in the .vscode folder though, so I'll get rid of that one.
I assumed that the "workspace folder" in the VS/VSC docs would refer to like the folder you have open, but in hindsight it probably refers to the .vs* folder.

> My vscode config files are always in the `.vscode` which is ignore for me already. I never ran into the problem that vscode adds files to the repo. You should demonstrate how to reproduce how those files are added automatically. The build folder is created by the [CMake Integration extension](https://marketplace.visualstudio.com/items?itemName=go2sh.cmake-integration-vscode). The CPP json file probably goes in the .vscode folder though, so I'll get rid of that one. I assumed that the "workspace folder" in the VS/VSC docs would refer to like the folder you have open, but in hindsight it probably refers to the .vs* folder.
Jorijn de Graaf added 1 commit 2023-03-07 14:17:10 +01:00
In hindsight I think the CPP related config files are generated in already ignored folders, so I guess those don't need to be here.
I've moved the remaining lines into one section together.
Author
Contributor

I gave you the greenlight for a single VS related ignore, you submitted a patch with a whole bunch of other stuff in it, ...

In my issue I specified multiple things that needed to be gitignored.
I could make multiple PRs but I think it'd be silly.

> I gave you the greenlight for a single VS related ignore, you submitted a patch with a whole bunch of other stuff in it, ... In my issue I specified multiple things that needed to be gitignored. I could make multiple PRs but I think it'd be silly.
Author
Contributor

Anyway I got rid of the CPP related json files now as they are probably not necessary; I suppose I misunderstood the documentation initially.
The remaining 4 lines are necessary though.

Anyway I got rid of the CPP related json files now as they are probably not necessary; I suppose I misunderstood the documentation initially. The remaining 4 lines are necessary though.
Jorijn de Graaf added 1 commit 2023-03-07 14:27:49 +01:00

Ignoring CMakeSettings.json and CMakePresets.json looks fine. But I'm not sure about the ./out and ./build directories.

I'm not sure if it's a good practice to put the build files inside the repository whose files are affected by CMake.

Explicitly showing that we ignore these files seems to encourage the practice.

And for non experienced developers these directories can be created by VS without them being aware.

Ignoring `CMakeSettings.json` and `CMakePresets.json` looks fine. But I'm not sure about the `./out` and `./build` directories. I'm not sure if it's a good practice to put the build files inside the repository whose files are affected by CMake. Explicitly showing that we ignore these files seems to encourage the practice. And for non experienced developers these directories can be created by VS without them being aware.
Member

I'm not sure if it's a good practice to put the build files inside the repository whose files are affected by CMake.

VS is just bad in this regard, out of tree builds just aren't a concept they seem to grasp, this has been known for better part of a decade now and they seem unlikely to change their minds there, best we can do is minimize the damage of their bad practices, and ignores seem like a pretty good way to go about that.

Explicitly showing that we ignore these files seems to encourage the practice.

There's a fine distinction encouraging/supporting and allowing some niceties for people off the beaten path.

If people want to ignore our best practices for some reason that's fine, some of them will have good reasons, some of them perhaps not, who are we to judge? Either way people have to freedom to do whatever they like. It's one of the many things that makes opensource great. If adding a few ignores makes their environment just a smidge better, I see no reason not to do that, there are limitations though.....

Expecting us to fully support and document how you would configure the IDE for this setup and help people in the future that run into issues, is a whole different story and not something I'm willing to entertain, and also not something @bonj is pushing for here.

Also it can't interfere with any supported scenario's which it currently doesn't do, so yeah I have no issues with this.

Bit concerned about how much of my time this seemingly trivial diff is taking, but beyond that I'm a happy camper.

> I'm not sure if it's a good practice to put the build files inside the repository whose files are affected by CMake. VS is just bad in this regard, out of tree builds just aren't a concept they seem to grasp, this has been known for better part of a decade now and they seem unlikely to change their minds there, best we can do is minimize the damage of their bad practices, and ignores seem like a pretty good way to go about that. > Explicitly showing that we ignore these files seems to encourage the practice. There's a fine distinction encouraging/supporting and allowing some niceties for people off the beaten path. If people want to ignore our best practices for some reason that's fine, some of them will have good reasons, some of them perhaps not, who are we to judge? Either way people have to freedom to do whatever they like. It's one of the many things that makes opensource great. If adding a few ignores makes their environment just a smidge better, I see no reason not to do that, there are limitations though..... Expecting us to fully support and document how you would configure the IDE for this setup and help people in the future that run into issues, is a whole different story and not something I'm willing to entertain, and also not something @bonj is pushing for here. Also it can't interfere with any supported scenario's which it currently doesn't do, so yeah I have no issues with this. Bit concerned about how much of my time this seemingly trivial diff is taking, but beyond that I'm a happy camper.

I like using these tools, but it's a bit tedious having to carefully avoid committing their build and config files.

Why don't you list these files in /blender/.git/info/exclude?

You only configure it once and do not even have to touch blender/.gitignore

> I like using these tools, but it's a bit tedious having to carefully avoid committing their build and config files. Why don't you list these files in `/blender/.git/info/exclude`? You only configure it once and do not even have to touch `blender/.gitignore`
Author
Contributor

Why don't you list these files in /blender/.git/info/exclude?

I'm not familiar with this technique, will have to try it out.
Still I think gitignore is a better solution, because that way it's setup for everyone, instead of needing to mention this in a guide somewhere.

> Why don't you list these files in `/blender/.git/info/exclude`? I'm not familiar with this technique, will have to try it out. Still I think gitignore is a better solution, because that way it's setup for everyone, instead of needing to mention this in a guide somewhere.
Member

Testing locally i'm only seeing an /out directory and and out/build folder, can you validate where your /build folder is coming from?

Testing locally i'm only seeing an `/out` directory and and `out/build` folder, can you validate where your `/build` folder is coming from?

Not I'm not really against it.
Just listed a few points of concern to balance.
But it doesn't really seem like something to worry about too much.

Not I'm not really against it. Just listed a few points of concern to balance. But it doesn't really seem like something to worry about too much.
Author
Contributor

Testing locally i'm only seeing an /out directory and and out/build folder, can you validate where your /build folder is coming from?

It's not from VS but VS Code, specifically the CMake Integration extension.
I could make a separate PR for this if you prefer to keep this one just about VS.

> Testing locally i'm only seeing an `/out` directory and and `out/build` folder, can you validate where your `/build` folder is coming from? It's not from VS but VS Code, specifically the CMake Integration extension. I could make a separate PR for this if you prefer to keep this one just about VS.
Author
Contributor

Bit concerned about how much of my time this seemingly trivial diff is taking, but beyond that I'm a happy camper.

I apologize for my incompetence, it will happen again.

> Bit concerned about how much of my time this seemingly trivial diff is taking, but beyond that I'm a happy camper. I apologize for my incompetence, it will happen again.
Ray molenkamp added 1 commit 2023-03-07 17:22:58 +01:00
Jorijn de Graaf added 1 commit 2023-03-07 17:24:26 +01:00
https://learn.microsoft.com/en-us/cpp/build/cmake-presets-vs?view=msvc-170
CMakePresets.json is for project wide builds, CMakeUserPresets.json is for developers to save their own local builds.
I think it makes sense to ignore them both.
Author
Contributor

Oh I didn't see you merged main just now. I hope my extra commit doesn't mess anything up.

Oh I didn't see you merged main just now. I hope my extra commit doesn't mess anything up.
Ray molenkamp merged commit 393d5aac59 into main 2023-03-07 17:38:46 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#105513
No description provided.