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

Error reading config: open .bazel_fix_commands.json: no such file or directory #369

Closed
flolu opened this issue Mar 26, 2020 · 7 comments
Closed
Labels

Comments

@flolu
Copy link

flolu commented Mar 26, 2020

I have a ts_devserver in one of my BUILD files which serves an Angular application. Everything works fine, but in the console there is always an error:

iBazel [8:10PM]: Error reading config: open .bazel_fix_commands.json: no such file or directory

Screenshot from 2020-03-26 20-18-48

.bazel_fix_commands.json should only be searched for when adding the --run_output flag, which I didn't.

Can I safely ignore this error? How can it be fixed?

@deadmoose
Copy link

.bazel_fix_commands.json should only be searched for when adding the --run_output flag, which I didn't.

#349 flipped --run_output on by default, so it'll always try to read that & carp that it's missing.

@achew22
Copy link
Member

achew22 commented Apr 13, 2020

Sorry to be slow on this, I switched jobs so things are a bit hectic in my life right now. Yes that is safe to ignore. The other option would be to create either an empty .bzel_fix_commands.json or put something in there to invoke a tool during build errors.

Here is a simple one that invokes bazel run //:gazelle when it is necessary.

[{
    "regex": "^Check that imports in Go sources match importpath attributes in deps.$",
    "command": "bazel",
    "args":    ["run", "//:gazelle"]
}]

@deadmoose
Copy link

Just creating an empty one isn't enough either, since that results in a DIFFERENT error message when it fails to parse it into the expected structure. (And then continue along with the default built-in, which I'd argue is the wrong behavior when faced with explicitly malformed input)

@achew22
Copy link
Member

achew22 commented Apr 13, 2020

Sorry, I meant empty to be an empty array, [], which should silence the array. English remains difficult. If you would like to enhance the error handling there, I would be very happy to merge anything in that vein.

@flolu
Copy link
Author

flolu commented Apr 14, 2020

@achew22 Thanks for your help. Adding a .bzel_fix_commands.json file with this content:

[]

into the root of my Bazel project fixed the issue 👍

@flolu flolu closed this as completed Apr 14, 2020
@achew22
Copy link
Member

achew22 commented Apr 14, 2020

We've solved the obvious manifestation of this issue, but I don't think we've solved the real issue. It shouldn't complain like that if there isn't a .bazel_fix_commands.json file. It should link to some documentation that says something like "Hey, there is a nifty feature you can turn on over here if you want to run it". This issue now tracks that usability bug.

@achew22 achew22 reopened this Apr 14, 2020
@achew22 achew22 added the bug label Apr 14, 2020
flolu added a commit to flolu/centsideas that referenced this issue Apr 14, 2020
@achew22
Copy link
Member

achew22 commented Apr 24, 2020

This is now fixed and released in v0.13.0. The usability issue has been addressed by printing out a banner warning each time ibazel is launched (but not on every file change) to notify of the functionality and a pointer to documentation describing how to address.

@achew22 achew22 closed this as completed Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants