-
Notifications
You must be signed in to change notification settings - Fork 107
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
UX improvement: godebug <run, test, build>
#8
Comments
The generated source can be perhaps kept under What do you think? |
That's a nice idea. I had been working on a version that throws away the generated code every time, but I think something like this can work. We can do it without rewriting import paths, too. I want godebug to support instrumenting a subset of the packages in the program, though, and that subset can be different each time the user runs the command. So I want the A downside of my proposal is that concurrent runs of the godebug tool will interfere with each other. One workaround for that is to have godebug check a lock file on startup, and if it finds another instance running it does all of its work in a new temporary directory. |
I like the idea of multi GOPATH better. The issue of concurrency can be mitigated with having a GOPATH per project under |
How ever you do it, I would make it really easy to know, in fact it should be blindingly obvious, if a binary contains any debug information from godebug at all. You don't want to accidentally release a build with debug info in it. Both for security and for performance. |
@glycerine good point. I thought about this a bit and have two proposals:
If stdin is closed, the program is halted. Thoughts? |
@omeid that's a good idea. A downside of GOPATH directory per package is that it results in a quadratic search for packages. For example, if a build transitively includes 100 packages and all of them are godebug-enabled, then the But even for 100 packages this isn't much work. It would take thousands of packages, all instrumented in the same build, for this to become a problem. That seems unrealistic for now. |
Another factor worth noting: the |
@jeremyschlatter I don't see how you would be looking up more than one directory, you keep the instrumented source in |
About #8 Also some small bits of refactoring
@omeid ah, I think I misunderstood your suggestion. Is this what you are envisioning?
Each time godebug runs it generates a temporary GOPATH directory that contains symlinks to only the packages that we want to instrument, then prepends that directory to the user's GOPATH. The ^ This is cleaner than what I was thinking. Is this the same thing you were imagining? |
Yup, that is exactly what I meant by having a GOPATH per project under godebug with packages selected for instrumentation linked from the godebug/{src,pkg}. |
@jeremyschlatter Sounds good--together those two precautions should catch most unintended debug -compiles. |
Currently, godebug requires you to overwrite your files with the code-generated versions. It would be a big UX improvement to generate the files in a temporary directory and run them in a single step, like
go test
and go coverage.The text was updated successfully, but these errors were encountered: