| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
LGTM. An idea for allowing specifying the stdlib dir, you could maybe allow a DirFromEnv CompilationSourceKind?
Sorry, something went wrong.
|
|
||
| fn compile_dir( | ||
| &self, | ||
| path: &PathBuf, |
There was a problem hiding this comment.
| path: &PathBuf, | |
| path: &Path, |
Sorry, something went wrong.
There was a problem hiding this comment.
Why is this better?
Sorry, something went wrong.
There was a problem hiding this comment.
PathBuf vs Path is akin to String vs str - an owned, allocated buffer vs a slice. Like you should (almost) always prefer &str over &String, so should you for &Path over &PathBuf.
Sorry, something went wrong.
| use ::rustpython_vm::__exports::bincode; | ||
| bincode::deserialize::<::rustpython_vm::bytecode::CodeObject>(#bytes) | ||
| .expect("Deserializing CodeObject failed") | ||
| hashmap! { |
There was a problem hiding this comment.
You should probably add hashmap to __exports and use it here.
Sorry, something went wrong.
There was a problem hiding this comment.
What is the purpose of the __exports? This is my first time using procedural macro
Sorry, something went wrong.
There was a problem hiding this comment.
I think I understand what __exports do. Added hashmap
Sorry, something went wrong.
|
Btw, I opened this issue in pyckitup: pickitup247/pyckitup#4 they might be interested in this. |
Sorry, something went wrong.
We should probably add the ability to freeze any directory.
I can get the directory from an environment variable but I hoped for something easier. |
Sorry, something went wrong.
|
Ah yeah, I think that's the best way to go for configuration, as Rust doesn't have anything like that built in. We've done similar configuration in env variables before, e.g. BUILDTIME_RUSTPYTHONPATH |
Sorry, something went wrong.
|
I sorta glazed over this when I reviewed earlier, but I don't think that it should always return a HashMap, it should only do that when the source is Dir. |
Sorry, something went wrong.
I am not sure about that... I prefer that py_compile_bytecode will return the same type on all cases. I think it will be confusing otherwise. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
As discussed in #1142.
Adding the current Lib folder increase the executable by 5MB. I would like to add this to the demo so it will support python stdlib.
I wanted to allow specifying the location of the stdlib dir with a compilation flag but could not find out how to do that. @coolreader18 any suggestions?