-
Notifications
You must be signed in to change notification settings - Fork 34
Bug 1790035 - Write python script to temp file, execute, then delete #1500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug 1790035 - Write python script to temp file, execute, then delete #1500
Conversation
On Windows, users were unable to use the `npm run glean` command because the way we passed the python script as a long, template literal broke the CLI. By moving that script to its own file, executing it, then deleting it, we are able to successfully run the command.
|
@Dexterp37 Either way, I think it would be good for us to chat about this and how you currently run |
I believe we should stick, for now, to generating a temporary file with the content of the script, if only for consistency with the other SDKs which have the script "embedded" in the cli/plugin used for building Glean products.
What are you seeing?
Happy to chat! |
Co-authored-by: Alessio Placitelli <alessio.placitelli@gmail.com>
Using a temporary directory sounds like a better idea, I will make some updates.
When I try to run |
Instead of creating and deleting a python script on the local file system, we can write to the OS tmpdir and execute our script from there.
|
@Dexterp37 Testing inside of Glean.js
Testing sample projectI also copied over all the code into the sample project, patched the |
Dexterp37
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there! We should use log (as it's used throughout the file). We're good to go after these two last changes.
Co-authored-by: Alessio Placitelli <alessio.placitelli@gmail.com>
Dexterp37
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to merge with the one final change below merged. Thanks!
Co-authored-by: Alessio Placitelli <alessio.placitelli@gmail.com>
|
@Dexterp37 |
No worries that's why we have code reviews :-) |
On Windows, users were unable to use the
npm run gleancommand because the way we passed the python script as a long, template literal broke the CLI. By moving that script to its own file, executing it, then deleting it, we are able to successfully run the command.I tested this on Mac and Windows and I am now able to get my
pingsfile generated when runningnpm run glean.This is a bug fix, it does not require documentation changes.
Pull Request checklist
glean/folder, run:npm run testRuns all testsnpm run lintRuns all lintersCHANGELOG.mdor an explanation of why it does not need onemozilla/gleanrepository