Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elm 0.19 #45448

Merged
merged 6 commits into from Aug 26, 2018
Merged

Elm 0.19 #45448

merged 6 commits into from Aug 26, 2018

Conversation

domenkozar
Copy link
Member

@domenkozar domenkozar commented Aug 21, 2018

WIP, it's now stuck trying to download elm packages for reactor.

I won't have time to work on this, hopefully someone can pick it up before 18.09 forks off.

Fixes #15800

$ du -shc $(nix-store -qR /nix/store/hfbq8s60pjgc1j4dklxqsn7g20kmd31g-elm-0.19.0)


26M     /nix/store/rvmrk2ziwvz1rawkx4czriq6v8v1m8g4-glibc-2.27
5.6M    /nix/store/34dzxck5qjs8myz470lc4kxc2243wdr2-gcc-7.3.0-lib
696K    /nix/store/0ivn5z9i5vld64m0rh26v5iarjrad9i5-gmp-6.1.2
132K    /nix/store/bv8rivxx5i5rkwwncn7hnnih2wq9cy13-zlib-1.2.11
3.6M    /nix/store/hc0gl6iihj866n40xnpm8f1iqimdm5sx-openssl-1.0.2o
12M     /nix/store/vg9gmfgk7k9snjrkms00dbnn2ssijxd1-ncurses-6.1
14M     /nix/store/hfbq8s60pjgc1j4dklxqsn7g20kmd31g-elm-0.19.0
62M     total

@domenkozar
Copy link
Member Author

@GrahamcOfBorg build elmPackages.elm

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: elmPackages.elm

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: elmPackages.elm

Partial log (click to expand)

Warning: The directory
/nix/store/mxf0w34cilwvmfgjkpd4mcip8r7mrqqz-elm-0.19.0/bin is not in the
system search path.
post-installation fixup
/nix/store/5im29qx9rni3w8l3j8i2yr22sin55kxv-cctools-binutils-darwin/bin/strip is /nix/store/5im29qx9rni3w8l3j8i2yr22sin55kxv-cctools-binutils-darwin/bin/strip
stripping (with command /nix/store/5im29qx9rni3w8l3j8i2yr22sin55kxv-cctools-binutils-darwin/bin/strip and flags -S) in /nix/store/mxf0w34cilwvmfgjkpd4mcip8r7mrqqz-elm-0.19.0/lib  /nix/store/mxf0w34cilwvmfgjkpd4mcip8r7mrqqz-elm-0.19.0/bin
patching script interpreter paths in /nix/store/mxf0w34cilwvmfgjkpd4mcip8r7mrqqz-elm-0.19.0
/nix/store/5im29qx9rni3w8l3j8i2yr22sin55kxv-cctools-binutils-darwin/bin/strip is /nix/store/5im29qx9rni3w8l3j8i2yr22sin55kxv-cctools-binutils-darwin/bin/strip
patching script interpreter paths in /nix/store/v8k3qy98jcfmpwgwd8p9cawyg4wkdacf-elm-0.19.0-doc
/nix/store/mxf0w34cilwvmfgjkpd4mcip8r7mrqqz-elm-0.19.0

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Attempted: elmPackages.elm

Partial log (click to expand)

    • In the untyped splice: $(bsToExp =<< runIO Build.compile)
   |
92 |   $(bsToExp =<< runIO Build.compile)
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[162 of 167] Compiling Bump             ( ui/terminal/src/Bump.hs, dist/build/elm/elm-tmp/Bump.o )
[163 of 167] Compiling Develop.Generate.Index ( ui/terminal/src/Develop/Generate/Index.hs, dist/build/elm/elm-tmp/Develop/Generate/Index.o )
[165 of 167] Compiling Elm.Install      ( builder/src/Elm/Install.hs, dist/build/elm/elm-tmp/Elm/Install.o )
[166 of 167] Compiling Install          ( ui/terminal/src/Install.hs, dist/build/elm/elm-tmp/Install.o )
builder for '/nix/store/qfg1hml681nziw7i3wlz6q8yzh6gnxh5-elm-0.19.0.drv' failed with exit code 1
error: build of '/nix/store/qfg1hml681nziw7i3wlz6q8yzh6gnxh5-elm-0.19.0.drv' failed

@jerith666
Copy link
Contributor

I tried some things in jerith666@815b837 to avoid the http request to https://package.elm-lang.org/all-packages, but it's still happening. Maybe my flailing will inspire someone else ... ?

@jerith666
Copy link
Contributor

