How relevant a PhD that takes >8 years would be, specially in STEM fields?
You don't wait with publishing till you finished your PhD, especially in such a fast moving field. So by the end of your education you will have made a contribution, even if at the time your PhD is finished your contribution is already less relevant. This is fine. A PhD is supposed to show that you can do independent research; think of it as vocational training for researchers. So if you show that you made contributions that at the time were good, then you have shown what you needed to show. Nobody expects of PhD students to be able to see the future.