-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
build: add check for lib size #24712
Conversation
scripts/build/get-dir-size.js
Outdated
const { lstatSync, readdirSync } = require("fs"); | ||
const { join } = require("path"); | ||
const { promisify } = require("util"); | ||
const execFile = promisify(require("child_process").execFile); |
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.
I don't know if is needed, but promisify not exists in node 6.
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.
Also, execFile
isn't used?
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.
Oops, this was a bad copypasta on my part 😟
I removed it 🔧
Gulpfile.js
Outdated
@@ -12,6 +12,7 @@ const clone = require("gulp-clone"); | |||
const newer = require("gulp-newer"); | |||
const tsc = require("gulp-typescript"); | |||
const tsc_oop = require("./scripts/build/gulp-typescript-oop"); | |||
const { getDirSize } = require("./scripts/build/get-dir-size"); |
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.
nit, do not use kebab-case, instead use camel case.
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.
Ok I changed it 🔧
we also need to make a similar change to jakefile.js |
Gulpfile.js
Outdated
const seq = runSequence("LKGInternal", "VerifyLKG"); | ||
const sizeAfter = getDirSize(lib); | ||
if (sizeAfter > (sizeBefore * 1.10)) { | ||
throw new Error("The lib folder increased by 10% or more. This likely indicates a bug."); |
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.
How do we want to confirm "no, this really is what we meant to do"?
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.
u can manually check in the LKG. this happens after the LKG has been built and updated.
@mhegazy Which line number in the |
I would do it after we have copied all expected files. |
@mhegazy How does that look? |
thanks! |
This adds a check to make sure the lib size doesn't increase more than 10% after the "LKG" step.
This change was suggested by mhegazy in this comment.
Related #24282