Poking around some more in the source code, I think what we're missing is a versions.dat file in the root of the .elm directory. This is a serialized PackageRegistry object, see https://github.com/elm/compiler/blob/master/builder/src/Deps/Cache.hs. But it seems the code might be robust to failures updating that cache, it just needs to have some data in there. So maybe we can just drop a "seed" data into nixpkgs for bootstrapping?

jerith666 added a commit to jerith666/nixpkgs that referenced this pull request Aug 24, 2018
update makeElmStuff to makeDotElm, create elm-elm.nix listing the elm
code that elm itself embeds, and pre-fetch it so that the elm build
can function offline.  also include a versions.dat file, as created
during an impure build of elm.  set ELM_HOME so that the elm build can
find these things.

continues NixOS#45448
@jerith666
Copy link
Contributor

Yes, that was the key! jerith666@e7d0df8 builds!

I haven't looked at elm-format or elm-interface-to-json, and the update instructions need to be updated. I also don't have any 0.19-compatible elm code to really test it on, but elm repl at least works. :)

@domenkozar
Copy link
Member Author

@GrahamcOfBorg build elmPackages.elm

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: elmPackages.elm

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Attempted: elmPackages.elm

Partial log (click to expand)

    • In the untyped splice: $(bsToExp =<< runIO Build.compile)
   |
92 |   $(bsToExp =<< runIO Build.compile)
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[162 of 167] Compiling Bump             ( ui/terminal/src/Bump.hs, dist/build/elm/elm-tmp/Bump.o )
[163 of 167] Compiling Develop.Generate.Index ( ui/terminal/src/Develop/Generate/Index.hs, dist/build/elm/elm-tmp/Develop/Generate/Index.o )
[165 of 167] Compiling Elm.Install      ( builder/src/Elm/Install.hs, dist/build/elm/elm-tmp/Elm/Install.o )
[166 of 167] Compiling Install          ( ui/terminal/src/Install.hs, dist/build/elm/elm-tmp/Install.o )
builder for '/nix/store/82w9fg2586p891navkikzniwd9hmlky4-elm-0.19.0.drv' failed with exit code 1
error: build of '/nix/store/82w9fg2586p891navkikzniwd9hmlky4-elm-0.19.0.drv' failed

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: elmPackages.elm

Partial log (click to expand)

Warning: The directory
/nix/store/s6hh6j4pg6mdbvbvi0b0q01hqxkzfwcw-elm-0.19.0/bin is not in the
system search path.
post-installation fixup
strip is /nix/store/vvbmqsh5ikrxkiwj71dwfbzcwf4bfav8-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/s6hh6j4pg6mdbvbvi0b0q01hqxkzfwcw-elm-0.19.0/lib  /nix/store/s6hh6j4pg6mdbvbvi0b0q01hqxkzfwcw-elm-0.19.0/bin
patching script interpreter paths in /nix/store/s6hh6j4pg6mdbvbvi0b0q01hqxkzfwcw-elm-0.19.0
strip is /nix/store/vvbmqsh5ikrxkiwj71dwfbzcwf4bfav8-cctools-binutils-darwin/bin/strip
patching script interpreter paths in /nix/store/pymcfdb0rackcjm0m6a1p33nhxrdj2ab-elm-0.19.0-doc
/nix/store/s6hh6j4pg6mdbvbvi0b0q01hqxkzfwcw-elm-0.19.0

@domenkozar
Copy link
Member Author

elm-interface-to-json is not released yet, so only elm-format missing.

@arianvp
Copy link
Member

arianvp commented Aug 24, 2018

Elm-interface-json seems a bit unmaintaned. I suggest just removing it untill they update to elm 0.19.

I tried getting a new elm-format ready with cabal2nix but I was running into dependency he'll because elm-format depends on a too old version of the indent package in its cabal and stack file Perhaps we could use stack2nix to create a build plan for elm-format?

@jerith666
Copy link
Contributor

Maybe the borg build failure is because you haven't fast-forwarded your elm-0.19-wip branch to the tip of mine, @domenkozar? Though that doesn't explain how the darwin build could've succeeded ... ?

@jerith666
Copy link
Contributor

I had to do some special handling for indents in #38023 ... could that be relevant? (It was just for ghc 8.0, maybe we also need it for 8.2?) I don't know enough about nix haskell infrastructure, I could be totally off base ...

@domenkozar
Copy link
Member Author

I'd prefer if we fix it upstream, unless it's a major change.

