After Friday morning's dramatic Senate vote on the latest Republican healthcare bill, the efforts to repeal the Affordable Care Act are stalled, if not totally dead. There goes one of Donald Trump's major campaign promises. Is the wall the next one to be broken?

The wall on the US-Mexico border, ostensibly vital for curbing illegal immigration and drug trafficking into the states, has been one of Trump's most original, and absurd-seeming ideas. Though it's often derided, the president seems committed to it, recently speculating about putting solar panels on the future wall, and making sure it's transparent so no one gets killed by bags of drugs tossed over it. But despite a high-profile (if wonky) development this week it remains unclear how the wall is going to be funded, and the battle over the money issue could drive Trump to desperation.

Trump came into office swinging hard for the wall. His fourth executive order, issued five days into his term, called on the Department of Homeland Security (DHS) to start planning and building it, and to allocate whatever money they could towards those ends, immediately. Congressional appropriators approved the shuffling around of about $20 million within the DHS for wall-related activities. As of March relevant agency authorities had opened calls for bids from wall designers. They planned to pick contractors by June 12 and begin construction on prototype options on July 21.

But $20 million is a drop in the bucket compared to the $21.6 billion the DHS estimated the full wall would require. (Even that, some critics argue, is a low estimate.) This spring, Republicans tried to give Trump $1 billion for a few dozen miles of wall in their 2017 spending plan. But that deal fell apart when Senate Democrats, who can filibuster spending bills, demanded wall funding (and a ton of other provisions) be axed. Trump bit the bullet rather than reject this (for him) unsatisfying compromise plan and risk a government shutdown just over 100 days into his term.

The wall isn't actually popular. A recent poll found that over half of Americans oppose it while just over a quarter support it. House and Senate Republican from border areas (where Trump performed poorly) and regions with large Latino communities hate it. Even conservatives, who might like it in theory, aren't hyped that it'll be paid for by Americans, not by Mexico as Trump promised. Appropriators in Congress don't like that there's no comprehensive plan for the wall, and that Trump seems intent on funding it in tiny annual chunks.

Given all that, many Republicans weren't terribly committed this spring to fighting with Democrats over the wall. But Trump is reportedly truly passionate about and dedicated to getting a wall—not just a glorified super fence, but a big, beautiful wall. After the 2017 spending bill passed in May, he floated the idea of shutting down the government unless he got his way in the 2018 budget. Later that month he made his 2018 spending ask, which included $1.6 billion for even more border wall (although that's still only enough for less than 100 miles of wall).

Yet earlier this month, even Trump appeared to backtrack on the wall's scope. In the same batshit talk session on Air Force One where he talked about solar panels and bags of drugs, he told reporters that rather than spanning all nearly 2,000 miles of the border, it'd run a likely non-contiguous 700 to 900 miles.

Watch: News anchors can't *expletive* handle the Mooch

Building any expanse of wall at all has also proven more difficult than anticipated. This week, officials finally admitted that, due to disputes over the bidding process, they would not be able to pick contractors or start construction on the prototypes funded by that initial $20 million afforded them until late October or early November at best.

Recently House Republicans decided to moved ahead with a plan, under speculation for some time, to include $1.6 billion for the wall in a bundle of four spending bills, otherwise unrelated to the DHS or border security*. The addition was seemingly less about placating Trump and more about appealing to conservatives, who have issues with their party's wider spending plans but view the wall as a perk for playing nice. But they decided to make the addition through a very irregular procedure that would allow them to add it without voting on it as a discrete amendment and make it hard for anti-wall Republicans to vote against the move.

In the days that followed, House Republicans argued endlessly over hundreds of potential amendments. By the start of this week, it'd become clear that the stickiest issue was military funding for transgender medical treatments—an amendment banning paying for those treatments was voted down by a coalition of Democrats and moderate Republicans. In response to a lack of willingness by House Republican leadership or the Department of Defense to push the issue further, conservatives went straight to Trump. He in turn was apparently so desperate to get some funding for his wall that he went nuclear, announcing on Twitter that he would ban trans people from serving in the military, to the shock of everyone in Washington.

"This is like someone told the White House to light a candle on the table," a House Republican aide told Politico on Wednesday, "and the WH set the whole table on fire."

This desperate pro-wall bid worked: Although five Republicans voted against it, they succeeded in their sneaky procedural plan to slip wall funding into the spending bill on Thursday afternoon, then within hours passed the bill itself, with even a few anti-wall Republicans and five Democrats voting for it.

The House's spending bill is just the opening salvo in a long debate, though. Senate Republicans are just starting to pump out their spending bills and seem to be working on a different template. Thanks to Senate rules, they'll need Democratic support and have to be more sensitive to demands from across the aisle. And, as congress watcher Molly Reynolds put it to me on Thursday, "Opposing wall funding has been a political winner for Democrats so far."

No one I've spoken to is willing to make a call now on whether Senate Democratic opposition will keep the wall from getting funded in the latest budget. This process may take months; on Thursday, big shots from the Republican Study Committee, representing over half of House Republicans, voiced a growing suspicion that Congress won't be able to settle on 2018 funding until the end of the year. (This would require a continuing resolution to fund the government at 2017 levels after the fiscal year ends at the end of September.) In that time, there'll be endless arguments over funding levels, how to deal with discretionary spending caps, and other policy issues that get wrapped into each of the dozen vital spending bills.

"Given all the moving parts," said Reynolds, "it's hard to know exactly how this will play out" for wall funding, which could get roped into or pushed aside by any of these debates.

Does that mean a wall could actually get funded?

"Sure," said Maya MacGuineas of the Center for a Responsible Federal Budget. "These days, anything is possible."

Whatever the outcome, this wall funding is likely to be the center of some brutal fights in the Senate in the near future, and probably back in the House again once the Senate finishes its own process and loops back around. And since wall advocates don't have any more leverage than they did when the Democrats shot down funding for 2017, there's a good chance it'll still fall apart.

If it does, Trump will have to decide if he's willing to veto a wall-less bill. He hasn't given any clear indication on this. But conservative lawmakers think he's willing to stand strong on this front. After all, as the Washington Post pointed out last week, the wall is the clearest victory Trump could win on immigration, a typically difficult issue that he's put at the heart of his presidency. It's also the manifestation of his self-image as a builder.

"He is very serious about it," said MacGuineas. "But he will [have to] evaluate the chance of his veto being successful and quite possibly decide it just isn't worth" the risk of a failed block.

No matter how this all shakes out, though, we're going to be hearing a lot more about the wall in the months to come, especially come September when budget debates begin in frantic earnest. And if it runs into similar stumbling blocks, we could see Trump willing to throw other people or priorities under the bus to get his beloved wall closer to the finish line.

Update 7/29: An earlier version of this post used somewhat confusing language about when House Republicans decided to include money for the wall in the bundle of spending bills.