It's kind of tricky because though the EU as it is today is relatively new Ireland joined the European Economic Community which essentially became the EU. Also whenever that rule came into effect the special rules Ireland gave Apple should have been reevaluated and removed. They've always been against the state aid rule it's just not been tried until now. As for "changing the tax laws of governments underneath it" that's part of being in the EU you give up parts of your national sovereignty in a number of areas for the benefits of being in the open market.