Frame challenge: It's not about technology, it's about energy
Mars has about 1/4 of solar energy income than Earth, and no converted forms like fossils, elevated water or accelerated gas that could be used with relative ease as we have here (hydro, wind, coal). It's unknown as of now whether Mars has fissile matter in enough quantities to warrant a nuclear plant with local power supply, but even if it does, it still has to be first mined, then refined, then packed into fuel cell units, before being put into a reactor, and also with the thin Martian atmosphere cooling that reactor would prove extremely hard as well. So, a colony on Mars is limited to solar power.
Second step: everything we have to do for our life support also consumes energy, thus we would need at least 4x the area dedicated for solar converters than here, on top of requiring the same source to mine materials for supporting any industry we'd need to maintain the colony. This means the colony would be extremely dependent on solar batteries, and also would have to spend no less than four times the energy to produce those solar panels first. This means that maintaining constant human presence on Mars is currently not possible, but not by technological, but energetical reasons. Building an automated solar farm might be possible with current tech, assuming enough batteries would be installed to supply a single mining robot with some rudimentary processing structures that would in turn use that energy to make more solar power units. I think though that this technological edge is not reached by the humanity yet, as even a "fully robotic" industry here still requires human maintenance, and there would be none on Mars in this scenario.
Third step: maintenance. It's not just that the chips get welded, it's also that the fine Martian dust would be a huge obstacle by blocking sunlight from hitting those panels, interfering with open contacts (the dust is said to be conductive), accumulating in the insides of a robot that would mount new solar panels, maybe by some other means as well, and all these should be somehow controlled by the fully automated facility. On top of that, the facility has to store enough energy to relaunch itself from at least a two-day blackout similar to the one that hit Opportunity:
Or maybe wait in hibernation until it would clear again. Still, with humans such a facility must not stop, or else the base would die off.
Fourth step: thermal balance. Even automated devices require both cooling and heating on Mars, to not get out of working temperature range; with humans around the balance would also have to account for pressurized areas and any other biomass that would be present there, with its own range of temperature to retain functionality (plants, fungi, actual water, whatever else). All this would require excess energy to maintain, and we are already on a very strict budget.
So in total: we are only a tad away from the goal technology wise, but we are very far away energy wise.
EDIT: this was covering only Mars, for the Moon we probably have a harder time as energy downtime on Moon is a lot longer (14 days), but there's less dust and more energy to boot, making the actual problem with Moon be energy storage, not gathering. And our energy storage devices leak faster than fourteen days, especially if loaded. We still can solve the problem by employing a complete power grid across Moon, but this is out of our reach material wise.