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

sbt: Fix check #114474

Merged
merged 1 commit into from Mar 3, 2021
Merged

sbt: Fix check #114474

merged 1 commit into from Mar 3, 2021

Conversation

NeQuissimus
Copy link
Member

@NeQuissimus NeQuissimus commented Feb 26, 2021

Motivation for this change

Closes #114462

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@NeQuissimus
Copy link
Member Author

@GrafBlutwurst Can you check whether this addresses your issue?

@r-rmcgibbo
Copy link

r-rmcgibbo commented Feb 26, 2021

Result of nixpkgs-review pr 114474 at 8cda3fef run on x86_64-linux 1

2 packages failed to build:
2 suggestions:
  • warning: missing-phase-hooks

    installPhase should probably contain runHook preInstall and runHook postInstall.

    Near pkgs/development/tools/build-managers/sbt/default.nix:28:3:

       |
    28 |   installPhase = ''
       |   ^
    
  • warning: patch-phase

    patchPhase should not be overridden, use postPatch instead.

    Near pkgs/development/tools/build-managers/sbt/default.nix:20:3:

       |
    20 |   patchPhase = ''
       |   ^
    

Result of nixpkgs-review pr 114474 at 8cda3fef run on aarch64-linux 1

2 packages failed to build:
2 suggestions:
  • warning: missing-phase-hooks

    installPhase should probably contain runHook preInstall and runHook postInstall.

    Near pkgs/development/tools/build-managers/sbt/default.nix:28:3:

       |
    28 |   installPhase = ''
       |   ^
    
  • warning: patch-phase

    patchPhase should not be overridden, use postPatch instead.

    Near pkgs/development/tools/build-managers/sbt/default.nix:20:3:

       |
    20 |   patchPhase = ''
       |   ^
    

@GrafBlutwurst
Copy link
Contributor

It doesn't seem so. At least with the shell.nix definition as defined in the bug report it doesn't build at all anymore, independent of if I override the jre or not.

Is there a way to get a better error message so i can provide more information?

@NeQuissimus
Copy link
Member Author

@GrafBlutwurst Does the actual sbt build fail or the OpenJDK one? The errors posted by @r-rmcgibbo above look like JDK15 is broken.

@GrafBlutwurst
Copy link
Contributor

these derivations will be built:
  /nix/store/d0dcnycw0q2014hlwygwhkwbknc4bl4j-sbt-1.4.7.drv
building '/nix/store/d0dcnycw0q2014hlwygwhkwbknc4bl4j-sbt-1.4.7.drv'...
unpacking sources
unpacking source archive /nix/store/1g5qdvbg7wycy418vxa661jnqijqqg66-sbt-1.4.7.tgz
source root is sbt
setting SOURCE_DATE_EPOCH to timestamp 1612072156 of file sbt/conf/sbtopts
patching sources
configuring
no configure script, doing nothing
building
no Makefile, doing nothing
installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/mzvkfgsi8kmmlp12mx70jffqha3bx6aj-sbt-1.4.7
shrinking /nix/store/mzvkfgsi8kmmlp12mx70jffqha3bx6aj-sbt-1.4.7/share/sbt/bin/sbtn-x86_64-pc-linux
strip is /nix/store/9f8y44vmjnwdjvzlff0gm3f3g6ycyyqy-binutils-2.35.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/mzvkfgsi8kmmlp12mx70jffqha3bx6aj-sbt-1.4.7/bin
patching script interpreter paths in /nix/store/mzvkfgsi8kmmlp12mx70jffqha3bx6aj-sbt-1.4.7
/nix/store/mzvkfgsi8kmmlp12mx70jffqha3bx6aj-sbt-1.4.7/share/sbt/bin/sbt: interpreter directive changed from "#!/usr/bin/env bash" to "/nix/store/yyy7wr7r9jwjjqkr1yn643g3wzv010zd-bash-4.4-p23/bin/bash"
checking for references to /tmp/nix-build-sbt-1.4.7.drv-0/ in /nix/store/mzvkfgsi8kmmlp12mx70jffqha3bx6aj-sbt-1.4.7...
automatically fixing dependencies for ELF files
searching for dependencies of /nix/store/mzvkfgsi8kmmlp12mx70jffqha3bx6aj-sbt-1.4.7/share/sbt/bin/sbtn-x86_64-pc-linux
  libz.so.1 -> found: /nix/store/7bgshg2z70fpcc7adxfag1lgf45yamxh-zlib-1.2.11/lib/libz.so.1
setting RPATH to: /nix/store/7bgshg2z70fpcc7adxfag1lgf45yamxh-zlib-1.2.11/lib
running install tests
builder for '/nix/store/d0dcnycw0q2014hlwygwhkwbknc4bl4j-sbt-1.4.7.drv' failed with exit code 1
error: build of '/nix/store/d0dcnycw0q2014hlwygwhkwbknc4bl4j-sbt-1.4.7.drv' failed

This is the full output i get. I also checked with --debug but couldn't find an obvious error. I also tried overriding java with both 8 and 11 versions but to no avail

@NeQuissimus
Copy link
Member Author

OK, I think I have it reproduced. Let me check a few things and see what is going on.

@NeQuissimus NeQuissimus force-pushed the sbt_jdk11 branch 2 times, most recently from 9c0e4ce to 0f4d313 Compare February 26, 2021 18:01
@NeQuissimus
Copy link
Member Author

@GrafBlutwurst I can now build with jre = jdk15, jre = jdk8, jre = jdk11 and without redefining jre

@NeQuissimus NeQuissimus changed the title sbt: Add timeout to checks sbt: Fix check Feb 26, 2021
@SuperSandro2000
Copy link
Member

@GrafBlutwurst Does the actual sbt build fail or the OpenJDK one? The errors posted by @r-rmcgibbo above look like JDK15 is broken.

openjdk15 is broken for me.

@NeQuissimus
Copy link
Member Author

@ofborg eval

@GrafBlutwurst
Copy link
Contributor

@NeQuissimus how are you building it? I just stuck the file as of commit 0f4d313 into a simple shell

{ pkgs ? import <nixpkgs> {} }:

let 
sbt = pkgs.callPackage ./sbt.nix { };
in
pkgs.mkShell {
  buildInputs = [
    sbt
  ];
}

but it still refuses to build.

@NeQuissimus
Copy link
Member Author

Let's take the test out :) It works for me but only sometimes, seems way too flaky.

The check is very fragile.
We cannot replace it with different logic as that would require
network access.
`
@GrafBlutwurst
Copy link
Contributor

It works just fine now locally! It builds successfully with overriding the JRE or without.

@SuperSandro2000 SuperSandro2000 merged commit e061350 into NixOS:master Mar 3, 2021
@NeQuissimus NeQuissimus deleted the sbt_jdk11 branch March 3, 2021 13:38
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.

SBT refuses to build if JRE is overwritten
4 participants