-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI: Build on macOS #59
Conversation
Hi @ChinYikMing , I noticed an abnormal timestamp in the boot log:
This issue arises because I inadvertently returned the clocksource in nanoseconds when building on macOS, while the expected unit is seconds. static uint64_t semu_timer_clocksource(uint64_t freq)
{
#if defined(HAVE_POSIX_TIMER)
struct timespec t;
clock_gettime(CLOCKID, &t);
return t.tv_sec * freq + mult_frac(t.tv_nsec, freq, 1e9);
#elif defined(HAVE_MACH_TIMER)
static mach_timebase_info_data_t t;
if (t.denom == 0)
(void) mach_timebase_info(&t);
- return mult_frac(mach_absolute_time() * freq, t.numer, t.denom);
+ return mult_frac(mult_frac(mach_absolute_time(), freq, 1e9), t.numer, t.denom);
#else
return time(0) * freq;
#endif
} I will create another PR to fix this bug. Thanks for pointing it out! Regarding the CI test failures, the CI workflow was failing due to a timeout (currently set to 90 seconds), I found some discussion about github-hosted runner. Increasing the timeout value to 600 seconds allowed the workflow to pass, I am not sure where is the bottleneck during workflow but it actually take much more time to boot linux on semu with macOS runner. I'm also exploring options to build semu on a real macOS machine to better address this issue. |
@chiangkd , Is the 600s timeout the minimum needed to pass the CI on the macOS runner? I would prefer adding a conditional statement based on the runner to select the appropriate timeout duration. After that, a new issue can be created to track this. |
semu supports conditional compilation on both Linux and macOS. This can sometimes lead to compilation failures on one platform when only tested on another. To prevent such issues, automated CI checks ensure that the code compiles properly before being merged into upstream.
b96d70d
to
10245c8
Compare
This comment was marked as resolved.
This comment was marked as resolved.
10245c8
to
6172aff
Compare
In my testing, the average time to pass this Action is around 311 seconds. Additionally, I reverted to using the I also tested running semu on macOS via VirtualBox, but it still took longer to boot the system. Here are the results for ...
[142.702404] Run/ init as init process
... |
Got it, thanks for testing. It looks like 600 seconds is sufficient to pass the CI on the macOS runner. |
Testing shows 600 seconds is sufficient to boot Linux on macOS runners, while 90 seconds works for Linux runners. This commit sets the timeout for each platform accordingly. The varying timeout requirements will be tracked in an issue.
6172aff
to
d05f395
Compare
Thank @ChinYikMing for contributing! |
No description provided.