Skip to content

[Chore] Add nix build #661

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

Merged
merged 8 commits into from
Sep 17, 2020
Merged

[Chore] Add nix build #661

merged 8 commits into from
Sep 17, 2020

Conversation

mirkoAlic
Copy link
Contributor

@mirkoAlic mirkoAlic commented Sep 9, 2020

Description

This enables building Mantis in a sandbox.

Proposed Solution

Use Sbtix to generate Nix expressions from
sbt configs. The generated Nix expressions are functionally equivalent to the
(already removed) verify.sbt file and must be updated on the same
occasions that verify.sbt would (i.e., whenever dependencies are updated or changed).

Testing

  • to generate nix expressions:
nix-shell -p nixUnstable
sbtix-gen-all2
  • to build:
nix-build
  • to run:
result/bin/mantis -Dconfig.file=src/main/resources/application.conf

@disassembler disassembler force-pushed the chore/update-sbt-add-nix branch 3 times, most recently from 5070562 to 3ef9ce2 Compare September 9, 2020 13:45
@mirkoAlic mirkoAlic force-pushed the chore/update-sbt-add-nix branch from 3ef9ce2 to d0c9796 Compare September 9, 2020 15:59
@disassembler disassembler force-pushed the chore/update-sbt-add-nix branch 2 times, most recently from 84b22cf to 0ebe794 Compare September 10, 2020 11:27
@@ -0,0 +1,26 @@
# this file must still be generated manually.
Copy link
Contributor Author

@mirkoAlic mirkoAlic Sep 11, 2020

Choose a reason for hiding this comment

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

why we need both: ./manual-repo.nix, project/manual-repo.nix? also.. project/project/manual-repo.nix ???

@@ -0,0 +1,51 @@
# this file originates from SBTix
Copy link
Contributor Author

Choose a reason for hiding this comment

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

can we improve the comment, i mean, this file is originates from SBTix but as far as i know we also added some stuff.

@@ -0,0 +1,1872 @@
# This file was automatically generated by Sbtix. Do not edit manually.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

if this is automatically generated, why we need to push it to the repo?

@@ -1,5 +0,0 @@
#!/bin/bash

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we discovered why this was causing troubles?

@manveru manveru force-pushed the chore/update-sbt-add-nix branch from 1b65c10 to 821e35a Compare September 14, 2020 08:09
Base automatically changed from chore/update-sbt to develop September 14, 2020 12:57
@kaii-zen kaii-zen force-pushed the chore/update-sbt-add-nix branch from 308e09f to 6f353af Compare September 15, 2020 10:37
@kaii-zen
Copy link
Contributor

kaii-zen commented Sep 15, 2020

Added Hydra builds. Can we merge this already so that other PRs get hydra builds as well?

@mirkoAlic
Copy link
Contributor Author

Added Hydra builds. Can we merge this already so that other PRs get hydra builds as well?

In order to get this merge you should:

  1. Solve conflicts in build.sbt (Probably a re-fresh of the repo.nix files is needed).
    ^ I didn't do it, because i'm still struggling nix issues that i don't understand...So is up to you guys.

  2. I asked/raise some concerns in the comments, is not a blocker for get this PR merged, but if you could respond them, it would be nice.

@mirkoAlic mirkoAlic marked this pull request as ready for review September 15, 2020 11:36
mirkoAlic and others added 5 commits September 16, 2020 15:10
- Update Sbt
- Update Scala
- Remove sbt-verify package: In the near future will covered by nix build
@kaii-zen kaii-zen force-pushed the chore/update-sbt-add-nix branch from 6f353af to a597ef0 Compare September 16, 2020 08:41
@@ -1 +1 @@
sbt.version = 1.3.13
sbt.version = 1.2.8
Copy link
Contributor Author

Choose a reason for hiding this comment

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

why? i mean, it was necessary?

Copy link
Contributor

Choose a reason for hiding this comment

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

Me and @sevanspowell were pulling our hair on this all night... briefly, given that:

  • Sbtix doesn't work correctly with SBT 1.3 (it creates a repo.nix that references local path)
  • We don't really know how to fix Sbtix for SBT 1.3
  • We don't know how to estimate how long it would take to figure it out
  • We have some aggressive time constraints
  • SBT 1.3 is at best a nice-to-have (this is an assumption, correct me if I'm wrong)
  • Other urgent tasks are blocked by this not being merged

therefore we made an executive decision to go back to 1.2.8 which was already known to work...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

first of all thanks for the clarification and all the effort you are doing! Yeah, fully agree, it was not a requirement. We can get rid off it, given are current deadlines. (On devops-sync call we also agreed upon that)

@mirkoAlic
Copy link
Contributor Author

This needs a dependencies regeneration again. And i can't do in it (still not working in my machine), so please someone try to.

@kaii-zen
Copy link
Contributor

I regenerated and now it fails to build.

"nix-public" = "";
};
"artifacts" = {
"nix-local-preloaded/file:/Users/kreisys/.sbtix/preloaded/com/eed3si9n/shaded-scalajson_2.12/1.0.0-M4/shaded-scalajson_2.12-1.0.0-M4.jar" = {
Copy link
Contributor Author

@mirkoAlic mirkoAlic Sep 16, 2020

Choose a reason for hiding this comment

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

karma, is that you? :trollface:

@mirkoAlic mirkoAlic merged commit ed10b5d into develop Sep 17, 2020
@mirkoAlic mirkoAlic deleted the chore/update-sbt-add-nix branch September 17, 2020 11:14
@mirkoAlic mirkoAlic changed the title [Chore] Add nix [Chore] Add nix build Sep 17, 2020
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.

5 participants