Updating the Ecosystem for upcoming 0.14.0 release

Due to Nate’s PolyKinds PR, a number of libraries will not compile in the upcoming 0.14.0 PureScript release. However, I helped Nate by updating each library that exists in the psc-0.13.6-20200127 package set, so that it would compile using his PR.

If you maintain or use one of the below libraries and want to help update the ecosystem in preparation for the upcoming 0.14.0 release, please follow the below instructions. I’m guessing it’ll still be a while until 0.14.0 gets released, but this will make the ecosystem breakage shorter.

Note: If you are the maintainer of one of these libraries and you get a PR to your master branch, please create a new branch (e.g. ps-0.14), retarget the PR to that branch, and merge it. You can then merge your new branch into your master branch once the next PS release is made.

Libraries Affected

Note: some of the below libraries compiled fine using Nate’s PR. However, I also removed deprecated syntax, so that we don’t get unneeded compiler warnings.

  • aff-bus (PR Submitted)
  • argonaut-codecs (PR Submitted)
  • arraybuffer-types (PR Submitted)
  • arraybuffer (PR Submitted)
  • arrays (PR Submitted)
  • bucketchain-simple-api (PR Submitted)
  • chirashi (can be dropped and added later)
  • choco-pie (can be dropped and added later)
  • foreign-object (PR Submitted)
  • halogen (PR Submitted)
  • halogen-formless (PR Submitted)
  • heterogeneous (PR Submitted)
  • identy (PR Submitted)
  • indexed-monad (PR Submitted)
  • jajanmen (can be dropped and added later)
  • json-schema (PR Submitted)
  • kancho (can be dropped and added later)
  • kishimen (can be dropped and added later)
  • money (PR Submitted)
  • naporitan (can be dropped and added later)
  • pathy (PR Submitted)
  • polyform (Ignore due to pending breaking changes)
  • proxying (PR Submitted)
  • querydsl (PR Submitted)
  • react-basic-hooks (PR Submitted)
  • react-basic (PR Submitted)
  • react (PR Submitted)
  • record-extra (PR Submitted)
  • record-format (PR Submitted)
  • record (PR Submitted)
  • routing-duplex (PR Submitted)
  • shoronpo (can be dropped and added later)
  • sijidou (can be dropped and added later)
  • simple-i18n (PR Submitted)
  • simple-json (PR Submitted)
  • st (PR Submitted)
  • struct (PR Submitted)
  • tolerant-argonaut (PR Submitted)
  • tortellini (can be dropped and added later)
  • type-isequal (PR Submitted)
  • typedenv (PR Submitted)
  • unordered-collections (PR Submitted)
  • variant (PR Submitted)
  • xiaomian (can be dropped and added later)

Instructions

# Note: if there are any issues with the below commands, 
# let me know so I can update this.

# 1. `git clone` my fork of the PureScript repo

git clone https://github.com/JordanMartinez/purescript.git
# or
git clone git@github.com:JordanMartinez/purescript.git

# 2. Checkout the `allChangesInOneCommit` branch
git checkout allChangesInOneCommit

# 3. Change the directory to your library 
# e.g. `cd test/support/.spago/halogen/`
cd tests/support/.spago/<libraryName>

# 4. Create a git repo in that folder
git init

# 5. Update the git remotes to refer to your repo (example below is Halogen)

git remote add origin https://github.com/slamdata/purescript-halogen.git
# OR
git remote add origin git@github.com:slamdata/purescript-halogen.git

# 6. Create a new branch
git checkout -b polykindsUpdate

# 7. Fetch the commit history from the repo
git fetch origin

# 8. Use a soft reset to put the current branch at the same place
# as the master branch
git reset --soft origin/master

# 8. Unstage all changes
# * = reset normal files 
# '.*' = reset hidden files (e.g. '.gitignore')
git reset HEAD * '.*'

# 9. Add and commit the changes I made
# Note: I only updated files in the `src/` folder. Files in the `test/` or
# `benchmark/` folders will need to be updated by you.
git add src/
git commit -m "Update library to compile on upcoming 0.14.0 PureScript release"

# 10. Push the changes to the repo
git push -u origin polykindsUpdate

# 11. Create a PR on GitHub that proposes merging `polykindsUpdate` into `master`

# 12. Wait until `0.14.0` PureScript release is made and all dependencies
# are updated. Then update your PR with any other changes before merging the PR.

# 13. Make a new release, so that other libraries that depend on yours can get updated quickly
12 Likes

As an affected library author and just someone following along the Polykinds feature addition, just wanted to express a huge thank you for the effort you’ve put in to testing the whole PureScript package set against the feature and for making it easy on authors to update.

