profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/aciidb0mb3r/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.
Ankit Aggarwal aciidb0mb3r @aciidb0mb3r Bhiwadi, India http://ankit.im

startedr0oth3x49/udemy-dl

started time in 28 minutes

startedkevinhwang91/nvim-hlslens

started time in 29 minutes

startedsultan99/stylin

started time in 31 minutes

create barnchSwiftWeekly/swiftweekly.github.io

branch : issue_183

created branch time in 2 hours

pull request commentapple/swift-tools-support-core

Improve path normalization and judgment on Windows

First, please work with @compnerd to get this PR to a mergeable state.

I’m just missing the point to evolve this PR. I believe in its current state it’s making things better (but not perfect yet) without introducing new problems.

@compnerd Can you make a detailed review on the codes?

stevapple

comment created time in 12 hours

fork aChase55/SwiftMQTT

MQTT Client in pure swift ❤️

fork in 17 hours

Pull request review commentapple/swift-tools-support-core

improve process state management

 public final class Process: ObjectIdentifierProtocol {     public private(set) var processID = ProcessID()   #endif -    /// If the subprocess has launched.-    /// Note: This property is not protected by the serial queue because it is only mutated in `launch()`, which will be-    /// called only once.-    public private(set) var launched = false+    // process execution mutable state+    private var state: State = .idle+    private let stateLock = Lock()      /// The result of the process execution. Available after process is terminated.+    /// This will block while the process is running, as such equivalent to `waitUntilExit`

short of removing this method, this is the only safe option I can think of. do you have other ideas we should explore?

tomerd

comment created time in 19 hours

issue commentSwiftWeekly/swiftweekly.github.io

[183] Issue #183 - April 22, 2021

https://holyswift.app/single-forward-pipe-operator-in-swift

fassko

comment created time in 19 hours

Pull request review commentapple/swift-tools-support-core

improve process state management

 public final class Process: ObjectIdentifierProtocol {     public private(set) var processID = ProcessID()   #endif -    /// If the subprocess has launched.-    /// Note: This property is not protected by the serial queue because it is only mutated in `launch()`, which will be-    /// called only once.-    public private(set) var launched = false+    // process execution mutable state+    private var state: State = .idle+    private let stateLock = Lock()      /// The result of the process execution. Available after process is terminated.+    /// This will block while the process is running, as such equivalent to `waitUntilExit`

Based on the current implementation, the semantics seem to be that it returns nil if called in readingOutput state (due to not holding the state lock during the Thread.join() calls) but blocks if called in outputReady state (due to holding the state lock during waitpid()). So it depends on whether all the output from the process has been read yet. Since the result property is deprecated and nothing seems to rely on it, I don't think that's a problem, but wanted to check if that matches the intent.

tomerd

comment created time in 20 hours

pull request commentapple/swift-tools-support-core

Improve path normalization and judgment on Windows

I’d expect System to bring the fully-functional path parsing.

I propose a phased approach:

First, please work with @compnerd to get this PR to a mergeable state.

Later, we should start landing PRs that refactor TSC to use SwiftSystem.

Shipping a SwiftPM which cannot resolve .package(path: "../AnotherPackage") with 5.4 is definitely not what we’d like to see.

its too late for 5.4.0, but once we merge this PR into main, we should open a PR against the 5.4 branch so that if/when we roll a 5.4.1 dot release we can include it

stevapple

comment created time in 21 hours

issue commentSwiftWeekly/swiftweekly.github.io

[183] Issue #183 - April 22, 2021

https://github.com/swift-server/swift-backtrace/pull/42: Backtrace: enable support for Windows

fassko

comment created time in a day

created repositoryorta/specs-repo-git-scanner

created time in a day

pull request commentapple/swift-tools-support-core

Improve path normalization and judgment on Windows

@ddunbar May you take a look at this PR? :) I believe that's a critical one for the 5.4 release.

Also @tomerd here because this mainly solves a bug in SwiftPM.

stevapple

comment created time in a day

push eventSwiftWeekly/swiftweekly.github.io

Bas Broek

commit sha 60561f0e94c6df21306c527ba7d390e720da53d0

Update Gemfile.lock

view details

push time in a day

created tagapple/swift-tools-support-core

tagswift-DEVELOPMENT-SNAPSHOT-2021-04-18-a

Contains common infrastructural code for both SwiftPM and llbuild.

created time in a day

created tagapple/swift-integration-tests

tagswift-DEVELOPMENT-SNAPSHOT-2021-04-18-a

Automated tests for validating the generated Swift snapshots behave correctly

created time in a day

created tagapple/swift-llbuild

tagswift-DEVELOPMENT-SNAPSHOT-2021-04-18-a

A low-level build system, used by Xcode and the Swift Package Manager

created time in a day

issue commentSwiftWeekly/swiftweekly.github.io

[183] Issue #183 - April 22, 2021

SE-0309: Unlock existential types for all protocols

https://forums.swift.org/t/se-0309-unlock-existential-types-for-all-protocols/47515

fassko

comment created time in a day

issue commentSwiftWeekly/swiftweekly.github.io

[183] Issue #183 - April 22, 2021

https://twitter.com/towernter/status/1383815365520629760

fassko

comment created time in 2 days

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 2 days

issue commentSwiftWeekly/swiftweekly.github.io

[183] Issue #183 - April 22, 2021

SE-0309: Unlock existential for all protocols

https://forums.swift.org/t/se-0309-unlock-existential-types-for-all-protocols/47515

fassko

comment created time in 3 days

issue commentSwiftWeekly/swiftweekly.github.io

[183] Issue #183 - April 22, 2021

SE-0311: Task-local values

https://forums.swift.org/t/se-0311-task-local-values/47478

fassko

comment created time in 3 days

Pull request review commentapple/swift-tools-support-core

improve process state management

 public final class Process: ObjectIdentifierProtocol {         if outputRedirection.redirectsOutput {             let stdoutPipe = Pipe()             let stderrPipe = Pipe()++            var pending: [UInt8]?+            let pendingLock = Lock()+             stdoutPipe.fileHandleForReading.readabilityHandler = { (fh : FileHandle) -> Void in                 let contents = fh.readDataToEndOfFile()                 self.outputRedirection.outputClosures?.stdoutClosure([UInt8](contents))-                if case .success(let data) = self.stdout.result {-                    self.stdout.result = .success(data + contents)+                pendingLock.withLock {+                    if let stderr = pending {+                        self.stateLock.withLock {+                            self?.state = .outputReady(stdout: .success(contents), stderr: .success(stderr))+                        }+                    } else {+                        pending = contents+                    }                 }             }             stderrPipe.fileHandleForReading.readabilityHandler = { (fh : FileHandle) -> Void in                 let contents = fh.readDataToEndOfFile()                 self.outputRedirection.outputClosures?.stderrClosure([UInt8](contents))-                if case .success(let data) = self.stderr.result {-                    self.stderr.result = .success(data + contents)+                pendingLock.withLock {+                    if let stdout = pending {+                        self.stateLock.withLock {+                            self?.state = .outputReady(stdout: .success(stdout), stderr: .success(contents))
                            self.state = .outputReady(stdout: .success(stdout), stderr: .success(contents.withUnsafeBytes { Array<UInt8>($0) }))
tomerd

comment created time in 3 days

Pull request review commentapple/swift-tools-support-core

improve process state management

 public final class Process: ObjectIdentifierProtocol {         if outputRedirection.redirectsOutput {             let stdoutPipe = Pipe()             let stderrPipe = Pipe()++            var pending: [UInt8]?+            let pendingLock = Lock()+             stdoutPipe.fileHandleForReading.readabilityHandler = { (fh : FileHandle) -> Void in                 let contents = fh.readDataToEndOfFile()                 self.outputRedirection.outputClosures?.stdoutClosure([UInt8](contents))-                if case .success(let data) = self.stdout.result {-                    self.stdout.result = .success(data + contents)+                pendingLock.withLock {+                    if let stderr = pending {+                        self.stateLock.withLock {+                            self?.state = .outputReady(stdout: .success(contents), stderr: .success(stderr))
                            self.state = .outputReady(stdout: .success(contents.withUnsafeBytes { Array<UInt8>($0) }), stderr: .success(stderr))
tomerd

comment created time in 3 days

Pull request review commentapple/swift-tools-support-core

improve process state management

 public final class Process: ObjectIdentifierProtocol {         if outputRedirection.redirectsOutput {             let stdoutPipe = Pipe()             let stderrPipe = Pipe()++            var pending: [UInt8]?+            let pendingLock = Lock()+             stdoutPipe.fileHandleForReading.readabilityHandler = { (fh : FileHandle) -> Void in                 let contents = fh.readDataToEndOfFile()                 self.outputRedirection.outputClosures?.stdoutClosure([UInt8](contents))-                if case .success(let data) = self.stdout.result {-                    self.stdout.result = .success(data + contents)+                pendingLock.withLock {+                    if let stderr = pending {+                        self.stateLock.withLock {+                            self?.state = .outputReady(stdout: .success(contents), stderr: .success(stderr))+                        }+                    } else {+                        pending = contents+                    }                 }             }             stderrPipe.fileHandleForReading.readabilityHandler = { (fh : FileHandle) -> Void in                 let contents = fh.readDataToEndOfFile()                 self.outputRedirection.outputClosures?.stderrClosure([UInt8](contents))-                if case .success(let data) = self.stderr.result {-                    self.stderr.result = .success(data + contents)+                pendingLock.withLock {+                    if let stdout = pending {+                        self.stateLock.withLock {+                            self?.state = .outputReady(stdout: .success(stdout), stderr: .success(contents))+                        }+                    } else {+                        pending = contents
                        pending = contents.withUnsafeBytes { Array<UInt8>($0) }
tomerd

comment created time in 3 days

Pull request review commentapple/swift-tools-support-core

improve process state management

 public final class Process: ObjectIdentifierProtocol {         if outputRedirection.redirectsOutput {             let stdoutPipe = Pipe()             let stderrPipe = Pipe()++            var pending: [UInt8]?+            let pendingLock = Lock()+             stdoutPipe.fileHandleForReading.readabilityHandler = { (fh : FileHandle) -> Void in                 let contents = fh.readDataToEndOfFile()                 self.outputRedirection.outputClosures?.stdoutClosure([UInt8](contents))-                if case .success(let data) = self.stdout.result {-                    self.stdout.result = .success(data + contents)+                pendingLock.withLock {+                    if let stderr = pending {+                        self.stateLock.withLock {+                            self?.state = .outputReady(stdout: .success(contents), stderr: .success(stderr))+                        }+                    } else {+                        pending = contents
                        pending = contents.withUnsafeBytes { Array<UInt8>($0) }
tomerd

comment created time in 3 days

pull request commentapple/swift-tools-support-core

improve process state management

This definitely doesn't seem to build on Windows:

S:\SourceCache\swift-tools-support-core\Sources\TSCBasic\Process.swift:419:33: error: cannot use optional chaining on non-optional value of type 'Process'
                            self?.state = .outputReady(stdout: .success(contents), stderr: .success(stderr))
                            ~~~~^

S:\SourceCache\swift-tools-support-core\Sources\TSCBasic\Process.swift:419:73: error: cannot convert value of type 'Data' to expected argument type '[UInt8]'
                            self?.state = .outputReady(stdout: .success(contents), stderr: .success(stderr))
                                                                        ^
S:\SourceCache\swift-tools-support-core\Sources\TSCBasic\Process.swift:422:35: error: cannot assign value of type 'Data' to type '[UInt8]'
                        pending = contents
                                  ^~~~~~~~
S:\SourceCache\swift-tools-support-core\Sources\TSCBasic\Process.swift:432:33: error: cannot use optional chaining on non-optional value of type 'Process'
                            self?.state = .outputReady(stdout: .success(stdout), stderr: .success(contents))
                            ~~~~^

S:\SourceCache\swift-tools-support-core\Sources\TSCBasic\Process.swift:432:99: error: cannot convert value of type 'Data' to expected argument type '[UInt8]'
                            self?.state = .outputReady(stdout: .success(stdout), stderr: .success(contents))
                                                                                                  ^
S:\SourceCache\swift-tools-support-core\Sources\TSCBasic\Process.swift:435:35: error: cannot assign value of type 'Data' to type '[UInt8]'
                        pending = contents
                                  ^~~~~~~~
S:\SourceCache\swift-tools-support-core\Sources\TSCBasic\Process.swift:660:16: error: value of type 'UnsafeMutablePointer<FILE>' (aka 'UnsafeMutablePointer<_iobuf>') has no member 'thread'
        stdout.thread?.join()
        ~~~~~~ ^~~~~~
S:\SourceCache\swift-tools-support-core\Sources\TSCBasic\Process.swift:661:16: error: value of type 'UnsafeMutablePointer<FILE>' (aka 'UnsafeMutablePointer<_iobuf>') has no member 'thread'
        stderr.thread?.join()
        ~~~~~~ ^~~~~~
S:\SourceCache\swift-tools-support-core\Sources\TSCBasic\Process.swift:667:28: error: value of type 'UnsafeMutablePointer<FILE>' (aka 'UnsafeMutablePointer<_iobuf>') has no member 'result'
            output: stdout.result,
                    ~~~~~~ ^~~~~~
S:\SourceCache\swift-tools-support-core\Sources\TSCBasic\Process.swift:668:34: error: value of type 'UnsafeMutablePointer<FILE>' (aka 'UnsafeMutablePointer<_iobuf>') has no member 'result'
            stderrOutput: stderr.result
                          ~~~~~~ ^~~~~~
tomerd

comment created time in 3 days

created tagapple/swift-tools-support-core

tagswift-DEVELOPMENT-SNAPSHOT-2021-04-16-a

Contains common infrastructural code for both SwiftPM and llbuild.

created time in 3 days

created tagapple/swift-integration-tests

tagswift-DEVELOPMENT-SNAPSHOT-2021-04-16-a

Automated tests for validating the generated Swift snapshots behave correctly

created time in 3 days

created tagapple/swift-llbuild

tagswift-DEVELOPMENT-SNAPSHOT-2021-04-16-a

A low-level build system, used by Xcode and the Swift Package Manager

created time in 3 days