[ZBX-16074] Cannot compile Zabbix Windows agent after migration to Git Created: 2019 May 03  Updated: 2024 Apr 10  Resolved: 2019 May 25

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G)
Affects Version/s: None
Fix Version/s: 2.2.24rc1, 3.0.28rc1, 4.0.8rc1, 4.2.2rc1, 4.4.0alpha1, 4.4 (plan)

Type: Problem report Priority: Critical
Reporter: Alexander Vladishev Assignee: Michael Veksler
Resolution: Fixed Votes: 0
Labels: compilation, windows
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Team: Team A
Sprint: Sprint 52 (May 2019)
Story Points: 1

 Description   

Steps to reproduce:

  1. Try to compile Windows agents

Result:

resource.rc(72) : error RC2104 : undefined keyword or key name: cb6f9f4

MC: Compiling messages.mc
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0\x86\rc.exe"' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\bin\HostX86\x86\nmake.EXE"' : return code '0x2'
Stop.


 Comments   
Comment by Michael Veksler [ 2019 May 03 ]

The problem is related to the format of revision value. After migration to git, revision became alphanumeric. But windows agent required 2 bytes numeric format of revision for file properties.

What are possible solutions:

Nr  
1 take the first 7 chars from sha1 of the last commit
and convert string as hex digit
1. hard link to last build commit
2. robust to random change history
1. it is not easy get info about which zabbix_agetd.exe is newer
2. win installer take this number into account  during upgrade process
2 UTC date of last commit 1. relatively direct link to the commit
2. newer agent will get bigger revision
3. robust to random change history
1. relatively wide number: 1556632265
2. MS revision field 2 bytes, but utc should be 8 bytes (till 2038)
3 Number of last commit. We should take into account
that history of master and release branches do not rewrite.
1. newer agent will get bigger revision
2. short number (fits in 2 bytes)
1. not present direct link to the commit
2. the history can be changed in the future.
4 Number of Jenkins build 1. newer agent will get bigger revision
2. short number (fits in 2 bytes)
Impossible connect 'build' number with 'commit' without Jenkins logs.
5 delta between UTC date of the last build commit and commit tagged as minor release 1. newer agent will get bigger revision
2. number fits in 4 bytes
3. robust to random change history
1. for first build of new release the revision will be equal to 0
2. not easy to find the last build commit
6 delta between commit count of build point and commit tagged as minor release 1. newer agent will get bigger revision
2. short number (fits in 2 bytes)
1. not present direct link to the commit
2. the history can be changed in the future.

I think we should choose method 3 or 6

Additional question: will new "revision policy" be applied to all agent or only to windows agent ?

Comment by Andris Mednis [ 2019 May 20 ]

Available in:

  • 2.2.24rc1 3b87bcd9cde
  • 3.0.28rc1 babb8eafcc0
  • 4.0.8rc1 64128b7771f
  • 4.2.2rc1 b16f45658ac
  • 4.4.0alpha1(trunk) a18680803d1
Generated at Fri Apr 26 17:57:34 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.