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

Incremental build under debug configuration ? #44

Open
mediabuff opened this issue Feb 4, 2024 · 2 comments
Open

Incremental build under debug configuration ? #44

mediabuff opened this issue Feb 4, 2024 · 2 comments

Comments

@mediabuff
Copy link

Does Incremental build under debug configuration work ? Every time I change a single source file, I have to a 'clean' and 'build''. Otherwise I get source out of sync error

image

@parthopdas
Copy link
Member

I have seen this issue (as I use the extension on projects like burn). However I am yet to notice a pattern. For sure it isn't that an incremental build does not work.

Any observations / suggestions will be helpful.

@jerrywrice
Copy link

jerrywrice commented May 11, 2024

I don't know how you created your project, or what went wrong, but the following might be useful information. Note that I'm using VS2022 Professional for AMDx64 architecture, with the VS2022 C/C++ MSBuild components installed. I obviously have the latest standard rust compiler and tools installed. I've also installed 'rust-analyzer.vs' extension V2.0.187 in my VS2022. I opened my rust project folder that was created with 'cargo'. Upon opening my rust project folder with VS2022 the first time, rather than generating an 'incremental' configuration that this issue mentions, it instead generated a 'bin' configuration. This 'bin' configuration selection (a debug build), specifically performs an incremental build (builds only the project files which have changed since the last successful build). In my case, my Windows rust application project folder (name) is 'demo-gtk-app', so the build configuration is shown as '[bin: ] demo-gtk-app.exe'. My suggestion is (after backing up your current project folder/files), re-generate your project folder from scratch using either 'cargo new ' or another means you're familiar with. Recreate a standard cargo project folder. and tweak its 'cargo.toml' file so that it allows you to successfully build your project (with 'cargo build ...'). After successfully building and running your application in a terminal window with cargo, open your Visual Studio 20xx, and execute an 'Open Local Folder/File' to select your cargo project's top-level folder. Upon opening the first time, the 'rust-analyzer.vs' extension should automatically recognize that you've selected a rust project folder, and will perform some additional setup/configuration. Next confirm you have a '[bin: ] <application-name.exe>' build configuration defined. This method should also translate to a library project as well - although I haven't done so with Visual Studio yet, so the build configuration might be named something other than 'bin' for a library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants