profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/shahmishal/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Mishal Shah shahmishal @apple Bay Area (California) swift.org Swift @ 

apple/swift-docker 1137

Docker Official Image packaging for Swift

shahmishal/calabash-checklist 2

Check if the system is setup correctly to start automating in calabash framework.

shahmishal/appurify-ruby 0

Ruby wrapper for Appurify API

shahmishal/docs 0

Documentation for Docker Official Images in docker-library

shahmishal/license-checker-demo 0

Fork this repository to your personal account to test your licence-checker GitHub App

shahmishal/official-images 0

Primary source of truth for the Docker "Official Images" program

shahmishal/swift 0

The Swift Programming Language

pull request commentapple/swift-driver

PrebuiltModuleGen: add support for -module-cache-path

@swift-ci please test

nkcsgexi

comment created time in 33 minutes

Pull request review commentapple/swift

[DNM] Placeholder types: take two

 Expr *ExprRewriter::coerceToType(Expr *expr, Type toType,                                  Optional<Pattern*> typeFromPattern) {   auto &ctx = cs.getASTContext(); +  // Diagnose conversions to invalid function types that couldn't be performed+  // beforehand because of placeholders.+  if (auto *fnTy = toType->getAs<FunctionType>()) {+    auto contextTy = cs.getContextualType(expr);+    if (cs.getConstraintLocator(locator)->isForContextualType() &&+        contextTy && contextTy->hasPlaceholder()) {+      TypeChecker::diagnoseInvalidFunctionType(fnTy, expr->getLoc(), None, dc,+                                               None);

🤞

Jumhyn

comment created time in 36 minutes

Pull request review commentapple/swift

[DNM] Placeholder types: take two

 Expr *ExprRewriter::coerceToType(Expr *expr, Type toType,                                  Optional<Pattern*> typeFromPattern) {   auto &ctx = cs.getASTContext(); +  // Diagnose conversions to invalid function types that couldn't be performed+  // beforehand because of placeholders.+  if (auto *fnTy = toType->getAs<FunctionType>()) {+    auto contextTy = cs.getContextualType(expr);+    if (cs.getConstraintLocator(locator)->isForContextualType() &&+        contextTy && contextTy->hasPlaceholder()) {+      TypeChecker::diagnoseInvalidFunctionType(fnTy, expr->getLoc(), None, dc,+                                               None);

Ok! I’ll give that a shot and see if there’s any unexpected fallout.

Jumhyn

comment created time in an hour

pull request commentapple/swift

Add support to skip watchOS 32-bit simulator by default

Build failed Swift Test OS X Platform Git Sha - df28939255e45326189ee956ce9c088665c91f24

shahmishal

comment created time in 3 hours

pull request commentapple/swift

C++ Interop: fix crash for Swift extensions of C++ classes declared in namespaces

@swift-ci please smoke test macOS

egorzhdan

comment created time in 3 hours

Pull request review commentapple/swift

[DNM] Placeholder types: take two

 Expr *ExprRewriter::coerceToType(Expr *expr, Type toType,                                  Optional<Pattern*> typeFromPattern) {   auto &ctx = cs.getASTContext(); +  // Diagnose conversions to invalid function types that couldn't be performed+  // beforehand because of placeholders.+  if (auto *fnTy = toType->getAs<FunctionType>()) {+    auto contextTy = cs.getContextualType(expr);+    if (cs.getConstraintLocator(locator)->isForContextualType() &&+        contextTy && contextTy->hasPlaceholder()) {+      TypeChecker::diagnoseInvalidFunctionType(fnTy, expr->getLoc(), None, dc,+                                               None);

Frankly I'm not sure exactly why it wasn't made to fail, I'd suggest you try to return ErrorType wrapping fnTy for cases when diagnoseInvalidFunctionType would produce an error in resolveASTFunctionType (so that code completion would still have access to underlying type) and return nullptr in coerceToType.

Jumhyn

comment created time in 4 hours

pull request commentapple/swift

[DiagnosticQol][SR-14505] Use DeclDescriptive kind in missing return data flow diagnostics

@swift-ci Please smoke test

LucianoPAlmeida

comment created time in 4 hours

pull request commentapple/swift-nio

Wrap concurrency code with @available(macOS 9999, etc)

#available(insertOSHere 9999) is always true when using swift.org toolchains. So wrap things in if #available(insertOSHere 9999) { }.

adam-fowler

comment created time in 8 hours

issue commentapple/swift-nio-ssl

Couldn't create simple authentication with .pem cert and private key

I recommend adding a ChannelHandler to your pipeline that prints errors:

final class ErrorHandler: ChannelInboundHandler {
    typealias InboundIn = Any

    func errorCaught(context: ChannelHandlerContext, error: Any) {
        print("caught error: \(error)")
    }
}

This will likely show an error being fired into the ChannelPipeline.

ozshabat

comment created time in 8 hours

pull request commentapple/swift

[silmem2reg] Compute DomTreeLevels lazily.

@swift-ci smoke test

gottesmm

comment created time in 8 hours

PR opened apple/swift

[silmem2reg] Compute DomTreeLevels lazily.

We previously were computing this eagerly meaning that if we did not actually need the DomTreeLevel map, we would calculate it and additionally incur a relatively large malloc for the DenseMap (which stores by default IIRC 64 key value pairs).

Now, we do it lazily ensuring that we only compute this if we actually need it (when promoting non-single block stack allocations).

+39 -28

0 comment

1 changed file

pr created time in 8 hours

pull request commentapple/swift-corelibs-xctest

Sr 1872 using runloopsource in wait for expectation

@stmontgomery @millenomi @compnerd Could you please provide your inputs on this?

@stmontgomery @millenomi @compnerd Could you please provide your inputs on this?

pranavshenoy

comment created time in 8 hours

push eventapple/swift

Richard Wei

commit sha adb916849d1eb3e8d14b5e611aa757fee8cc1cd7

[AutoDiff] [AST] Handle null decl in 'printDifferentiableAttrArguments'. `DeclAttribute::print()` accepts null decls and has a null default argument. A segfault was triggered in SourceKitService because `printDifferentiableAttrArguments()` took a null decl and deferenced it. This patch makes `printDifferentiableAttrArguments()` handle null decls — if the decl is null, we do not print the differentiability parameters or the `where` clause. I have not added a unit test however because I haven't been able to reproduce it independently. This will be done later as this change is low-risk. Resolves rdar://76095289.

view details

Richard Wei

commit sha f17142883421ec0a240dd7d2208dd4dd79aec612

Merge pull request #36954 from rxwei/76095289

view details

swift_jenkins

commit sha 8a34f2907c7f22a95d7cd83557435a25398e8e12

Merge remote-tracking branch 'origin/main' into next

view details

push time in 9 hours

push eventapple/swift

Richard Wei

commit sha adb916849d1eb3e8d14b5e611aa757fee8cc1cd7

[AutoDiff] [AST] Handle null decl in 'printDifferentiableAttrArguments'. `DeclAttribute::print()` accepts null decls and has a null default argument. A segfault was triggered in SourceKitService because `printDifferentiableAttrArguments()` took a null decl and deferenced it. This patch makes `printDifferentiableAttrArguments()` handle null decls — if the decl is null, we do not print the differentiability parameters or the `where` clause. I have not added a unit test however because I haven't been able to reproduce it independently. This will be done later as this change is low-risk. Resolves rdar://76095289.

view details

Richard Wei

commit sha f17142883421ec0a240dd7d2208dd4dd79aec612

Merge pull request #36954 from rxwei/76095289

view details

push time in 9 hours

PR merged apple/swift

[AutoDiff] [AST] Handle null decl in 'printDifferentiableAttrArguments'.

DeclAttribute::print() accepts null decls and has a null default argument. A segfault was triggered in SourceKitService because printDifferentiableAttrArguments took a null decl and deferenced it. This patch makes printDifferentiableAttrArguments() handle null decls — if the decl is null, we do not print the differentiability parameters or the where clause.

I have not added a unit test however because I haven't been able to reproduce it independently. This will be done later as this change is low-risk.

Resolves rdar://76095289.

+18 -11

2 comments

1 changed file

rxwei

pr closed time in 9 hours

push eventapple/swift

Michael Gottesman

commit sha 90c0bf6e14b3d87e445f07fba63ff5e2c96e066d

[gardening] Remove an unnecessary bounds check on a container. As suggested by @atrick in review feedback in #36913.

view details

Michael Gottesman

commit sha 7345fd8e47f3b5ca6861eb34586d3283d56d6c4a

Merge pull request #36924 from gottesmm/pr-9a40bc50803b002b698f4b755a1f07fdaf6bd02d [gardening] Remove an unnecessary bounds check on a container.

view details

swift_jenkins

commit sha 80a677fde5949ed2c76a698f8ffe6a50bd258856

Merge remote-tracking branch 'origin/main' into next

view details

push time in 9 hours

push eventapple/swift

Michael Gottesman

commit sha 90c0bf6e14b3d87e445f07fba63ff5e2c96e066d

[gardening] Remove an unnecessary bounds check on a container. As suggested by @atrick in review feedback in #36913.

view details

Michael Gottesman

commit sha 7345fd8e47f3b5ca6861eb34586d3283d56d6c4a

Merge pull request #36924 from gottesmm/pr-9a40bc50803b002b698f4b755a1f07fdaf6bd02d [gardening] Remove an unnecessary bounds check on a container.

view details

push time in 9 hours

PR merged apple/swift

[gardening] Remove an unnecessary bounds check on a container.

As suggested by @atrick in review feedback in #36913.

+0 -1

1 comment

1 changed file

gottesmm

pr closed time in 9 hours

pull request commentapple/swift-collections

Add missing final keyword

@lorentey first of all, sorry for long feedback.

What @kylemacomber said should be correct (at least according to this and this).

Which should mean that changes are only useful form code-style perspective.

But I did some additional performance testing for Deque (because _DequeBuffer was changed to final) to make sure that all works as expected. Did comparison of Deque with final _DequeBuffer vs non-final.

First, simply tested append operation with performance test (using measure).

func testAppend() {
  var deque = Deque<Int>()
    
  let options = XCTMeasureOptions()
  options.iterationCount = 100
    
  measure {
    (0...1000000).forEach { _ in deque.append(1) }
  }
}

Results:

  • Without WMO.
    • final - 0.775
    • non-final - 0.778 sec
  • With WMO (-O)
    • final - 0.024
    • non-final - 0.026 sec

Then, benchmark test append (max-size - 16M, cycles - 20). 01 Deque: append

Difference is quite small (and can be just accuracy error). Now for me it seems that changes are only useful to keep same style and do things explicit.

So @lorentey if you think that this PR is unnecessary, please feel free to close it 😀

DimaMishchenko

comment created time in 10 hours

pull request commentapple/swift

[DiagnosticQol][SR-14505] Use DeclDescriptive kind in missing return data flow diagnostics

@swift-ci Please smoke test

LucianoPAlmeida

comment created time in 10 hours

pull request commentapple/swift

[DiagnosticQol][SR-14505] Use DeclDescriptive kind in missing return data flow diagnostics

@swift-ci Please smoke test

LucianoPAlmeida

comment created time in 11 hours

pull request commentapple/swift

Fix long-standing soundness hole in rethrows checking

Instead of an underscored attribute, we could instead formalize it by introducing a new rethrows(unsafe) spelling in the function signature.

This would make sense to me—that, or some scoped bridging mechanism to allow an engineer to say "I'm going to call an intermediate function that can't throw an error itself (e.g. because it's @convention(c)), but which may need to catch an error thrown by the passed closure. Trust me." Which is of course what the new attribute does, but having a with-like function might be better from a readability standpoint (and would allow us to limit the scope of such behaviour to a specific subsection of the rethrowing function's body rather than the whole body.)

If nothing else, we could reserve the @_rethrowsUnchecked attribute for this with-like function only and tell everyone else to call it and not use the attribute directly.

slavapestov

comment created time in 12 hours

Pull request review commentapple/swift

Fix long-standing soundness hole in rethrows checking

 SIMPLE_DECL_ATTR(reasync, AtReasync,   ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove,   110) +SIMPLE_DECL_ATTR(_rethrowsUnchecked, RethrowsUnchecked,

It would be valuable to land this attribute before the checker changes so that code that relies on the current behaviour (such as DispatchQueue) has an opportunity to migrate.

slavapestov

comment created time in 12 hours

Pull request review commentapple/swift

[DNM] Placeholder types: take two

 Expr *ExprRewriter::coerceToType(Expr *expr, Type toType,                                  Optional<Pattern*> typeFromPattern) {   auto &ctx = cs.getASTContext(); +  // Diagnose conversions to invalid function types that couldn't be performed+  // beforehand because of placeholders.+  if (auto *fnTy = toType->getAs<FunctionType>()) {+    auto contextTy = cs.getContextualType(expr);+    if (cs.getConstraintLocator(locator)->isForContextualType() &&+        contextTy && contextTy->hasPlaceholder()) {+      TypeChecker::diagnoseInvalidFunctionType(fnTy, expr->getLoc(), None, dc,+                                               None);

Got it, makes sense. Yeah, you're right that to do this we'll have to have diagnoseInvalidFunctionType indicate failure.

Looking back at the "old" implementation, it looks like during type resolution we diagnosed these invalid types but didn't fail resolution, so presumably those invalid function types are getting applied to the AST. Do you think it makes sense to fail the application in all cases? I.e., remove the diagnoseInvalidFunctionType check from TypeResolver::resolveASTFunctionType and perform it only in coerceToType for all function types (not just those that had a placeholder), and fail coercion if so?

Jumhyn

comment created time in 13 hours

pull request commentapple/swift

[DiagnosticQol][SR-14505] Use DeclDescriptive kind in missing return data flow diagnostics

@swift-ci Please smoke test

LucianoPAlmeida

comment created time in 14 hours

Pull request review commentapple/swift

[DiagnosticQol][SR-14505] Use DeclDescriptive kind in missing return data flow diagnostics

 func testSR13753() {     //expected-warning@-1{{variable is unused}}   } }++// SR-14505+struct SR14505 {+    let b = true+    var x: Int {+        if b {+            return 0+        }+    } // expected-error {{missing return in a getter expected to return 'Int'}}++    var y: Int {+        get {+            if b {+                return 0+            }+        } // expected-error {{missing return in a getter expected to return 'Int'}}+        set {}+    } +}++class SR14505_C {+  static let a = false+  let b = true++  func method() -> Int {+    if b {+      return 0+    }+  } // expected-error {{missing return in a instance method expected to return 'Int'}}

It make sense to remove the article, thanks @harlanhaskins :)

LucianoPAlmeida

comment created time in 14 hours

issue openedapple/swift-nio-ssl

Couldn't create simple authentication with .pem cert and private key

Hey,

I'm trying to connect using a .pem file and private key. I have the following code:

class TCPClient1 {
    
    let handler = TCPClientHandler1()
    
    private let group = MultiThreadedEventLoopGroup(numberOfThreads: 1)
    var channel: Channel!
    
    func connect(host: String, port: Int) {
        do {
            channel = try buildBootstrap().connect(host: host, port: port).wait()
            try channel.closeFuture.wait()
        } catch let error {
            print(error)
        }
    }
    
    
    func buildBootstrap() -> ClientBootstrap {
        
        // client certificate and private key
        let myCertPath = Connector.findFileInProject("public-cert-no-pass", ".pem")!.relativePath
        let myKeyFile = Connector.findFileInProject("private-key-no-pass", ".pem")!.relativePath
        
        do {
            
            // client configurations
            var configuration = TLSConfiguration.forClient(certificateChain: try NIOSSLCertificate.fromPEMFile(myCertPath).map { .certificate($0) },
                                                           privateKey: .file(myKeyFile))
            
            configuration.certificateVerification = .noHostnameVerification // or `.fullVerification`
            configuration.trustRoots = .file(myCertPath) // only necessary if the server uses a self-signed cert or a custom CA that isn't trusted by the system. If your server has a real cert, you can delete this line
            
            
            let sslContext = try NIOSSLContext(configuration: configuration)
            
            
            return ClientBootstrap(group: group)
                .channelOption(ChannelOptions.socket(SocketOptionLevel(SOL_SOCKET), SO_REUSEADDR), value: 1)
                .channelOption(ChannelOptions.socket(IPPROTO_TCP, TCP_NODELAY), value: 1)
                .channelInitializer { channel in
                    var sslHandler: NIOSSLClientHandler?
                    do {
                        sslHandler = try NIOSSLClientHandler(context: sslContext, serverHostname: nil)
                    } catch let error {
                        print(error)
                    }
                    return channel.pipeline.addHandlers([ChannelHandler](arrayLiteral: sslHandler!, self.handler))
                }
            
            
        } catch let error {
            print(error)
            fatalError("What!")
        }
    }
    
    func stop() {
        do {
            try group.syncShutdownGracefully()
        } catch let error {
            print("Error shutting down \(error.localizedDescription)")
            exit(0)
        }
        print("Client connection closed")
    }
}

When I run connect with an ip and port I get (from the handler callbacks): registered! inactive channel! unregister channel!

So, for some reason, the channel is immediately turned to inactive upon connection. Anyone know why?

Thanks!

created time in 14 hours

pull request commentapple/swift-nio

Wrap concurrency code with @available(macOS 9999, etc)

Question is: how to actually use any of these now? I can't get -disable-availability-checking working with SPM :(

adam-fowler

comment created time in 14 hours

Pull request review commentapple/swift-syntax

Add Buildable gyb

+%{+  from gyb_syntax_support import *+  from gyb_syntax_support.kinds import lowercase_first_word+  from gyb_syntax_support.kinds import SYNTAX_BASE_KINDS+  # -*- mode: Swift -*-+  # Ignore the following admonition it applies to the resulting .swift file only++  def syntax_buildable_child_type(type_name, syntax_kind, is_token, is_optional=False):+    if syntax_kind in SYNTAX_BASE_KINDS:+      buildable_type = syntax_kind + 'Buildable'+    elif not is_token:+      buildable_type = syntax_kind+    else:+      buildable_type = type_name++    if is_optional:+      buildable_type += '?'++    return buildable_type+}%+//// Automatically Generated From DeclBuildables.swift.gyb.+//===----------------------------------------------------------------------===//+//+// This source file is part of the Swift.org open source project+//+// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors+// Licensed under Apache License v2.0 with Runtime Library Exception+//+// See https://swift.org/LICENSE.txt for license information+// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors+//+//===----------------------------------------------------------------------===//++import SwiftSyntax++// MARK: Protocols++% for kind in SYNTAX_BASE_KINDS:+%   if kind != 'SyntaxCollection':+%     build_kind = 'Syntax' if kind == 'Syntax' else kind + 'Syntax'+%     if kind == 'Syntax':+public protocol ${kind}ListBuildable {+%     else:+public protocol ${kind}ListBuildable: SyntaxListBuildable {+%     end+  func build${kind}List(format: Format, leadingTrivia: Trivia?) -> [${build_kind}]+}++%     if kind == 'Syntax':+public protocol ${kind}Buildable: ${kind}ListBuildable {+%     else:+public protocol ${kind}Buildable: SyntaxBuildable, ${kind}ListBuildable {+%     end+  func build${kind}(format: Format, leadingTrivia: Trivia?) -> ${build_kind}+}++extension ${kind}Buildable {+%     if kind != 'Syntax':+  func build${kind}(format: Format) -> ${build_kind} {+    build${kind}(format: format, leadingTrivia: nil)+  }+%     end+  public func buildSyntax(format: Format) -> Syntax {+    buildSyntax(format: format, leadingTrivia: nil)+  }++  public func buildSyntax(format: Format, leadingTrivia: Trivia?) -> Syntax {+    Syntax(build${kind}(format: format, leadingTrivia: leadingTrivia))+  }++  public func build${kind}List(format: Format) -> [${build_kind}] {+    build${kind}List(format: format, leadingTrivia: nil)+  }++  public func build${kind}List(format: Format, leadingTrivia: Trivia?) -> [${build_kind}] {+    [build${kind}(format: format, leadingTrivia: leadingTrivia)]+  }+}++%   end+% end++// MARK: - Buildables++% for node in SYNTAX_NODES:+%   if node.is_buildable():+public struct ${node.syntax_kind}: ${node.base_kind}Buildable {

And maybe also for the init and all the children?

kimdv

comment created time in 16 hours