Skip to content

Conversation

boygao1992
Copy link
Member

What does this pull request do?

Upgrade purescript to 0.14.1 and pin the new spago package set with halogen to v6.1.2.

Fix a bunch of breaking changes from various repos

  • generic-rep is deprecated and mostly moved into prelude with some module name changes
  • globals is deprecated and URI component encode/decode functions are moved to js-uri
  • ordered-collections moved left biased Semigroup and Monoid instances from Data.Map.Map to a new data-type Data.Map.SemigroupMap (Safe.Coerce.coerce could save the wrapping and unwrapping of newtype now so not too inconvenient, but new instances use unionWith append instead of union that require Semigroup instance on value too so it's not a drop-in replacement of the old instances)
  • breaking changes on halogen are summarized well in v6 change log

Where should the reviewer start?

One commit per breaking change.

boygao1992 added 10 commits May 14, 2021 18:45
generic-rep is deprecated and merged into prelude with some module name changes.
`global` repo is deprecated and distributed to `js-uri` and `uri`.
For our usage, `js-uri` is enough.
Following the upgrade guideline in the v6 changelog.
See #subscriptions section for details.
Halogen.HTML.HTML is no longer needed to be specified in Halogen.Component type.
purescript 0.14 adds poly kind that enables unifying all proxy data types by
one generic type Proxy so Halogen starts using that rather than SProxy.
Data.Map.Map no longer has Semigroup and Monoid instances which were considered
biased by many people in the community. So since 2.0.0, the old behavior can be
recovered by using the left biased Data.Map.union or Data.Map.SemigroupMap if
the value has Semigroup instance.

foldMap with Data.Map.singleton pattern no longer works.
The old Halogen.request and Halogen.tell are renamed to Halogen.mkRequest
and Halogen.mkTell.

New Halogen.request and Halogen.tell are specialized Halogen.query that save us
some typing.
Action registry used to accept Nothing but no longer so. This applies to both
Halogen.HTML.Events.* handlers and Halogen.HTML.slot.

Use Halogen.HTML.slot_ if you don't need to register an Action to handle Output
from child component.
@boygao1992 boygao1992 requested review from a team, allgooda and citizengabe and removed request for a team May 15, 2021 03:58
@boygao1992
Copy link
Member Author

Hmm CI is not happy about the new compiler

[ SUCCESS ] Check if a prebuilt 0.14.1 binary is provided for linux (206ms)
[ SUCCESS ] Download the prebuilt PureScript binary (468ms)
[ FAILURE ] Verify the prebuilt binary works correctly
Error: Command failed: /home/circleci/ocelot/node_modules/purescript/purs.bin --version
/home/circleci/ocelot/node_modules/purescript/purs.bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /home/circleci/ocelot/node_modules/purescript/purs.bin)
/home/circleci/ocelot/node_modules/purescript/purs.bin: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by /home/circleci/ocelot/node_modules/purescript/purs.bin)

    at ChildProcess.exithandler (child_process.js:294:12)
    at ChildProcess.emit (events.js:189:13)
    at maybeClose (internal/child_process.js:970:16)
    at Socket.stream.socket.on (internal/child_process.js:389:11)
    at Socket.emit (events.js:189:13)
    at Pipe._handle.close (net.js:597:12)

Looks like something to do with this

From previous experiment, ncurses is available in the CI environment so it's not
the problem. After some researching, I think it's the version of glibc being too
old (2.24 but purescript installer needs 2.27).

I see people upgrade glibc directly in Dockerfile like

ENV GLIBC_VERSION 2.25-r0

but we are using a docker image from CircleCI.

Let me try overwriting it by adding to `environment` variables.
@boygao1992 boygao1992 force-pushed the AS-1317/upgrade-halogen-v6 branch from 276535a to d76b94b Compare May 17, 2021 17:05
@boygao1992
Copy link
Member Author

So ncurses is available in CI environemt.

#!/bin/bash -eo pipefail
sudo apt install libtinfo5 libncurses5-dev

Reading package lists... Done
Building dependency tree       
Reading state information... Done
libncurses5-dev is already the newest version (6.0+20161126-1+deb9u2).
libtinfo5 is already the newest version (6.0+20161126-1+deb9u2).
libtinfo5 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

CircleCI received exit code 0

The real problem should be the version of glibc. The docker image circleci/node:10.15-browsers we use is based on buildpack-deps:stretch (Debian 9) with glibc 2.24 but purescript 0.14.1 needs glibc 2.27.
Going to try the -buster (Debian 10) image according to a similar issue reported on elm-format.

@boygao1992
Copy link
Member Author

Ok now we get the libtinfo issue as documented in the INSTALL.md

/home/circleci/ocelot/node_modules/purescript/purs.bin: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory

Going to add a step to install libtinfo and ncurses again.

@boygao1992
Copy link
Member Author

CI fixed.

Copy link
Member

@davezuch davezuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this! Changes look good to me!

@boygao1992
Copy link
Member Author

Thanks for the review!

@boygao1992 boygao1992 merged commit 93c92e7 into main May 17, 2021
@boygao1992 boygao1992 deleted the AS-1317/upgrade-halogen-v6 branch May 17, 2021 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants