You bet, we were rooting for Chicago to land Amazon’s second headquarters, and we’re disappointed that the city did not.

But at what price?

The silliest lament we’ve heard this week, from the editorial page of the other big Chicago paper, is that the failure of Chicago and Illinois to win Amazon HQ2 was a repeat of the state’s failure to win Foxconn, the electronics manufacturer now building a plant across the border in Wisconsin.

EDITORIAL

As if any sensible person cannot see by now what a bad deal Wisconsin struck to get Foxconn — and how lucky Illinois was to lose that bidding war.

The real lesson of Foxconn, worth remembering as we consider what else Chicago and Illinois could have done to win Amazon HQ2, is that there’s a limit to how much a community or state should give away in return. At some point, all those tax breaks and financial incentives become a burden on the local taxpayer, a drag on the local economy and cancel out the value of whatever jobs are gained.

We don’t yet know why Amazon took a pass on Chicago, though it’s pretty clear one big negative was our state’s dysfunctional government during the tenure of Gov. Bruce Rauner. It is telling that the last big question Amazon executives put to officials in New York — the governor and the mayor — before awarding Queens a part of the HQ2 prize was whether they could stop bickering long enough to see the project through.

But to the extent that this was about money, with the subsidies of $2.25 billion offered by Illinois and Chicago falling short, so be it. A prudent city and state, confident in their many strengths — excellent universities, a top international airport, a superb workforce and the like — can’t just write bigger and bigger checks.

As it is, New Yorkers already are debating whether the price they have agreed to pay — some $2.8 billion in tax breaks and benefits to Amazon in return for 25,000 new jobs — will prove worth it.

The Foxconn deal, far from being good for the people of Wisconsin, is shaping up as an object lesson in how not to recruit a big new employer. Certainly the voters of Wisconsin have begun to sour on the deal, which clearly was a factor in Gov. Scott Walker’s defeat for re-election last week.

Walker offered Foxconn, a Taiwanese company, $3 billion in subsidies in exchange for a promise to build a $10 billion factory in Racine County. The facility was to generate 3,000 jobs almost immediately and as many as 13,000 in the long run. The enormous subsidies would come largely in the form of direct cash payments to Foxconn because Wisconsin already exempts manufacturing companies from taxes.

But, as Dan Kaufman of the New Yorker reported earlier this month, the deal has grown even more expensive. When additional local subsidies and expenses, such as for road improvements, are added in, the true cost of the Foxconn deal to the taxpayers of Wisconsin is more than $4.5 billion. Depending on the number of jobs actually created, taxpayers will be paying between $250,000 and more than $1 million per job.

A nonpartisan bureau of the Wisconsin state legislature concluded last January that the people of Wisconsin might not see a return on their Foxconn investment until 2042.

Adding insult to injury, Gov. Walker worked with the Trump administration last spring to ease up on federal limits for smog pollution by Foxconn. And, by the way, did we mention that Foxconn wants to replace 80 percent of its global workforce — actual human beings — with robots within 10 years?

Yes, it’s regrettable that Chicago and Illinois failed to land any part of Amazon’s HQ2. But it’s also a reminder that local economies, like baseball teams, grow best from the roots up. The Cubs were the joke of professional baseball until they finally invested big in their farm teams and cultivated their own talent.

So it goes with growing Chicago’s economy, especially with respect to the tech sector, where so much depends on the quality of the workforce and the quality of life.

Chicago and Illinois should take that $2.25 billion offered to Amazon and invest it in overdue infrastructure improvements, better schools and universities and safer neighborhoods.

Selling our city and state is one thing — and, goodness knows, we’ve got a lot to sell.

Selling the store, as we fear Wisconsin has done, is quite another.

Send letters to: letters@suntimes.com.