The description does not match The Last Starfighter (1984), which features a teenage boy recruited for an interstellar war. A girl stranded on a planet with robots who build a spaceship might be:
If you recall more details (art style, era, specific characters), a more accurate identification may be possible.