I get the whole "home grown industry" and sovereign production of defense and all that, but just like when Australia tried to build its own submarines, really you're better off just buying them off the shelf from your allies who've already been ploughing billions into design and development of the things for decades.
Spain has an active defense shipbuilding industry (e. Eg scorpene submarine), why would they buy them from someone else ? And these kind of program secure a lot of jobs, when you buy from outside you secure those jobs abroad.
From what I read about american airplanes they have this days software that call home and send tracking data, plus imagine some diplomatic incident(like a tweet of some extradition case) and you now have to worry if your submarines will be remotely bricked ... so yeah if you buy important crap from others make sure you can control the software too.