Bug 5087

Summary: Sometimes building under BA can fail due to make utility reporting timestamps anomalies
Product: [Build System, Metadata & Runtime] Runtime Reporter: Cristian Iorga <cristian.iorga>
Component: build-applianceAssignee: Unassigned <unassigned>
Status: RESOLVED OBSOLETE QA Contact:
Severity: normal    
Priority: Medium+ CC: its.muhammadosama, ke.zou, randy.macleod, sgw, yi.zhao
Version: unspecified   
Target Milestone: 4.99   
Hardware: x86   
OS: x86_64   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
Reference documentation about timekeeping in vmWare VMs none

Description Cristian Iorga 2013-08-30 10:39:00 UTC
Sometimes rpm-native package will fail with the following error:

checking whether build environment is sane... configure: error: newly created file is older than distributed files!
Check your system clock

The error happens for syck lib.

Build configuration is:

Target arch: mips
Machine: qemumips
SDk machine: x86_64

Image: core-image-minimal
Comment 1 Cristian Iorga 2013-08-30 10:39:21 UTC
Investigation started.
Comment 2 Cristian Iorga 2013-08-30 11:13:30 UTC
Preliminary investigation concludes that:

The issue stems from the fact the BA VM has issues with the emulated RTC (real time clock) upon which Linux opeartion is based.
Some dates of the extracted files might look that they were created in the future, as such, configure file will not appear to the build system as correct and as an end-result of the configuration phase.

Possible solutions:
1. Enable timesync between BA VM and host OS.
BA does not have the vmware tools installed, as such time synchronisation with the host is not an option.
timeSync plugin is handling this feature, and is not installed in BA's kernel/VM.
Feature is not yet implemented for BA.
See "Bug 2817 - Build Appliance: Add vmware guest modules" for details:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=2817

2. Enable NTP-based time synchronisation inside BA. However, at this moment, this solution is a little bit complex to implement, because sometimes BA is ran behind a proxified internet connection, which will mean NTP won't work with the outside world.
See discussions here, under "Use NTP Behind Proxy or Firewall" section:
http://xmodulo.com/2012/09/how-to-synchronize-time-with-ntp.html

References:
1. Similar issue:
http://serverfault.com/questions/136186/what-steps-can-you-take-to-ensure-sane-build-environments-when-compiling-softwar
Hint for increasing the reproducibility of the issue: "the thing that makes this really frustrating is that this script works sometimes, when the VM has been running for an hour or so it works, but not at boot."

2. Actual solution based on vmWare Time Synchronisation Linux vmWare plugin (contained in open-vmware-tools) or using ntpd:
http://www.guldmyr.com/blog/time-sync-for-linux-vms-in-vmware-workstation/

3. Technical discussion with valid pointers on stackoverflow:
http://stackoverflow.com/questions/276965/how-to-keep-a-vmware-vms-clock-in-sync

Others:
Timekeeping best practices for Linux guests (1006427)
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1006427

Timekeeping in VMware Virtual Machines
http://www.cse.iitd.ernet.in/~sbansal/csl862-virt/readings/vmware_timekeeping.pdf

Time drifting when running a Linux guest under VMware ESX server
http://www.novell.com/support/kb/doc.php?id=3858673

Network Time Protocol daemon
https://wiki.archlinux.org/index.php/Network_Time_Protocol_daemon
Comment 3 Cristian Iorga 2013-08-30 11:14:53 UTC
Please note that this issue is not easily reproducible (2 from 10, maybe).
Comment 4 Cristian Iorga 2014-01-09 12:12:09 UTC
Due to other more important tasks (and to the fact that I might be wrong with bug report) the issue will be solved in 1.6M3 timeframe.
Comment 5 Cristian Iorga 2014-03-21 14:43:15 UTC
Re-testing due to changed BA, changed vmWare Player started.
Comment 6 Cristian Iorga 2014-03-27 13:19:39 UTC
Patch sent in for review.
Comment 8 Cristian Iorga 2014-09-23 13:04:02 UTC
According to last reports, issue is still present, so I am reopening this.
Comment 9 Cristian Iorga 2014-09-23 13:04:41 UTC
*** Bug 6747 has been marked as a duplicate of this bug. ***
Comment 10 Cristian Iorga 2015-03-06 12:15:59 UTC
*** Bug 7288 has been marked as a duplicate of this bug. ***
Comment 11 Stephen K Jolley 2015-11-19 15:51:44 UTC
This was REOPENED
Comment 12 Cristian Iorga 2016-01-29 17:29:32 UTC
Created attachment 2954 [details]
Reference documentation about timekeeping in vmWare VMs

Reference documentation about timekeeping in vmWare VMs.
Comment 13 Randy MacLeod 2020-10-08 08:27:18 UTC
This seems to be working but we're not 100% sure.