Bug 209724

Summary: x11/xloadimage: Build fails if Samba is installed as PDC
Product: Ports & Packages Reporter: mail_of_sergey
Component: Individual Port(s)Assignee: Dmitry Marakasov <amdmi3>
Status: Closed FIXED    
Severity: Affects Only Me CC: ak, amdmi3
Priority: --- Keywords: needs-qa, patch
Version: LatestFlags: vlad-fbsd: maintainer-feedback? (ak)
Hardware: Any   
OS: Any   
Attachments:
Description Flags
compiling log
none
Proposed fix none

Description mail_of_sergey 2016-05-23 22:56:08 UTC
Created attachment 170583 [details]
compiling log

If Samba is installed and configured as PDC, xloadimage fail on BUILTIN\users:

build.c:4:213: error: \u used with no following hex digits
char *BuildUser= "uid=0(root) gid=0(wheel) groups=0(wheel),5(operator),1050(admin_nt_group),1069(domain_users),1083(softholder),1106(printer_admins),1322(winbindd_priv),10189(BUILTIN\administrators),10190(BUILTIN\users)";
Comment 1 Dmitry Marakasov freebsd_committer freebsd_triage 2016-05-24 13:27:08 UTC
Created attachment 170598 [details]
Proposed fix

Please check out attached patch.

It solves another problem: we're moving towards reproducible port builds, and xloadimage is not compatible with it as it compiles current date and `uname -a` output which changes across different systems into the binary. Also it's unable to detect operating system name correctly. So, don't compile date, uname and `id` output in, fixing both problems, and set OS name correctly for better `xloadimage -version` output
Comment 2 Dmitry Marakasov freebsd_committer freebsd_triage 2016-05-24 13:27:53 UTC
Awaiting maintainer's feedback
Comment 3 mail_of_sergey 2016-05-27 11:35:53 UTC
(In reply to Dmitry Marakasov from comment #1)
No, I got the same error.
Comment 4 Dmitry Marakasov freebsd_committer freebsd_triage 2016-05-28 20:41:03 UTC
You can't have the same error as `id` output can no longer end up in build.c. Please verify that you've placed the patch properly in files/ subdirectory. After patch phase, work/xloadimage.4.1/build-info should be the following:

---
#!/bin/sh
# this generates the "build.c" file

# try to find out the build date

  date='char *BuildDate= (char *)0;'

# try to find out who's doing the build.  there are two common places
# for 'id', /bin/id and /usr/bin/id.

    user='char *BuildUser= (char *)0;'

# try to find out the system information

  uname='char *BuildSystem= "FreeBSD";'

echo '/* THIS FILE IS AUTOMATICALLY GENERATED */' > build.c
echo $uname >> build.c
echo $date >> build.c
echo $user >> build.c
---
Comment 5 mail_of_sergey 2016-05-29 09:00:58 UTC
(In reply to Dmitry Marakasov from comment #4)
Sorry, now all correct.
Comment 6 Dmitry Marakasov freebsd_committer freebsd_triage 2016-05-29 13:05:39 UTC
Thanks for testing!

Reopening as the patch has not been committed yet.
Awaiting maintainer's feedback.
Comment 7 commit-hook freebsd_committer freebsd_triage 2016-06-06 04:42:20 UTC
A commit references this bug:

Author: ak
Date: Mon Jun  6 04:42:15 UTC 2016
New revision: 416442
URL: https://svnweb.freebsd.org/changeset/ports/416442

Log:
  - Regenerate distinfo
  - Fix build when Samba is installed and configured as PDC [1]
  - Make build reproducible [2]

  PR:	209724
  Submitted by:	mail_of_sergey@mail.ru
  Submitted by:	amdmi3 [1] [2]

Changes:
  head/x11/xloadimage/distinfo
  head/x11/xloadimage/files/patch-build-info
Comment 8 Alex Kozlov freebsd_committer freebsd_triage 2016-06-06 04:44:37 UTC
I apologize for my inattention, somehow I failed to get notices from bugzilla for this pr and only discovered it from last weekly reminder.
Comment 9 mail_of_sergey 2016-06-06 10:19:57 UTC
I test by 
make clean reinstall clean
it's works!

Thanks for all!