7 Likes

I don’t plan to look at 0.14.0 changes soon, but of these libraries, someone can help update these:

  • simple-json
  • record-extra
  • type-isequal

These can be dropped from any package set, and readded later if needed:

  • chirashi
  • choco-pie
  • jajanmen
  • kancho
  • kishimen
  • naporitan
  • shoronpo
  • sijidou
  • tortellini
  • xiaomian

I think this long list of libraries that can be removed is only there because the current package-sets is based on my personal package set from before. This should make it easier to not have to look through as much

I just tried following these instructions and found an issue in Step 6. I’ve updated the script to account for that issue (needed to unstage all files before I could add and commit src/ without bringing in other files in that commit).

I’ve also created and submitted a few PRs for a few of the libraries. I’ve updated the list to indicate which have been done already.

I woke up super early today and couldn’t fall back asleep, so I figured I’d get more PRs submitted.

Since GitHub mentioned their new CLI tool yesterday, gh, I’ve been running gh pr create -w at the end of my workflow to automatically open a PR via my browser. It’s been working pretty well.

When I was submitting PRs for the following libraries, I noticed that other changes were being included. I’m guessing this is due to these libraries making changes in their master branch after the day the package set was last released or something. Once I’ve gone through and updated the other libraries, I can look at these again and see what I need to do to make them compile:

  • halogen
  • halogen-formless
  • json-schema
  • polyform
1 Like

It’s perhaps worth noting that the Coercible change will require changes in some libraries too, specifically any types which need nominal roles for one or more of their parameters. The only specific example I can think of is Map, but there might be others.

Mm… Good point. I had forgotten that the Coercible PR added that as well.

@JordanMartinez thanks a lot for all your work related to this migration. Please don’t bother debugging polyform any more because I’ve pending breaking release of this library and I will use your previous suggestions to fix my master branch.

3 Likes

Thanks for notifying me of that!

And it is my pleasure to serve the community.

2 Likes

I’ve submitted PRs for all packages except for json-schema and the ones that justin mentioned dropping and readding later. I did come across a problem with money, so that package might need to be updated as a whole.

All PRs (other than the ones Justin said could be added later) have been submitted. It looks like we only have the following things to address:

  • improving the 13% performance regression Nate noted
  • making the polykinds PR work with the Coercible PR
  • updating any remaining libraries to use the new syntax from the Coercible PR.
3 Likes

Just FYI. Here’s a package set that is compatible with current master branch of purescript: https://github.com/JordanMartinez/package-sets/tree/ps-master-compatible

3 Likes

I recently compiled the package set in the link above with the current master branch of purescript. It actually didn’t compile and there were a lot of warnings I remember fixing previously.

After investigating more, I realized that the package set didn’t include all the forks I had done when removing compiler warnings like # Type -> Row Type. So, I updated that package set. You can now find the one that works via the fixed-warnings-ps-master-compatible branch: https://github.com/JordanMartinez/package-sets/tree/fix-warnings-ps-master-compatible

Note: the above version of the package set removed the packages Justin Woo said could be dropped. I also removed money because I ran into some problems that slowed me down when I was originally working on this.

If you want to use this package set, here’s what you do:

  1. Update your packages.dhall file to refer to a different upstream value
let upstream =
      https://raw.githubusercontent.com/JordanMartinez/package-sets/fix-warnings-ps-master-compatible/src/packages.dhall

let overrides = {=}

let additions = {=}

in  upstream // overrides // additions
  1. Delete old files
rm -rf .spago/ output/
  1. Reinstall the packages you need, so that they refer to the master-compatible versions
spago install
  1. Use your local copy of the purescript compiler binary to compile the files
# In the `purescript` repo
git clone https://github.com/purescript/purescript.git
cd purescript
stack setup
stack build
cp .stack-work/install/<path to build output>/bin/purs <path to your repo>/purs

# Use your purs copy to compile the files
cd <path to your repo>
./purs compile ".spago/*/*/src/**/*.purs"

If you want to install all packages in the set, here’s what I did

sudo apt-get install xclip -y
spago ls packages > example.txt && cat example.txt | sed -r "s/([a-zA-Z0-9-]+).*/\1/" | tr '\n' ' ' | xclip -selection c
spago install <CTRL+SHIFT+V>

I will wait until after the v0.14 release is ready to be released until working on updating the package set to remove compiler warnings and whatnot. Otherwise, people will change things in master and I will have to merge their work into my fork, which gets difficult after a while.

7 Likes