update makeElmStuff to makeDotElm, create elm-elm.nix listing the elm
code that elm itself embeds, and pre-fetch it so that the elm build
can function offline.  also include a versions.dat file, as created
during an impure build of elm.  set ELM_HOME so that the elm build can
find these things.

continues NixOS#45448

(cherry picked from commit e7d0df8)
Signed-off-by: Domen Kožar <domen@dev.si>
@domenkozar
Copy link
Member Author

OK the upstream is hard to fix, working on a workaround.

@arianvp
Copy link
Member

arianvp commented Aug 25, 2018

I've already got a fix! I partially reverted one of your commits (arianvp@37d4066)

I also updated the elm-format package and removed the elm-interface-to-json package

https://github.com/arianvp/nixpkgs/tree/elm-0.19-wip

arianvp@14f0861

@arianvp
Copy link
Member

arianvp commented Aug 25, 2018

Could you update this branch to point to my latest version of it? Then we can let ofborg do its thing and merge.

@domenkozar
Copy link
Member Author

Before we merge, we need reproducable updates, right now versions.dat is commited verbatim without instructions how to generate it. Same for packages/elm-elm.nix. @jerith666 Can you help us here how you got those two files?

@domenkozar
Copy link
Member Author

@GrahamcOfBorg build elmPackages

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: elmPackages

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@domenkozar
Copy link
Member Author

Once we add instructions for versions.dat and packages/elm-elm.nix this is good to go!

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: elmPackages

Partial log (click to expand)

/nix/store/7jk8jpwq30idagb6an08wl1pp0ywspy1-elm-0.19.0/bin is not in the
system search path.
post-installation fixup
strip is /nix/store/vvbmqsh5ikrxkiwj71dwfbzcwf4bfav8-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/7jk8jpwq30idagb6an08wl1pp0ywspy1-elm-0.19.0/lib  /nix/store/7jk8jpwq30idagb6an08wl1pp0ywspy1-elm-0.19.0/bin
patching script interpreter paths in /nix/store/7jk8jpwq30idagb6an08wl1pp0ywspy1-elm-0.19.0
strip is /nix/store/vvbmqsh5ikrxkiwj71dwfbzcwf4bfav8-cctools-binutils-darwin/bin/strip
patching script interpreter paths in /nix/store/jzlh6cwkhxckkqw2f5whaqvvdc5a2nfa-elm-0.19.0-doc
/nix/store/7jk8jpwq30idagb6an08wl1pp0ywspy1-elm-0.19.0
/nix/store/cnngd97hdn8mqlv56rvhcgjarv28svkr-elm-format-0.8.0

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: elmPackages

Partial log (click to expand)

strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/y41846kz1286wgy0mf15dgzb47lll4n2-elm-0.19.0/bin
patching script interpreter paths in /nix/store/y41846kz1286wgy0mf15dgzb47lll4n2-elm-0.19.0
checking for references to /build in /nix/store/y41846kz1286wgy0mf15dgzb47lll4n2-elm-0.19.0...
shrinking RPATHs of ELF executables and libraries in /nix/store/09fahwlfq4zijyavk7bvjlkf08xh6agq-elm-0.19.0-doc
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/09fahwlfq4zijyavk7bvjlkf08xh6agq-elm-0.19.0-doc
checking for references to /build in /nix/store/09fahwlfq4zijyavk7bvjlkf08xh6agq-elm-0.19.0-doc...
/nix/store/y41846kz1286wgy0mf15dgzb47lll4n2-elm-0.19.0
/nix/store/rf7jqpp5nx3lwlwdvb0xr3g5dhfrq32r-elm-format-0.8.0

@domenkozar domenkozar changed the title WIP Elm 0.19 Elm 0.19 Aug 25, 2018
@jerith666
Copy link
Contributor

instructions for versions.dat and elm-elm.nix are in fcabcb2.

(cherry picked from commit fcabcb2)
Signed-off-by: Domen Kožar <domen@dev.si>
@domenkozar
Copy link
Member Author

You rock :)

@domenkozar domenkozar merged commit aa8bdaf into NixOS:master Aug 26, 2018
domenkozar pushed a commit that referenced this pull request Aug 26, 2018
update makeElmStuff to makeDotElm, create elm-elm.nix listing the elm
code that elm itself embeds, and pre-fetch it so that the elm build
can function offline.  also include a versions.dat file, as created
during an impure build of elm.  set ELM_HOME so that the elm build can
find these things.

continues #45448

(cherry picked from commit e7d0df8)
Signed-off-by: Domen Kožar <domen@dev.si>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants