Giter VIP home page Giter VIP logo

swift-tools-support-core's People

Contributors

3405691582 avatar abertelrud avatar adam-le-dev avatar ankitspd avatar benlangmuir avatar codafi avatar colemancda avatar compnerd avatar dmbryson avatar douggregor avatar egorzhdan avatar finagolfin avatar hartbit avatar jakepetroules avatar kateinoigakukun avatar keith avatar maxdesiatov avatar neonichu avatar nkcsgexi avatar owenv avatar sergiocampama avatar shahmishal avatar sstadelman avatar tgymnich avatar tkremenek avatar tomerd avatar troughton avatar virtan avatar vlm avatar wowbaggersliquidlunch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swift-tools-support-core's Issues

Canonicalization of `RelativePath`s should be delayed until they are used by `AbsolutePath`s

RelativePath today does simple syntactic normalization on non-Windows platforms, eliding path components that are empty or consist of just ., and using .. components to remove parent components, etc. On Windows, RelativePath today instead calls PathCanonicalizeW().

But in general it isn't possible to canonicalize relative paths โ€” the canonicalization needs to be applied to a resulting AbsolutePath, so that the place where an absolute and relative path are joined is canonicalized properly.

So we should change the logic to:

  • have RelativePath not try to canonicalize relative paths in isolation
  • instead have AbsoluePath canonicalize the resulting absolute path once it has been formed from the absolute and relative components

Does not compile with Swift 5.7

Hello,

I am trying to compile TSCUtility with swift 5.7 and I receive the following error message.

/Users/ec2-user/project_name/.build/checkouts/swift-tools-support-core/Sources/TSCUtility/FSWatch.swift:848:15: error: cannot assign value of type 'Thread' to type 'Thread?'
                self.thread = thread

self.thread is of type Thread? and thread is of type Thread

I don't think this is a change in Swift 5.7 as I tested the behaviour with the following sample code

@main
public struct test {
    var a : Int?

    public init() {
       let b : Int = 1
       self.a = b
       print(a!)
    }

   public static func main() {
      let _ = test();
   }   
}
ec2-user@ip-172-31-67-99 test % swift --version 
swift-driver version: 1.62.3 Apple Swift version 5.7 (swiftlang-5.7.0.123.8 clang-1400.0.29.50)
Target: arm64-apple-macosx12.0

Cannot assign value of type 'Thread' to type 'Thread?'

After update to Xcode 14.1 (from 14.0.1) it's unable to build FSEventStream because of type incompatible object assignment

https://github.com/apple/swift-tools-support-core/blob/main/Sources/TSCUtility/FSWatch.swift#L848

It seems that here https://github.com/apple/swift-tools-support-core/blob/main/Sources/TSCUtility/FSWatch.swift#L826 you are creating object using incorrect Thread type. It takes it from Foundation instead of TSCBasic.

I guess instead of creating thread this way Thread { ... } it's needed to create it next way TSCBasic.Thread { ... }

case sensitivity of `Path` environment variable on windows

Trying to run swift from emacs on windows (niche use case, I know) I was running into an error about swift not being able to find "swift-test.exe". Checking environment variables, I think I've tracked this down to a combination of emacs using unconventional capitalization, and a case sensitivity inside of SPM.

When run from cmd.exe, the environment variable is Path=C:\..., but from emacs it's PATH=C:\...

From

public static var path: String? {
#if os(Windows)
let pathArg = "Path"
#else
let pathArg = "PATH"
#endif
return vars[pathArg]
}

it looks like swift is looking for the "Path" one and not doing the typical-on-windows case insensitive lookup.

This brings me finally to a question: Is this a swift bug and/or an emacs bug? As far as I understand, while "Path" is the official casing, environment variables are expected to be treated insensitively on windows (which works a bit unfortunately with swift's representation as [String: String])

I can create a PR to fix this, and I may file a bug against emacs as well, but I wanted to check first, since my windows experience is pretty limited.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.