Skip to content

Commit

Permalink
chromium edits mostly
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed Nov 17, 2023
1 parent 2291ff1 commit 5eab8e1
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 28 deletions.
3 changes: 2 additions & 1 deletion .gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@


# Two utils:
# What's the ancestor commit this branch shares with main?
# What's the ancestor commit this branch shares with (the parent branch, or, more likely...) main?
# diffbase = !"git config --get branch.$(command git symbolic-ref --short HEAD).base || git merge-base origin/$(git mainormaster) HEAD"
diffbase = !"git merge-base origin/$(git mainormaster) HEAD"
# Is it a `main` or a `master` repo?
mainormaster = !"git branch --format '%(refname:short)' --sort=-committerdate --list master main | head -n1"
Expand Down
11 changes: 0 additions & 11 deletions bin/pull
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,6 @@ if grep -q chromium.googlesource.com <<<$repoUrl; then
exit 0
fi

# Install Node.js packages
narn install

# Install Bower components
if [ "$GIT_FRIENDLY_NO_BOWER" != "true" ]; then
if which npm >/dev/null 2>&1 && [ -f bower.json ]; then
echo
echo "⚔ Installing Bower components..."
bower install
fi
fi

echo
echo "🦄 Done"
Expand Down
32 changes: 22 additions & 10 deletions fish/aliases.fish
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@ function ..... ; cd ../../../.. ; end
# Utilities
function grep ; command grep --color=auto $argv ; end

# uses npm if its an npm repo. https://www.npmjs.com/package/narn
alias yarn=narn

alias li=lighthouse
alias lperf 'lighthouse --only-categories=performance'
alias comp 'node build/build-report-components.js && yarn eslint --fix report/renderer/components.js'
alias reportunit 'yarn jest (find report -iname "*-test.js" | grep -v axe)'
# pretty sure watchexec has just won my heart after years of using `entr`
alias reportwatch 'watchexec "node build/build-report-components.js && node build/build-report.js --psi && node build/build-sample-reports.js && echo \$(date) && yarn eslint --fix report/renderer/components.js" && bash core/scripts/copy-util-commonjs.sh'

# mv, rm, cp
alias mv 'command gmv --interactive --verbose'
alias rm 'command grm --interactive --verbose'
Expand Down Expand Up @@ -80,6 +70,12 @@ subcommand_abbr git cp "cherry-pick"
subcommand_abbr git cherrypick "cherry-pick"
subcommand_abbr git dif "diff"

# some of my git aliases
subcommand_abbr git db "diffbranch"
subcommand_abbr git dbt "diffbranch-that"



# can only do one of these unless I adopt lucas's setup.
subcommand_abbr npm i "install"
#subcommand_abbr pnpm i "install"
Expand Down Expand Up @@ -139,3 +135,19 @@ alias fs="stat -f \"%z bytes\""
alias brew_update="brew -v update; brew upgrade --force-bottle --cleanup; brew cleanup; brew cask cleanup; brew prune; brew doctor; npm-check -g -u"
alias update_brew_npm_gem='brew_update; npm install npm -g; npm update -g; sudo gem update --system; sudo gem update --no-document'




# project-specific shorthands

alias li=lighthouse
alias lperf 'lighthouse --only-categories=performance'
alias comp 'node build/build-report-components.js && yarn eslint --fix report/renderer/components.js'
alias reportunit 'yarn jest (find report -iname "*-test.js" | grep -v axe)'
# pretty sure watchexec has just won my heart after years of using `entr`
alias reportwatch 'watchexec "node build/build-report-components.js && node build/build-report.js --psi && node build/build-sample-reports.js && echo \$(date) && yarn eslint --fix report/renderer/components.js" && bash core/scripts/copy-util-commonjs.sh'


alias rppunit 'npm run auto-unittest -- --expanded-reporting --mocha-fgrep=Processor\|Timeline\|trace\|Appender\|Handler\|Performance'
alias rppinter 'HTML_OUTPUT_FILE=rppscreenshots.html npm run interactionstest -- --test-file-pattern="*/performance/**"'
alias rppscreen 'HTML_OUTPUT_FILE=rppscreenshots.html third_party/node/node.py --output scripts/test/run_test_suite.js --config test/interactions/test-runner-config.json --mocha-fgrep "[screenshot]" --test-file-pattern="*/performance/**"'
34 changes: 28 additions & 6 deletions fish/chromium.fish
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ function deps --description "run gclient sync"
gclient sync --delete_unversioned_trees --jobs=70 --verbose
end

