build: expand dependencies only once
build: expand dependencies only once

Closes Homebrew/homebrew#20081.

gregory-nisbet/brew,DomT4/brew,amar-laksh/brew_sudo,AnastasiaSulyagina/brew,alyssais/brew,vitorgalvao/brew,staticfloat/brew,vitorgalvao/brew,reitermarkus/brew,rwhogg/brew,alyssais/brew,reelsense/brew,ilovezfs/brew,muellermartin/dist,staticfloat/brew,nandub/brew,staticfloat/brew,aw1621107/brew,zmwangx/brew,zmwangx/brew,reitermarkus/brew,mgrimes/brew,DomT4/brew,hanxue/linuxbrew,tonyg/homebrew,rwhogg/brew,konqui/brew,MikeMcQuaid/brew,reelsense/brew,mgrimes/brew,pseudocody/brew,gordonmcshane/homebrew,MikeMcQuaid/brew,EricFromCanada/brew,maxim-belkin/brew,jmsundar/brew,mgrimes/brew,Linuxbrew/brew,JCount/brew,muellermartin/dist,muellermartin/dist,claui/brew,maxim-belkin/brew,hanxue/linuxbrew,nandub/brew,pseudocody/brew,JCount/brew,zmwangx/brew,gregory-nisbet/brew,mahori/brew,gordonmcshane/homebrew,amar-laksh/brew_sudo,Homebrew/brew,reitermarkus/brew,palxex/brew,konqui/brew,mahori/brew,mahori/brew,amar-laksh/brew_sudo,jmsundar/brew,hanxue/linuxbrew,Linuxbrew/brew,claui/brew,nandub/brew,bfontaine/brew,Homebrew/brew,palxex/brew,gregory-nisbet/brew,mistydemeo/homebrew,sjackman/homebrew,reelsense/brew,rwhogg/brew,DomT4/brew,DomT4/brew,aw1621107/brew,EricFromCanada/brew,bfontaine/brew,sjackman/homebrew,ilovezfs/brew,claui/brew,Linuxbrew/brew,gordonmcshane/homebrew,vitorgalvao/brew,pseudocody/brew,toonetown/homebrew,nandub/brew,Linuxbrew/brew,claui/brew,Homebrew/brew,palxex/brew,jmsundar/brew,tonyg/homebrew,toonetown/homebrew,MikeMcQuaid/brew,JCount/brew,vitorgalvao/brew,MikeMcQuaid/brew,alyssais/brew,sjackman/homebrew,ilovezfs/brew,aw1621107/brew,reitermarkus/brew,AnastasiaSulyagina/brew,sjackman/homebrew,Homebrew/brew,bfontaine/brew,konqui/brew,EricFromCanada/brew,toonetown/homebrew,EricFromCanada/brew,konqui/brew,mahori/brew,mistydemeo/homebrew,tonyg/homebrew,JCount/brew,maxim-belkin/brew,mistydemeo/homebrew,AnastasiaSulyagina/brew