On the race issue, the simple fact is that the heart of the GOP are southern whites, and there is a long history of resentment between them, as a group, and racial minorities, black and brown.
In the primary, to court that base, the GOP candidates are forced to champion policy positions that take advantage of that resentment. We see it every time when it comes to social spending. And now also immigration enforcement.
It helps win the nomination in the short term, but it does nothing to help the GOP expand its base in the long term. It just feeds those the resentments. Makes them more acute.
So the long term problem the GOP has to deal with -- and has not thus far -- is that to win the nomination you have to further alienate the part of the population that is growing.
It's not racism of the candidate that is the problem. It is that the candidate is forced to try to appeal to racial animosity within the base to even get the chance to run for office to begin with.