[wix-devs] Static libraries across VS versions

Sean Hall r.sean.hall at gmail.com
Mon Dec 6 10:27:14 PST 2021


Agreed. So like Rob was saying, we only need to build the libs once using
VS2022 - v140 for x86 and x64 and v141 for ARM64.

On Mon, Dec 6, 2021 at 12:24 PM Bob Arnson <bob at firegiant.com> wrote:

> It does appear that VS2022 includes only the latest toolsets for each v14x:
>
> * v140: v14.00
> * v141: v14.16
> * v142: v14.29-16.11
> * v143: v14.30-17.0, Latest
>
> But I'm going to trust that:
>
> 1. We don't need to install the old versions of Visual Studio; including
> the old toolsets in the latest version is supported for our purposes.
> 2. They didn't introduce any incompatibility within a toolset v14x
> version. So the admonition isn't about point releases within the toolset
> version, just across toolset versions. (I admit that I'm reading into what
> they *didn't* say.)
>
> -----Original Message-----
> From: wix-devs <wix-devs-bounces at lists.wixtoolset.org> On Behalf Of Sean
> Hall via wix-devs
> Sent: Monday, 6 December, 2021 13:11
> To: WiX Toolset Developer Mailing List <wix-devs at lists.wixtoolset.org>
> Cc: Sean Hall <r.sean.hall at gmail.com>
> Subject: Re: [wix-devs] Static libraries across VS versions
>
> The problem is this part - "You can link a version 16.2 library to a
> version 16.4
> > app as long as you use a 16.4 or later toolset."
>
> If the version of the toolset in VS2022 that builds the v140 toolset is
> newer than any available version for VS2015, then technically they wouldn't
> support using our .libs with VS2015.
>
> On Mon, Dec 6, 2021 at 12:07 PM Rob Mensching <rob at firegiant.com> wrote:
>
> > I think this part in the document says we only need the oldest:
> >
> > > Say you have third-party libraries built by Visual Studio 2015. You
> > > can
> > still use them in an application built by Visual Studio 2017, 2019, or
> > 2022. There's no need to recompile with a matching toolset.
> >
> > So, if you target v140 it works with all linkers in the v14x line. Right?
> >
> > -----Original Message-----
> > From: wix-devs <wix-devs-bounces at lists.wixtoolset.org> On Behalf Of
> > Sean Hall via wix-devs
> > Sent: Monday, December 6, 2021 10:05 AM
> > To: WiX Toolset Developer Mailing List <wix-devs at lists.wixtoolset.org>
> > Cc: Sean Hall <r.sean.hall at gmail.com>
> > Subject: Re: [wix-devs] Static libraries across VS versions
> >
> > With that line of reasoning, we would have to build each toolset with
> > the version of Visual Studio that introduced it. Hopefully that's not
> necessary.
> >
> > On Mon, Dec 6, 2021 at 11:57 AM Bob Arnson via wix-devs <
> > wix-devs at lists.wixtoolset.org> wrote:
> >
> > > We still need to build the libraries for each toolset version (per
> > > the article Sean pointed out) because a VS2017 user won't be using
> > > the
> > > VS2022 linker. IOW, they maintained backward compatibility but not
> > > forward compatibility. (Or at least don't guarantee it.)
> > >
> > > -----Original Message-----
> > > From: Rob Mensching <rob at firegiant.com>
> > > Sent: Monday, 6 December, 2021 12:50
> > > To: Bob Arnson <bob at firegiant.com>; WiX Toolset Developer Mailing
> > > List < wix-devs at lists.wixtoolset.org>
> > > Subject: RE: [wix-devs] Static libraries across VS versions
> > >
> > > But today, we're building the libs multiple times (one for each
> > > supported v14x and architecture). Now we'll be able to build each
> > > project per-architecture. That's a nice reduction in .lib build
> > > matrix,
> > right?
> > >
> > > -----Original Message-----
> > > From: Bob Arnson <bob at firegiant.com>
> > > Sent: Monday, December 6, 2021 9:10 AM
> > > To: WiX Toolset Developer Mailing List
> > > <wix-devs at lists.wixtoolset.org>
> > > Cc: Rob Mensching <rob at firegiant.com>
> > > Subject: RE: [wix-devs] Static libraries across VS versions
> > >
> > > Basically what we're doing today. :sad_face:
> > >
> > > -----Original Message-----
> > > From: wix-devs <wix-devs-bounces at lists.wixtoolset.org> On Behalf Of
> > > Rob Mensching via wix-devs
> > > Sent: Monday, 6 December, 2021 11:40
> > > To: WiX Toolset Developer Mailing List
> > > <wix-devs at lists.wixtoolset.org>
> > > Cc: Rob Mensching <rob at firegiant.com>
> > > Subject: Re: [wix-devs] Static libraries across VS versions
> > >
> > > So we can standardize on VS2022 and build the libraries only once
> > > but will still need to build the libraries using the "v140" toolset
> > > (or "v141" if we dump VS2015 support or "v142" if we dump VS2017
> support).
> > >
> > > Too bad it isn't the other way around.
> > >
> > > -----Original Message-----
> > > From: wix-devs <wix-devs-bounces at lists.wixtoolset.org> On Behalf Of
> > > Sean Hall via wix-devs
> > > Sent: Monday, December 6, 2021 8:30 AM
> > > To: WiX Toolset Developer Mailing List
> > > <wix-devs at lists.wixtoolset.org>
> > > Cc: Sean Hall <r.sean.hall at gmail.com>
> > > Subject: Re: [wix-devs] Static libraries across VS versions
> > >
> > > Microsoft explicitly does not support this -
> > > https://docs.microsoft.com/en-us/cpp/porting/binary-compat-2015-2017.
> > >
> > > * You can mix binaries built by different versions of the v140,
> > > v141, v142, and v143 toolsets. However, you must link by using a
> > > toolset at least as recent as the most recent binary in your app.
> > > Here's an
> > > example: you can link an app compiled using any 2017 toolset (v141,
> > > versions 15.0 through
> > > 15.9) to a static library compiled using, say, Visual Studio 2019
> > > version
> > > 16.2 (v142). You just have to link them by using a version 16.2 or
> > > later toolset. You can link a version 16.2 library to a version 16.4
> > > app as long as you use a 16.4 or later toolset.
> > >
> > > On Sun, Dec 5, 2021 at 5:21 PM Bob Arnson via wix-devs <
> > > wix-devs at lists.wixtoolset.org> wrote:
> > >
> > > > I'll open an issue but wanted to get a head start. I gave myself
> > > > the action item (oh god, I can't believe I just said that) to
> > > > investigate whether we could build our static libraries with the
> > > > latest VS and use them "down-level" on earlier versions of VS. The
> > answer...
> > > >
> > > > ...is yes, we can. I built DUtil with VS2022 and with some tweak
> > > > to the nupkeg was able to consume it from a project originally
> > > > built with
> > > > VS2019 and subsequently built with VS2017. It's not an exhaustive
> > > > test
> > > > - console, string, proc -- but I suspect that it was more of a
> > > > pass/fail
> > > test.
> > > >
> > > > Questions:
> > > >
> > > >
> > > >   1.  Should we do this? (I vote +1.)
> > > >   2.  Should we do this now, with VS2019 as the baseline?
> > > >   3.  Should we decide now to use VS2022 as the baseline?
> > > >
> > > > __________________________________________________________________
> > > > __ WiX Toolset Developer Mailing List provided by FireGiant
> > > > http://www.firegiant.com/
> > > >
> > > ____________________________________________________________________
> > > WiX Toolset Developer Mailing List provided by FireGiant
> > > http://www.firegiant.com/
> > > ____________________________________________________________________
> > > WiX Toolset Developer Mailing List provided by FireGiant
> > > http://www.firegiant.com/
> > > ____________________________________________________________________
> > > WiX Toolset Developer Mailing List provided by FireGiant
> > > http://www.firegiant.com/
> > >
> > ____________________________________________________________________
> > WiX Toolset Developer Mailing List provided by FireGiant
> > http://www.firegiant.com/
> >
> ____________________________________________________________________
> WiX Toolset Developer Mailing List provided by FireGiant
> http://www.firegiant.com/
>



More information about the wix-devs mailing list