My contractor has put a mechanics lien on my house.
While you are free to file bankruptcy, the mechanic's lien will function as a secured lien against the property, to be paid first out of the bankrputcy estate (or, if there is a mortgage which predates the mechanic's lien, after the morgator is paid).
Good luck!