solc-js icon indicating copy to clipboard operation
solc-js copied to clipboard

Solidity <0.4.9 doesn't give file paths; is there any way for wrapper to repair this?

Open haltman-at opened this issue 3 years ago • 3 comments

Again, filing this issue based on discussion in #555. Currently Truffle doesn't support Solidity <0.4.9 because the (wrapped) compiler output doesn't give file paths, but rather just groups every contract under the empty path. Over on #555, @cameel suggested it might be possible for solc/wrapper to repair this? I certainly hadn't considered that possibility! Well, just in case it is, I'm filing this issue as suggested. :)

haltman-at avatar Oct 12 '21 22:10 haltman-at

This one is tricky. The problem is that the information is not there. I think it would be possible to reconstruct it based on the input as long as it's unambiguous. If you have multiple contracts with the same name in the input though, it's not going to be fixable - unless there's some other place in the output that does have paths. I'd have to take a look at the output format on this specific version.

cameel avatar Oct 13 '21 16:10 cameel

Yes, that's part of why I assumed this wasn't actually possible and hadn't considered asking for it until you suggested it...

haltman-at avatar Oct 13 '21 16:10 haltman-at

@chriseth says that this is ok in the wrapper as long as it's not too complicated so I'll try to add a workaround when I have some time to work in this. In case anyone else would like to take this, PRs are welcome :)

cameel avatar Oct 13 '21 16:10 cameel