Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Conversation

@danhper
Copy link
Contributor

@danhper danhper commented Apr 23, 2020

I was getting a spawnSync /bin/sh ENOBUFS when trying to use the native solc command to compile.
It is because the stdin buffer size is 1MB by default and execSync was trying to pass more data.
I increased that to 10MB. It is far from perfect but at least it should do the job for most cases.

The other changes are because of eslint (git hook was failing). Let me know if you would prefer me to revert these.

gnidan
gnidan previously requested changes Apr 23, 2020
Copy link
Contributor

@gnidan gnidan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the quote style change, this looks good!

@gnidan
Copy link
Contributor

gnidan commented Apr 23, 2020

If you undo the quote style changes, I'll take a stab at fixing eslint

@gnidan
Copy link
Contributor

gnidan commented Apr 23, 2020

Thank you for this btw!

@danhper danhper force-pushed the increase-native-buffer-size branch from 020e0a9 to d6a90cd Compare April 24, 2020 17:07
@danhper
Copy link
Contributor Author

danhper commented Apr 24, 2020

Thanks for the quick reply. I removed all the style changes.

@gnidan
Copy link
Contributor

gnidan commented Apr 24, 2020

Cool, thank you! Hopefully we'll have the build fixed today so we can merge this!

@danhper
Copy link
Contributor Author

danhper commented Apr 28, 2020

Tests seem to be passing so hopefully it should be good to merge?

@gnidan gnidan dismissed their stale review April 28, 2020 20:53

Requested changes made

};
} catch (error) {
if (error.message === "No matching version found") {
throw this.errors("noVersion", versionString);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why'd you remove this invocation? Don't we need to handle this case? (@eggplantzzz do you know?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I am missing something, this is returning an object and not executing anything, so there is no way that it will raise an exception at this point.
compile might fail later on but having the try/catch here will not help.
Simplified example:

var a;
// try/catch not helping
try {
  a = () => { thrown RuntimeError('asdf') }
} catch (e) { console.log(e) }
a() // will not be caught

TBH I changed this mainly to please eslint so if you think it's better to keep this for another PR I can of course revert this change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I prefer leaving code alone unless the change is warranted. @eggplantzzz added that line and I suspect it does something important.

It'll definitely make this an easy merge at this point if you restrict this PR to just the max buffer change. Happy to figure out the error handling business in an issue or a subsequent PR (you could very well be right, but I just don't want to keep you waiting on this particular issue... would love to get your fix here out in this week's release!)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, sounds good.
Sorry for the back and forth, I think this is now as minimal as it gets in terms of changes.

@danhper danhper force-pushed the increase-native-buffer-size branch from 1a8a826 to 180359b Compare April 29, 2020 01:22
@eggplantzzz
Copy link
Contributor

This seems like it is ok to me. Something is weird with the CI it seems

@eggplantzzz
Copy link
Contributor

Looks like merging the most recent stuff on develop got it passing again.

@gnidan
Copy link
Contributor

gnidan commented May 9, 2020

Thanks again for this, getting this into the release!

@gnidan gnidan merged commit 4233b2d into ConsenSys-archive:develop May 9, 2020
@danhper danhper deleted the increase-native-buffer-size branch May 9, 2020 15:40
@CruzMolina CruzMolina mentioned this pull request Jul 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants