A Chinese shipyard has completed a second submarine for the Pakistan navy, further strengthening military ties between the two countries.