function depsbg --description "run gclient sync in the background"
gclient sync --delete_unversioned_trees --jobs=70 &
end


function hooks --description "run gclient runhooks"
gclient runhooks
end
Expand All @@ -12,6 +17,15 @@ function b --description "build chromium"

ulimit -n 200000 # b/294987716

# reclient env vars from alexnj:
# RBE_racing_bias=1 RBE_cas_concurrency=3000 autoninja -C out/Default chrome
# - racing bias is a value between 0 and 1 that determines where you prefer compilation to be.
# default is set at 0.5, i.e., equal probability of something pushed to remote, vs. local.
# 1 pushes everything to remote, but I think it's overkill as well ... I'm now at 0.7
# - cas_concurrency is how many compilations in parallel.
# I'm running 2000 now resulting in 22 second incremental compilation with these values
# i think it makes sense to tune these to your network and cpu cores

set -l dir_default (grealpath $PWD/(git rev-parse --show-cdup)out/Default/)
# autoninja is better than trying to set -j and -l manually.
# and yay, nice cmd built-in, so no more need to do this: `renice +19 -n (pgrep ninja); renice +19 -n (pgrep compiler_proxy)`
Expand Down Expand Up @@ -130,7 +144,7 @@ function gom --description "run goma setup"
end

function glurpgrab0
rsync --archive --verbose --itemize-changes --compress --human-readable --delete paulirish@glurp:chromium/src/out/Mac-cross/Chromium.app $HOME/chromium/src/out/Mac-cross-from-glurp/
rsync --archive --verbose --itemize-changes --compress --human-readable --delete paulirish@glurp:chromium/src/out/Mac-cross-siso/Chromium.app $HOME/chromium/src/out/Mac-cross-from-glurp/
end

function glurpgrab --description "dl mac-cross build from glurp"
Expand All @@ -154,17 +168,25 @@ function maccr
eval $cmd
end

function maccr-flagged
# some dev flags plus chrome-launcher flags.
set -l bigcmd /Users/paulirish/chromium/src/out/Mac-cross-from-glurp/Chromium.app/Contents/MacOS/Chromium \
--user-data-dir=/tmp/glurp-mac-cross --password-store=basic --use-mock-keychain --disable-features=Translate,OptimizationHints,MediaRouter,ProcessPerSiteUpToMainFrameThreshold \
function crflags
echo --password-store=basic --use-mock-keychain --disable-features=Translate,OptimizationHints,MediaRouter,ProcessPerSiteUpToMainFrameThreshold \
--custom-devtools-frontend=file:///Users/paulirish/chromium-devtools/devtools-frontend/out/Default/gen/front_end \
--disable-extensions --disable-component-extensions-with-background-pages --disable-background-networking --disable-component-update \
--disable-client-side-phishing-detection --disable-sync --metrics-recording-only --disable-default-apps --mute-audio --no-default-browser-check \
--no-first-run --disable-backgrounding-occluded-windows --disable-renderer-backgrounding --disable-background-timer-throttling --disable-ipc-flooding-protection \
--disable-hang-monitor --enable-blink-features=BackForwardCacheNotRestoredReasons --enable-logging=stderr
--disable-hang-monitor --enable-logging=stderr $clutch_chrome_flags --user-data-dir=\(mktemp -d "$TMPDIR/chrome-profile-XXXXX"\)
# these two are also good, but tricky to escape for inclusion here: --vmodule='device_event_log*=1' --force-fieldtrials='*BackgroundTracing/default/'
end

function maccr-flagged
# some dev flags plus chrome-launcher flags.
set -l bigcmd /Users/paulirish/chromium/src/out/Mac-cross-from-glurp/Chromium.app/Contents/MacOS/Chromium (crflags)

echo " > $bigcmd"
eval $bigcmd
# --v=1
end

function git-clfastupload
git cl upload --bypass-hooks -o "banned-words~skip"
end
2 changes: 2 additions & 0 deletions fish/config.fish
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# status stack-trace

# set fish_trace 1
# fish --debug "*" # super noisy
# fish --debug "(fish --print-debug-categories)" and could start removing stuff.
function fish_greeting
end

Expand Down

0 comments on commit 5eab8e1

Please sign in to comment.