vendor version/revision string

Andrew Bartlett abartlet at samba.org
Thu Jun 20 22:52:56 UTC 2024


On Thu, 2024-06-20 at 09:46 +0300, Michael Tokarev via samba-technical
wrote:
> Hi!
> 
> After Andrew added --vendor-name & --vendor-patch-revision options, I
> decided to give
> it another try to embed downstream (distribution) version info into
> the binaries
> (yes, I know all that stuff were there before too, in a form of
> VERSION file).
> 
> And faced the same old issue which I faced before, when I tried that
> previously and
> failed.
> 
> The prob is that --vendor-patch-revision expects just a
> number.  While in debian,
> version string is a string with many words, - even the debian
> revision "number"
> (everything after the upstream version) isn't a number but a
> string.  For example,
> 4.17.12+dfsg-0+deb12u1~bpo11+1 - there, --vendor-patch-revision is
> "0+deb12u1~bpo11+1".
> So --vendor-patch-revision can't be used obviously (as it fails right
> away if something
> besides a number is specified).

Yeah, this was one of those moments when the "smacking my head" meme
felt appropriate, it is set as an int in the configure stage because
otherwise the build fails when we encode it into a protocol structure
element (trying to represent the version in a binary form)! 

I was much frustrated, my simple little improvement was getting complex
(Samba as ever), and thankfully found I could restrict it to an in at
the command line parsing layer!

> So I tried to (ab-)use --vendor-name instead, - adding debian version
> string right to
> this one (there's no need to have both options, one is definitely
> enough).  And while
> at first it worked (for a simple version like 4.20.2+dfsg-1), it
> still fails later during
> build process with a version string which contains a tilde, like
> 4.20.2+dfsg-1~mjt-ubt24 -
> it fails at link time because linker script will contain tilde in a
> symbol name:
> 
> SAMBA_4.20.2_UBUNTU_4.20.2_DFSG_1~MJT_UBT24_PRIVATE_SAMBA {
> ..
> }
> 
> The wafsamba thing is tough to deal with (it's probably the most
> uneasy build system in
> the world).  I tried this change:
> 
> --- a/buildtools/wafsamba/samba_abi.py
> +++ b/buildtools/wafsamba/samba_abi.py
> @@ -288,3 +288,3 @@ def abi_build_vscript(task):
>   def VSCRIPT_MAP_PRIVATE(bld, libname, orig_vscript, version,
> private_vscript):
> -    version = version.replace("-", "_").replace("+","_").upper()
> +    version = version.replace("-",
> "_").replace("+","_").replace("~","_").upper()
>       t = bld.SAMBA_GENERATOR(private_vscript,
> @@ -317,3 +317,3 @@ def ABI_VSCRIPT(bld, libname, abi_directory,
> version, vscript, abi_match=None, p
>       libname = libname.replace("-", "_").replace("+","_").upper()
> -    version = version.replace("-", "_").replace("+","_").upper()
> +    version = version.replace("-",
> "_").replace("+","_").replace("~","_").upper()
> 
> (ugly but ok).

I see Douglas has a better idea down-thread.  Hopefully that can get
implemented. 

> This made the build succeed.  However, while whole version string
> sort of made it
> into the executables, there's still a prob in manpages:
> 
> Samba 4.20.2-Debian-4.
> 
> Yes, it is cut at the first dot.

I looked into this, something is just truncating it before generating
the TROFF.  Even if "4.21.0pre1-DEVELOPERBUILD" is in the
bin/default/docs-xml/build/DTD/samba.build.version then 

.TH "NET" "8" "05/06/2024" "Samba 4\&.21\&.0pre1\-DEVELOPE" "System
Administration tools"

Is what is emitted.  So some truncation the docbook-xml layers that I
dare not even look into. 

Thanks as always for your feedback,

Andrew Bartlett

-- 
Andrew Bartlett (he/him)       https://samba.org/~abartlet/
Samba Team Member (since 2001) https://samba.org
Samba Team Lead                https://catalyst.net.nz/services/samba
Catalyst.Net Ltd

Proudly developing Samba for Catalyst.Net Ltd - a Catalyst IT group
company

Samba Development and Support: https://catalyst.net.nz/services/samba

Catalyst IT - Expert Open Source Solutions




More information about the samba-technical mailing list