Closed Ilia-Kosenkov closed 1 year ago
Reopening this because it still happens. Seems to be some sort of a race condition, see e.g. this SO post.
UPD: Perhaps we should try to just touch
this file here, instead of making a full copy https://github.com/extendr/rextendr/blob/36e145fb00167e25b9c0c891f35720aff70bf02d/inst/templates/Makevars.win#L21
How about rm -r $(TARGET_DIR)/libgcc_mock
before mkdir
?
I think I tried to treat $(TARGET_DIR)/libgcc_mock
as a target to prevent from executing twice, but my make-fu was not enough (probably some problem happened, but I don't remember well). There might be some better structure....
We can try that, but here the issue is some race condition -- cp
does a check if the file exists (it does not at that time), then proceeds to copy, but the file is already there (something else created it), so it blows up. Cleaning the directory might not solve this, but worth giving a shot.
Hmm, have you seen the problem on your local? Or is this only happen on the CI?
How about creating a tempdir and then mv last?
Actually, not locally, only on CI, but local machine != cloud runner, so that might be a problem. I will try something different, though the problem is the issue is random so there is no way to test it robustly.
Hm, why do we need libgcc_s.a
? We always had problems with libgcc_eh.a
, or its absence. In my case, I am able to compile a test package locally even if I just create a mock directory and then touch libgcc_eh.a
. I'll make a test branch to see how it works on CI.
https://github.com/Ilia-Kosenkov/rextendr/actions/runs/3558213145
https://github.com/Ilia-Kosenkov/rextendr/actions/runs/3558213146
Seems to work fine, even though the only thing I did was touch
ing libgcc_eh.a
, without real compilation.
https://github.com/Ilia-Kosenkov/rextendr/blob/3ca62814d4170d6600dce2e0fff8b97cab0728e7/inst/templates/Makevars.win#L18
https://github.com/extendr/rextendr/actions/runs/3255637727/jobs/5345165032#step:9:220