coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

Android CI fails sporadically during build

Open cre4ture opened this issue 1 year ago • 3 comments

Android CI is still unstable due to random errors of Text file busy. Example attachted. The crate beeing affected seems to be rather random each time. As I think this is an issue with the build system itself, I don't know how to easily fix this. From my experience "Text file busy" means that an other process is blocking the file such that it can't be accessed. Maybe this is a race-condition that happens when the creation of the file is not yet fully finished and its already accessed for execution?

Anyway I suggest to implement a workaround that just retries the build 3 times before stopping. I can implement this.

[2024-02-20 17:00:18]    Compiling libc v0.2.153
[2024-02-20 17:00:18]    Compiling cfg-if v1.0.0
[2024-02-20 17:00:18]    Compiling typenum v1.15.0
[2024-02-20 17:00:18]    Compiling version_check v0.9.4
[2024-02-20 17:00:18]    Compiling bitflags v1.3.2
[2024-02-20 17:00:18]    Compiling io-lifetimes v1.0.11
[2024-02-20 17:00:18]    Compiling proc-macro2 v1.0.63
[2024-02-20 17:00:18] error: failed to run custom build command for `libc v0.2.153`
[2024-02-20 17:00:18] 
[2024-02-20 17:00:18] Caused by:
[2024-02-20 17:00:18]   could not execute process `/data/data/com.termux/files/home/coreutils/target/debug/build/libc-db86c7903a93619b/build-script-build` (never executed)
[2024-02-20 17:00:18] 
[2024-02-20 17:00:18] Caused by:
[2024-02-20 17:00:18]   Text file busy (os error 26)
[2024-02-20 17:00:18] warning: build failed, waiting for other jobs to finish...

cre4ture avatar Feb 20 '24 17:02 cre4ture

I have the feeling that this doesn happen anymore currently. So the PR stays in draft, because its propably not needed.

cre4ture avatar Feb 24 '24 16:02 cre4ture

It just happened again: https://github.com/uutils/coreutils/pull/6015#issuecomment-1962984912

BenWiederhake avatar Feb 25 '24 16:02 BenWiederhake

@BenWiederhake thanks for reporting. Before merge, I wanted to see a case where my workaround was actually needed and working. Currently, on this branch I had only cases where the build worked the first time.

cre4ture avatar Feb 25 '24 18:02 cre4ture

Update: it works. I found now a case where it was happing on this branch, and the automatic retry was helping to make build successful.

cre4ture avatar Feb 26 '24 21:02 cre4ture

closing as workaround was merged to main

cre4ture avatar Feb 29 '24 18:02 cre4ture