The U.S. can realize President-elect Donald Trump’s dream of independence from foreign oil “foes” and “cartels”–but he likely won’t live to see it unless he embraces the kinds of policies he’s campaigned against, according to a new study out Wednesday.

In its World Energy Outlook for 2016, the International Energy Agency said that on current policies, the U.S. will need until 2040 to reduce its oil import needs to a level that can be met by just Canada and Mexico. (The IEA assumes that neither of those has become a foe of the U.S. by then.) At that point, it would be free of the need to intervene in the Middle East to guarantee vital energy supplies.

It could happen sooner, but that would require Trump to really embrace the kind of transformation of the energy sector called for by the Paris Accord on climate change–promoting renewables, encouraging energy efficiency, and migrating the transport sector to electric motors. That’s kind of awkward, given that Trump has pledged to pull out of the accord and revive the coal industry instead.

A pathway to energy independence for the U.S.Source: IEA

The U.S. currently imports over 20% of its energy needs, making any short-term aim of “independence” practically impossible. But that figure has been on a clear downward path since the start of the shale oil and gas boom a decade ago. The uptake of renewable energies–where the U.S. has a massive and largely untapped resource base–has slowly accelerated that trend in the last eight years.

Trump’s campaign promises on energy were a nod to voters in oil-producing states. They also reflected the idea that dependence on Middle Eastern oil helped provoke the decision to go to war in Iraq in 2003 and perpetuates the need to spend billions of dollars every year on defending strategic interests in the region, notably in support of Saudi Arabia.

Khalid al-Falih, the Saudi energy minister, warned in an interview Tuesday that Trump should not try to reach his energy goals through import restrictions. Trump has never publicly proposed banning or restricting imports per se, although he has warned of boycotting Saudi oil if it didn’t contribute more to the upkeep of the U.S. military presence in the Gulf.

The U.S. “benefits more than anybody else from global free trade,” al-Falih told the Financial Times, pointing to the U.S.’s increasing exports of refined oil products and natural gas.

With global demand for natural gas expected to rise more strongly than for any other fossil fuel over the next 20 years, the U.S. would risk throwing away valuable export opportunities if it rejected free trade.

Elsewhere in its report, the IEA warned that the global oil market is headed for another boom and bust cycle within four years, due to the drastic cut in investment by exploration and production companies over the last two years.

Big oil companies in particular have slashed their capital expenditure budgets to conserve cash as oil prices have fallen from over $110 a barrel in 2014 to as low as $30 a barrel earlier this year, raising hard questions over how they can sustain their output and their returns to shareholders. BP Plc, for example, expects to invest only $15-$17 billion next year, compared to $24.6 billion in 2013. Chevron Corp cvx may spend as little as $20 billion next year, barely half the $40 billion it originally planned to invest in 2014.

“A lot of attention is focused on the remarkable resilience of U.S. tight oil output through the current downturn and its potential ability, because of a short investment cycle, to respond in a matter of months to movements in price,” The IEA said. “But there is a threat on the horizon to the ‘baseload’ of oil output, the conventional projects that operate on a different rhythm, with lead times of three to six years from investment decision to first oil.”

The IEA noted that the number of conventional oil projects receiving approval fell to its lowest level since the 1950s in 2015 and that there was no rebound this year.

“If new project approvals remain low for a third year in a row in 2017, then it becomes increasingly unlikely that demand (as projected in our main scenario) and supply can be matched in the early 2020s without the start of a new boom/bust cycle for the industry,” the Agency said.