PMunch / ratel

128 stars 4 forks source link

Add -d:standalone flag to make random happy #4

Closed PMunch closed 2 years ago

PMunch commented 2 years ago

Encountered this while working with polymorph, it imports random which in turn will import os if it should support initialising the random number generator without a seed. The OS module just throws an error if you try to import it without platform support (even if you don't actually use anything that requires it (and even if you only use it from a macro (yes, this is dumb))) so even though polymorph never calls the procedures which require the OS module, the compilation will fail (and not with a nice import trace telling me where the OS module came from, I had to go digging with strace to figure that out (yay...). So in order to avoid this headache for other users I think -d:standalone should be added to the default flags that Ratel uses once https://github.com/PMunch/ratel/issues/3 is implemented.

PMunch commented 2 years ago

This should be done in https://github.com/PMunch/ratel/commit/ee1ce1a3abf8fd5921c29450577dfec8da56015f