I have read some relevant posts here, but I still didn't extract a clear answer pertinent to my situation. I'm a Canadian citizen, I have a residence permit in France. Now, I have a job offer from Spain, where I'll be able to work three days a week remotely, and two days a week I'll need to be on the site. The job site is in Barcelona, so I've been thinking about the possibility of living in a French town close to the Spanish border and commute two times a week (I wouldn't even lose much time if I took the train, because I could use my laptop en route). So I would get a work permit in Spain and still have my French residence permit. If I do not reside in France sufficiently long, I'll lose my residence permit here.
After reading related questions, I got the impression that cross-border commuting for work is not a simple private matter, but is likely something that the employer would need to know about for tax reasons. (This being said, the taxes in France (for my tax bracket at least) are lower than in Spain.) Moreover, I've read that for some employers cross-border commuting of an employee may be an issue sufficiently complicated to not want to work with such an employee.
Is this all true? Isn't it just a matter of letting the accounting department know that I live in France and would thus pay the taxes in France, so that they wouldn't automatically deduct the taxes from my paycheck; or am I missing something? Or will I be subject to some sort of double taxation? In this case, I guess, the employer wouldn't care where I lived.