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

Show git dirtiness before throwing an error #135

Open
moble opened this issue Jun 10, 2021 · 1 comment
Open

Show git dirtiness before throwing an error #135

moble opened this issue Jun 10, 2021 · 1 comment

Comments

@moble
Copy link
Contributor

moble commented Jun 10, 2021

I ran into an error while benchmarking that was pretty hard to track down:

ERROR: /home/runner/work/MyProject.jl/MyProject.jl is dirty. Please commit/stash your changes before benchmarking a specific commit

But the code was a fresh checkout that I hadn't (intentionally) modified. Googling only turned up this discussion, which advised gitignoring some files I was already ignoring. It took me longer than it should have to figure out that the problem was actually something in the build process changing Project.toml. (I had manually edited the [compat] list, and failed to realize that uppercase precedes lowercase, but something in the build process helpfully rectified that mistake, leaving my repo dirty.)

Maybe part of the error message could show the git status and/or diff to show what's actually dirty?

@behinger
Copy link

behinger commented Feb 9, 2022

I have the same issue.

How did you even debug it? I only manage to elicit it on github, which makes debugging very slow.

Edit: I sucessfully debugged it now as follows: My benchmark.jl contained the line:

# dc / X_Gen_lin is arbitrary
SUITE["dc"]["X_gen_lin"] = @benchmarkable read(run(`git diff Project.toml`))

Earlier versions had git status to identify the problematic file. This finally gave me output on what was wrong.
In my case the /project/Project.toml did not contain BenchmarkCI. After adding it, it worked fine...

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

2 participants