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

lumo: init at 1.8 #38619

Closed
wants to merge 2 commits into from
Closed

lumo: init at 1.8 #38619

wants to merge 2 commits into from

Conversation

andreivolt
Copy link
Contributor

@andreivolt andreivolt commented Apr 8, 2018

@jgertm had a previous attempt at packaging lumo (a ClojureScript runtime) using the release binary and patchElf.

Unfortunately, that approach gives errors, so I went with a local build and it works perfectly, albeit with some hacks...

While the build requirements are pretty heavy (JDK + all project deps), this approach works and has no runtime deps.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

mkdir boot_home m2_home

BOOT_HOME=boot_home BOOT_LOCAL_REPO=m2_home \
boot release
Copy link
Member

@Mic92 Mic92 Apr 8, 2018

Choose a reason for hiding this comment

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

This requires network access which is not allowed in nix's sandbox build:

building '/nix/store/ll0w200d8lm0y0z3rn8hr27kbq43mh8d-lumo-1.8.0.drv'...
unpacking sources
unpacking source archive /nix/store/j5wh7z9jnzjx0dfa8g6ivsbyj6kfs276-source
source root is source
patching sources
configuring
no configure script, doing nothing
building
Downloading https://github.com/boot-clj/boot/releases/download/2.7.2/boot.jar...
Exception in thread "main" java.net.UnknownHostException: github.com
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:589)
        at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:673)
        at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
        at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)
        at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263)
        at java.net.URL.openStream(URL.java:1045)
        at Boot.download(Boot.java:176)
        at Boot.install(Boot.java:227)
        at Boot.main(Boot.java:241)
builder for '/nix/store/ll0w200d8lm0y0z3rn8hr27kbq43mh8d-lumo-1.8.0.drv' failed with exit code 1
error: build of '/nix/store/ll0w200d8lm0y0z3rn8hr27kbq43mh8d-lumo-1.8.0.drv' failed

Maybe it is possible to create a fixed-input derivation, that containts all the source code.
But I am not sure, how this would work for closure script.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

my bad, thanks for the feedback, unfortunately the build process seems quite complicated and there doesn't seem be any npm2nix equivalent for Java/Boot projects...

@hlolli
Copy link
Member

hlolli commented Apr 15, 2018

Glad to see this PR, I was also looking into adding lumo derivation, please note that lumo 1.8.0 was released with node v9.2.0 on npm repositories. Also we can easily use boot jar directoy. I'll see if I can contribute to this PR.

@andreivolt
Copy link
Contributor Author

Thanks @hlolli, I've tried running @jgertm's derivation alongside node 9.2 with the same result (lumo: symbol lookup error: lumo: undefined symbol:).

It seems it would probably be easier to find a fix for this issue instead of building from source, as that would require quite a bit of fiddling with the build script.

Copy link
Member

@lukateras lukateras left a comment

Choose a reason for hiding this comment

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

I've tried to package lumo quite a few times, but it's not really feasible without rewriting its build system.

@hlolli
Copy link
Member

hlolli commented May 22, 2018

How about just doing it the verbose way and use yarn2nix and boot2nix.

@lukateras
Copy link
Member

Might be possible, but requires a very different approach than one used in this PR.

@lukateras
Copy link
Member

There is no small fix that would get this pull request to be accepted, so closing.

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

6 participants