It takes Carlos Rojas two and a half to three hours to drive from his home in Stockton to a job spreading plaster on houses going up in Campbell. The trip is worth it, though. The 30-year-old immigrant from the Mexican state of Oaxaca says he makes roughly $25 an hour, depending on the job. That is more than twice as much as Stockton’s farmworkers typically make in the fields. And his boss pays for gas.

“A lot of people returned to Mexico after the housing bust, and then came the deportations,” he said. “People got scarce. Now that the work came back, they are short of people.”

Nationwide, the average wage of nonsupervisory workers in residential construction hit $25.34 an hour in January. That is over 6 percent more than a year earlier, close to the steepest annual increase since the government started keeping track almost 30 years ago. Pay is taking off even among those in less-skilled construction trades.

The gains are part of a broader trend. The tightest labor market in more than half a century is finally lifting the wages of the least-skilled workers on the bottom rung of the labor force, bucking years of stagnation.

But to hear builders tell it, the rising cost of their crews reflects a demographic reality that could hamstring industries besides their own: Their labor force is shrinking. President Trump’s threat to close the Mexican border, a move that would cause damage to both economies, only adds to the pressure.

MBA BY THE BAY: See how an MBA could change your life with SFGATE's interactive directory of Bay Area programs.

Immigration — often illegal — has long acted as a supply line for low-skilled workers. Even before Trump ratcheted up border enforcement, economic growth in Mexico and the aging of the country’s population were reducing the flow of Mexican workers into the United States. The number of immigrants in America illegally declined to 10.7 million at the end of 2017 from a peak of over 12 million at the height of the housing bubble in 2008, according to the Center for Migration Studies.

The problem for builders is that the recovery in home building has outpaced the growth of the construction labor force. Housing starts have picked up to a pace of 1.2 million a month, more than twice as many as at their trough in April 2009. The number of nonsupervisory workers in residential construction, by contrast, has increased by only 40 percent since hitting bottom in 2011, to about 530,000.

“The recent shortage of immigrant workers is impacting housing and housing affordability,” said Jerry Howard, chief executive of the National Association of Home Builders. Phil Crone, who runs the association’s Dallas chapter, said the labor bottleneck is adding about $6,000 to the cost of every home built in the area and delaying completion by two months.

Were it not for immigrants, the labor crunch would be even more intense. In 2016, immigrants accounted for 1 in 4 construction workers, according to a study by Natalia Siniavskaia of the home builders’ association, up from about 1 in 5 in 2004. In some of the least-skilled jobs — like plastering, roofing and hanging drywall, for which workers rarely have more than a high school education — the share of immigrants hovers around half.

The need for labor has set off a scramble for bodies that is spilling across industries and driving up wages.

“A lot of our landscape companies are upset because their guys are coming into construction because they can earn more,” said Alan Hoffmann, who builds energy-efficient homes in Dallas.

For all the fears of robots taking over jobs, some economists are worrying about the broader economic fallout from a lack of low-skilled workers. And businesses across the economy are complaining that without immigration they will be left without a workforce.

“It is good for wages to go up, but if labor is at a point where employers can’t hire, it is reducing growth,” said Pia Orrenius, an economist with the Federal Reserve Bank of Dallas. “There’s also considerable wage pressure in small towns and cities that are depopulating, but that is a sign of distress, not of rising productivity.”

The labor crunch is likely to persist for some time. The Pew Research Center projects very little growth in the working-age population over the next two decades. If the United States were to cut off the flow of new immigrants, Pew noted, its working population would shrink to 166 million in 2035 from 173 million in 2015.

Immigration has been padding the labor force for years. Over the past two decades, immigrants and their children accounted for more than half the growth of the population of 25- to 64-year-olds, according to Pew’s analysis. Over the next 20 years, they will have to plug the hole left by the retirement of the baby boom generation.

But the share of immigrants over 25 with less than a bachelor’s degree — the most likely to seek a job hanging drywall or spreading plaster — has steadily shrunk, to 70 percent in 2016 from 76 percent in 2000, according to the Pew Research Center.

Businesses scrambling for low-skilled workers provide a glimpse into the kind of strains a future of low immigration might bring.

Consider agriculture, where 7 in 10 workers were born in Mexico, and only 1 in 4 was born in the United States. Last year, the United States issued nearly 200,000 H-2A visas for agricultural workers, three times as many as in 2012, as farmers tried to make up for the decline in the undocumented workforce. Growers complain about the bureaucracy and costs associated with the visa program and worry that a government hostile toward immigrant work might decide to curtail it.

Some growers are resorting to other tactics, too.

“We’re seeing a large transition of growing from California down to Mexico,” said Larry Cox, who farms in California’s Imperial Valley as well as in Sinaloa and Guanajuato in Mexico.

Eduardo Porter is a New York Times writer.