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

Jobs can mess up builds with --keepFiles #2411

Open
timcassell opened this issue Aug 20, 2023 · 0 comments · May be fixed by #2423
Open

Jobs can mess up builds with --keepFiles #2411

timcassell opened this issue Aug 20, 2023 · 0 comments · May be fixed by #2423
Assignees
Labels

Comments

@timcassell
Copy link
Collaborator

timcassell commented Aug 20, 2023

Jobs with provided Ids pass along those Ids when modifications are made.
CsProj is always generated with the same filename BenchmarkDotNet.Autogenerated.csproj.
When --keepFiles is specified, the generated directory uses the job Id instead of a guid.

Combine those factors, and when you try something like this, the builds will be incorrect.

DefaultConfig.Instance
    .AddJob(Job.ShortRun.WithRuntime(RuntimeMoniker.Net70.GetRuntime())) // Id is ShortRun
    .AddJob(Job.ShortRun.WithRuntime(RuntimeMoniker.NativeAot70.GetRuntime())) // Id is ShortRun
    .KeepBenchmarkFiles(true);

Orthogonally, I think the API is bad. Id is generally expected to be a unique identifier (or at least semi-unique), which is clearly not the case here. Ideally, the Id would be generated always internally, and we would only expose setting a Name rather than Id. But of course that would be a hefty breaking change.

@timcassell timcassell added the bug label Aug 20, 2023
@timcassell timcassell linked a pull request Sep 2, 2023 that will close this issue
@timcassell timcassell self-assigned this Sep 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant