[swift-dev] Inability to leverage privacy in the stdlib

Alexis abeingessner at apple.com
Tue Nov 1 11:10:42 CDT 2016


I made a PR with some basic privacy usage for Array, and everything seems to be working on OSX, but not Linux. 

https://github.com/apple/swift/pull/5573 <https://github.com/apple/swift/pull/5573>

Exit Code: 1

Command Output (stderr):
--
/usr/bin/ld.gold: error: /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/swift-linux-x86_64/lib/swift_static/linux/libswiftSwiftOnoneSupport.a(SwiftOnoneSupport.o): multiple definition of '_TTSfq4n_d___TTSgq5Si___TZFVs15ContiguousArrayP33_4E8E8F8E53AAC7AA89B428DCA7DB222B11_copyBufferfRGVs22_ContiguousArrayBufferx_T_'
/usr/bin/ld.gold: /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/swift-linux-x86_64/lib/swift_static/linux/libswiftCore.a(Swift.o): previous definition here
/usr/bin/ld.gold: error: /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/swift-linux-x86_64/lib/swift_static/linux/libswiftSwiftOnoneSupport.a(SwiftOnoneSupport.o): multiple definition of '_TTSfq4n_d___TTSgq5Vs4Int8___TZFSaP33_4E8E8F8E53AAC7AA89B428DCA7DB222B11_copyBufferfRGVs22_ContiguousArrayBufferx_T_'
/usr/bin/ld.gold: /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/swift-linux-x86_64/lib/swift_static/linux/libswiftCore.a(Swift.o): previous definition here
/usr/bin/ld.gold: error: /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/swift-linux-x86_64/lib/swift_static/linux/libswiftSwiftOnoneSupport.a(SwiftOnoneSupport.o): multiple definition of '_TTSfq4n_d___TTSgq5Vs5UInt8___TZFSaP33_4E8E8F8E53AAC7AA89B428DCA7DB222B11_copyBufferfRGVs22_ContiguousArrayBufferx_T_'
/usr/bin/ld.gold: /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-master/buildbot_linux/swift-linux-x86_64/lib/swift_static/linux/libswiftCore.a(Swift.o): previous definition here
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)

--

Close... (made copyBuffer private)


> On Oct 29, 2016, at 6:04 PM, Dave Abrahams via swift-dev <swift-dev at swift.org> wrote:
> 
> 
> on Sat Oct 29 2016, Alexis <swift-dev-AT-swift.org <http://swift-dev-at-swift.org/>> wrote:
> 
>>> On Oct 29, 2016, at 12:13 AM, Slava Pestov <spestov at apple.com> wrote:
>>> 
>>> It will become the default, but not yet, so yeah, you shouldn’t merge anything that only builds
>> with this flag set.
>>> 
>>> Can you share the patch that adds private modifiers along with the
>>> linker errors you are seeing? Now would be a good time to sort out
>>> these issues.
>> 
>> I’m actually having trouble reproducing this now? I just rebased my
>> branches onto master and using private/fileprivate on types, aliases,
>> and functions seems to work perfectly fine (I tried a few things in
>> Array and Dictionary). Did something interesting just get merged?
> 
> I suggest you try making and testing a pull request.  Often things seem
> to work because of the way we build and test locally, but fail in the
> full CI environment.
> 
>> 
>>> 
>>>> On Oct 28, 2016, at 4:16 PM, Alexis Beingessner <abeingessner at apple.com <mailto:abeingessner at apple.com>
>> <mailto:abeingessner at apple.com <mailto:abeingessner at apple.com>>> wrote:
>>>> 
>>>> Won't merging anything relying on this flag break the build? Is this going to become the "new"
>> default soon?
>>>> 
>>>> On Oct 28, 2016, at 6:43 PM, Slava Pestov <spestov at apple.com <mailto:spestov at apple.com> <mailto:spestov at apple.com <mailto:spestov at apple.com>>> wrote:
>>>> 
>>>>> 
>>>>>> On Oct 23, 2016, at 4:13 PM, Michael Gottesman via swift-dev
>>>>>> <swift-dev at swift.org <mailto:swift-dev at swift.org> <mailto:swift-dev at swift.org <mailto:swift-dev at swift.org>>> wrote:
>>>>>> 
>>>>>> 
>>>>>>> On Oct 23, 2016, at 3:30 PM, Alexis Beingessner via swift-dev
>>>>>>> <swift-dev at swift.org <mailto:swift-dev at swift.org> <mailto:swift-dev at swift.org <mailto:swift-dev at swift.org>>> wrote:
>>>>>>> 
>>>>>>> Dave pointed out to me this week that the build crashes if the
>>>>>>> stdlib tries to use private/fileprivate. I tried it myself and
>>>>>>> lo and behold the linker can't find the private symbols. He
>>>>>>> couldn't recall what about the build caused that, though.
>>>>>>> 
>>>>>>> Can anyone recall why this is? How hard is it to fix?
>>>>>> 
>>>>>> I am not 100% sure, but if it happens only with the stdlib and
>>>>>> has to do with access control, I wouldn't be surprised if it has
>>>>>> to do with -sil-serialize-all and friends. But I may be
>>>>>> correct. I think Jordan is the right person to answer this
>>>>>> question.
>>>>>> 
>>>>>> What do you think Jordan?
>>>>>> Michael
>>>>> 
>>>>> Hi Alexis,
>>>>> 
>>>>> You can build the stdlib without sil-serialize-all now by passing a flag to build-script:
>>>>> 
>>>>> ./utils/build-script — --swift-stdlib-enable-resilience
>>>>> 
>>>>> Give that a shot and see if it fixes the issues you’re having with ‘private’.
>>>>> 
>>>>>> 
>>>>>>> _______________________________________________
>>>>>>> swift-dev mailing list
>>>>>>> swift-dev at swift.org <mailto:swift-dev at swift.org> <mailto:swift-dev at swift.org <mailto:swift-dev at swift.org>>
>>>>>>> https://lists.swift.org/mailman/listinfo/swift-dev <https://lists.swift.org/mailman/listinfo/swift-dev>
>> <https://lists.swift.org/mailman/listinfo/swift-dev <https://lists.swift.org/mailman/listinfo/swift-dev>>
>>>>>> 
>>>>>> _______________________________________________
>>>>>> swift-dev mailing list
>>>>>> swift-dev at swift.org <mailto:swift-dev at swift.org> <mailto:swift-dev at swift.org <mailto:swift-dev at swift.org>>
>>>>>> https://lists.swift.org/mailman/listinfo/swift-dev <https://lists.swift.org/mailman/listinfo/swift-dev>
>> <https://lists.swift.org/mailman/listinfo/swift-dev <https://lists.swift.org/mailman/listinfo/swift-dev>>
>>>>> 
>>> 
>> 
>> _______________________________________________
>> swift-dev mailing list
>> swift-dev at swift.org <mailto:swift-dev at swift.org>
>> https://lists.swift.org/mailman/listinfo/swift-dev <https://lists.swift.org/mailman/listinfo/swift-dev>
>> 
> 
> -- 
> -Dave
> 
> _______________________________________________
> swift-dev mailing list
> swift-dev at swift.org <mailto:swift-dev at swift.org>
> https://lists.swift.org/mailman/listinfo/swift-dev <https://lists.swift.org/mailman/listinfo/swift-dev>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20161101/25b21e32/attachment.html>


More information about the swift-dev mailing list