Skip to content
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

WSL2 - clock problems during build #4975

Closed
rupor-github opened this issue Mar 16, 2020 · 9 comments
Closed

WSL2 - clock problems during build #4975

rupor-github opened this issue Mar 16, 2020 · 9 comments

Comments

@rupor-github
Copy link

rupor-github commented Mar 16, 2020

Sorry if this duplicate - I tried to search and saw several messages which are referring to same/similar problem, however there seems to be no separate assigned recent entry tracking this particular problem. Mostly people complain about date being skewed (some workarounds are available) - this one however as far as I could tell has no workaround and is easily reproducible in the latest 2004 build, which make WSL 2 completely unsuitable for any real development use.

Windows 10 build 19041.153, attempting to use WSL2, files are on Windows file system (not rootfs):

-- Build files have been written to: /mnt/e/projects/misc/wsl-ssh-agent/release
make: Warning: File 'Makefile' has modification time 0.6 s in the future
make[1]: Warning: File 'CMakeFiles/Makefile2' has modification time 0.65 s in the future
make[2]: Warning: File 'CMakeFiles/bin_agent.dir/progress.make' has modification time 0.61 s in the future
Scanning dependencies of target bin_agent
make[2]: warning:  Clock skew detected.  Your build may be incomplete.
make[2]: Warning: File 'CMakeFiles/bin_agent.dir/progress.make' has modification time 0.51 s in the future
[100%] Building wsl-ssh-agent-gui...
make[2]: warning:  Clock skew detected.  Your build may be incomplete.
[100%] Built target bin_agent
make[1]: warning:  Clock skew detected.  Your build may be incomplete.

Could hv_utils: cannot register PTP clock: 0 be the reason for that?

@sirredbeard
Copy link
Contributor

This is a duplicate of #4677 which you have also commented in @rupor-github

Use sudo hwclock -s to re-sync your hardware clock in your build scripts.

@rupor-github
Copy link
Author

rupor-github commented Mar 17, 2020

@sirredbeard The reason I created separate issue is that none of the workarounds mentioned help any - that includes sudo hwclock -s which may work to sync date/time in case your laptop has been sleeping (not my case, I have perfect date/time) - but does not help inside of make files.

@sirredbeard
Copy link
Contributor

sirredbeard commented Mar 17, 2020

That would be very helpful to know and provide useful context in that issue.

@rupor-github
Copy link
Author

Sure - I am here to provide anything which is missing, could you please kindly explain what you need?

So far it goes like that:

  1. I have been using WSL v1 for quite sometime, one of the projects I work on is https://github.com/rupor-github/wsl-ssh-agent. It has bash script to build it which invokes cmake. Works like a charm. My distro is Pengwin (which from what I could tell is slightly customized Debian testing)
  2. Converted WSL distro to WSL v2 yesterday after installing Windows 10 build 19041.153. Now when I am running build script I get above mentioned error (every time all the time - reliably). Running hwclock or ntpdate only changes the skew value - problem stays.
  3. Running dmesg I could see:
[    0.446543] hv_utils: cannot register PTP clock: 0
......
[    0.464916] Unstable clock detected, switching default tracing clock to "global"
               If you want to keep using the local clock, then add:
                 "trace_clock=local"
               on the kernel command line
  1. Looked around - similar problems have been mentioned in context of time/date sync problems due to sleep. In my case this is desktop which does not sleep. So I decided to make it separate - as this is important.

@rupor-github
Copy link
Author

After using WSL2 for a while I could state with reasonable accuracy that this problem only shows when build happens outside rootfs - in other words if build directory is hosted on devfs (9p?) mounted NTFS file system. When I move everything into home directory - this problem disappears. This holds true even for latest 2004.208 build. At the same time under WSL1 this never happens.

@lygstate
Copy link

Yeap, I also face this problem.

@sloong
Copy link

sloong commented May 20, 2020

same problem.

@therealkenc
Copy link
Collaborator

/dupe #4677 and #5324

@ghost
Copy link

ghost commented Jun 3, 2020

Hi! We've identified this issue as a duplicate of another one that already exists in this repository. This specific instance is being closed in favor of tracking the concern over on the referenced thread.

Thanks for your report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants