Opened 9 years ago

Last modified 9 years ago

#8719 new Bugs

Not possible to target older iOS major version when using SDK from later version

Reported by: William Gallafent <william@…> Owned by:
Milestone: To Be Determined Component: Building Boost
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

Current example: I want to build using iOS SDK version 6.1, but with the minimum target OS version set to 5.1.

In order to achieve this I set macosx-version-min=5.1, macosx-version=6.1.

The code in darwin.jam, however, does not see 5.1 as a valid minimum version when the SDK version is 6.1. The code below appears to permit only 6.0 and 6.1.

        if $(version[3]) > 0
        {
            # We have a minor version of an SDK. We want to set up
            # previous minor versions, plus the current minor version.
            # So we recurse to set up the previous minor versions, up to
            # the current version.
            local minor-minus-1 = [ CALC $(version[3]) - 1 ] ;
            return
                [ init-sdk $(condition) : $(root)
                    : $(version[1-2]) $(minor-minus-1) : [ version-to-feature $(version[1-2]) $(minor-minus-1) ] ]
                $(version-feature) ;
        }

The resulting error when attempting to target 5.1 while using the 6.1 SDK is:

/Users/williamg/Projects/Experimenta/universe/boost/boost_1_53_0/tools/build/v2/build/feature.jam:485: in validate-value-string from module feature
error: "iphone-5.1" is not a known value of feature <macosx-version-min>
error: legal values: "iphone-6.1" "iphone-6.0" "iphonesim-6.1" "iphonesim-6.0" "10.7" "10.6" "10.5" "10.4" "10.3" "10.2" "10.1" "10.0" "10.8"

This needs to change so that it's possible to target versions of the OS older than the same major release.

Discovered in Boost 1.53, but still present on trunk at time of writing.

Change History (1)

comment:1 by William Gallafent <william@…>, 9 years ago

I have currently fudged my way around this by adding the following code above the minor-version recursion that I quoted in the original report:

        if $(version[2]) > 4
        {
        # ToDo: How do we know at what number to start counting down the minor revision,
        # for the previous major revision?
        # For now just fudge: historically the highest it's ever got is 3 (for 4.3).
        # Should also work out how much lower than current SDK version to go down to,
        # looking at historical minimum target versions for given SDK versions
        # (This also applies for actual Mac OS X, as well as iOS)
            local major-minus-1 = [ CALC $(version[2]) - 1 ] ;
            return
                [ init-sdk $(condition) : $(root)
                    : $(version[1]) $(major-minus-1) 3 : [ version-to-feature $(version[1]) $(major-minus-1) 3 ] ]
                $(version-feature) ;
        }
Note: See TracTickets for help on using tickets.