Git Product home page Git Product logo

utf8string's Introduction

UTF8String

Just some shims, hacks, etc., so that portions of the standard library can be built via an SPM package.

Set up

1. Install a recent trunk development toolchain (master)

This package was developed using the Xcode-10 beta. It uses shims and other functionality that's recently been committed to master but is not on a release branch yet, so download a recent toolchain:

Download and install a toolchain from swift.org. Choose "Trunk Development (master)".

2. Clone the repos

This package assumes you have a swift checkout with utf-8 string support in a neighboring folder utf8-swift, and are using the milseman/utf8string branch. To set that up from a top-level directory:

  git clone [email protected]:milseman/UTF8String.git
  mkdir utf8-swift
  cd utf8-swift
  git clone --single-branch -b utf8string [email protected]:milseman/swift.git
  cd ../UTF8String
  open UTF8String.xcodeproj

Using as a Full-Fledged Standard Library

All code can be built 2-ways, through this package or as part of a real standard library build. For the latter, build the branch with compatible LLVM and Clang hashes.

That branch is tied to late-July 2018 hashes from when it branched off. To automatically set all the branches to the correct state run this command (note that "swift" will be checked out to whatever is at the top of milseman/utf8string):

cd UTF8String && utils/update-checkout-to-utf8string-shas

Commentary

This general technique should apply to anyone wanting to work on portions of the stdlib as though it were a standalone SPM package. It does have some tradeoffs though:

Downsides

  • Anything present is shadowed
    • Literals will get their default type from the toolchain and not the shadow.
  • Limited by access control when using anything not shadowed

Upsides

  • Toolchain definitions still available
    • Test that compare behavior differences between shadowed functionality and the toolchain's

Building as a Standard Library

The checkout can be built as a 64-bit standard library normally. We recommend one of the following invocations:

  • Debugging: build-script -r --debug-swift-stdlib
    • Swift compiler is built with optimizations and assertions, but stdlib is full-debug
  • Testing: build-script -r
    • Swift compiler and stdlib is built with both optimizations and assertions
  • Benchmarking: build-script -R --no-assertions
    • Full optimizations, no debug info, no assertions

Building as a Toolchain

This is currently unsupported as we don't build on 32-bit platforms yet. Once we do, we will likely not have complete correctness of 32-bit until 64-bit is tackled.

utf8string's People

Contributors

milseman avatar weissi avatar

Watchers

 avatar  avatar

Forkers

weissi

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.