Comments (6)
Thank you for such detailed explanation!
Because I'm not familiar with code I was trying to see how BuildXL works by putting breakpoints on different places and run HelloWorld example. And as a result, I usually have to do few iterations like this:
- add
Debugger.Launch()
- build via
bxl.cmd
- run
...\Out\Bin\Debug\win-x64 /c:config.dsc
in HelloWorld directory - Attach debugger to see if this was right place
- Sometimes switching to second copy to browse thru code
- Remove
Debugger.Launch()
This constant switching is killing me and I was secretly hoping that there is better way :) Like setup external program and parameters, put breakpoint and press F5 in VS. Then I actually tried it and it works! Last time I was too concentrating on forcing VS to build that project that I actually never tried it.
And because I almost never change code, it works for me. And I can run it manually or setup Post-Build event to run bxl.cmd -minimal
.
Thank you very much for you help!
Vlad
from buildxl.
Hello Vlad,
Unfortunately our VS integration is not optimal -- the easiest way to debug is to set the BuildXLDebugOnStart
environment variable to 1
. This will launch the debugger at the beginning of BuildXL's execution, so you don't have to add the Launch()
line yourself. While debugging your own changes you should build BuildXL with bxl [-minimal] -deploy Dev
and then execute using bxl -use Dev
. This will ensure the correct symbols are loaded so VS will hit all your breakpoints.
To debug while running a test adding the explicit Debugger.Launch()
line at the beginning of the test is best, because the tests will run in a separate process so the whole environment variable thing described above won't work.
from buildxl.
Thank you for your answer. I tried this way and it didn't work nicely. If I use BuildXLDebugOnStart
then breakpoint in other modules would not hit.
I tried to use Debugger.Launch()
and it works better because bxl.exe is stay running for some time and I can put breakpoint later or earlier in execution stages.
But in both cases I cannot do code navigation. Only navigation in current module is working and if class is from different module then Ctrl+Click does not work. Most classes have quite nice and helpful description that helps understanding. But because Ctrl+Click does not work, I cannot see it. As result I have to keep 2 instances of Visual Studio, one for debug and one for browsing code and experience quite code.
If I may ask, what approach/tools are you using to debug and develop BuildXL?
Vlad
from buildxl.
May I ask how you are building the project? Are you building the VS solution with bxl -vs
? Does code navigation work when you are not debugging?
We use Visual Studio and debug the way I described. While building the solution (using bxl -vs
) you shouldn't apply any filters or run with -minimal
or you may hit some of the issues you're describing with code navigation.
Additionally, note that BuildXL sometimes runs in a "server mode" to save some time in successive executions: this leaves a running bxl.exe
process after executing (this may not be causing any issues for you but sometimes it can interfere when you are making changes and want to rerun a new version of your changes). You can run in single-instance mode by killing this surviving process (there's also a killbxl.cmd
in the repo root that does this) and running with the /server-
argument.
from buildxl.
I ran bxl -vs
only once because I don't do any changes to code except putting Debugger.Launch()
. Code navigation works without any problems.
I'm building project using bxl.cmd -minimal
.
Just to double check, it is not possible to build anything from VS and VS is only for code navigation, right?
from buildxl.
Building from VS (using F5) should work in theory, although to be honest I never use it :(
My usual workflow for debugging my changes is
- Build my changes with
bxl.cmd -minimal -Deploy dev
. This will build and deploy the binaries toOut\Selfhost\Dev
set BuildXLDebugOnStart=1
- Run a build with my newly built binaries, either with
bxl.cmd -minimal -Use dev
(this will execute the script using theOut\Selfhost\Dev
binaries) or usingOut\Selfhost\Dev\bxl.exe
directly. As long as you don't-deploy Dev
again these binaries won't change.
For launching the debugger in a test, it suffices to add the Debugger.Launch()
to the test and then run the test with bxl.cmd -TestMethod [FullyQualifiedTestMethodName] [NameOfModule].dsc
. No -Deploy dev
needed here.
For example for the ConcurrentBigMapTests.TestConcurrentBigMapOperations
test in BuildXL.Utilities.Collections.dsc
I would run:
bxl.cmd -TestMethod Test.BuildXL.Utilities.ConcurrentBigMapTests.TestConcurrentBigMapOperations Test.BuildXL.Utilities.dsc
You can also test the whole class like this:
bxl.cmd -TestClass Test.BuildXL.Utilities.ConcurrentBigMapTests Test.BuildXL.Utilities.dsc
I hope this helps.
from buildxl.
Related Issues (20)
- FileContentTable does not work optimally when file belongs to more than one FileContentTable HOT 14
- Unclear how to build BuildXL for Linux HOT 2
- Build scripts incorrectly report that Visual Studio 2017 build tools are required HOT 1
- BuildXL will sends requests for additional files back to the originating machine? HOT 1
- When Ninja Added BuildXL option, error CX0000005 was reported when using VS2022 to test the project. HOT 1
- Build process exited with ArgumentTransformationMetadataException HOT 2
- Distributed Builds using BuildXL HOT 2
- Easy: Solution-> BuildXL file
- Update documentation needed for Visual studio 2022 HOT 1
- Cannot run minimal build HOT 2
- Cannot build Visual Studio plugin HOT 2
- Setting up a distributed build with the public version HOT 3
- buildXL fail on Assertion failed (runningPips == 0): There are still pips at running HOT 2
- Getting error while trying to build the Hello World MsBuild Example HOT 2
- Will BuildXL work with Visual Studio 2015 HOT 1
- More document about download packages HOT 1
- DetoursServices: PathFromObjectAttributesViaId causes offline files to be recalled HOT 4
- error DX11233: Hexadecimal digit expected HOT 1
- BuildXL Win64 DX0059: RunInSubst.exe Cannot Be Found HOT 7
- Building multiple msbuild projects which inherit the same projects HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from buildxl.