Skip to content

Commit

Permalink
Upgrade to nixpkgs 19.03
Browse files Browse the repository at this point in the history
  • Loading branch information
cocreature committed May 4, 2019
1 parent f4d8e13 commit f32caa7
Show file tree
Hide file tree
Showing 19 changed files with 39 additions and 314 deletions.
10 changes: 5 additions & 5 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ nixpkgs_local_repository(
name = "nixpkgs",
nix_file = "//nix:nixpkgs.nix",
nix_file_deps = [
"//nix:nixpkgs/nixos-18.09/default.nix",
"//nix:nixpkgs/nixos-18.09/default.src.json",
"//nix:nixpkgs/nixos-19.03/default.nix",
"//nix:nixpkgs/nixos-19.03/default.src.json",
],
)

Expand All @@ -63,8 +63,8 @@ dev_env_nix_repos = {
common_nix_file_deps = [
"//nix:bazel.nix",
"//nix:nixpkgs.nix",
"//nix:nixpkgs/nixos-18.09/default.nix",
"//nix:nixpkgs/nixos-18.09/default.src.json",
"//nix:nixpkgs/nixos-19.03/default.nix",
"//nix:nixpkgs/nixos-19.03/default.src.json",
]

# Use Nix provisioned cc toolchain
Expand Down Expand Up @@ -606,7 +606,7 @@ load("@io_bazel_rules_go//go:deps.bzl", "go_wrap_sdk")
# an upstream one.
go_wrap_sdk(
name = "go_sdk",
root_file = "@go_nix//:share/go/README.md",
root_file = "@go_nix//:share/go/ROOT",
) if not is_windows else None

go_rules_dependencies()
Expand Down
6 changes: 5 additions & 1 deletion ci/dev-env-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ if [[ ! -e /nix ]]; then
sudo chown "$(id -u):$(id -g)" /nix

# 2.2.2 seems to segfault on MacOS in CI so for now we use 2.2.1.
curl -sfL https://nixos.org/releases/nix/nix-2.2.1/install | bash
if [[ $(uname -s) == "Darwin" ]]; then
curl -sfL https://nixos.org/releases/nix/nix-2.2.1/install | bash
else
curl -sfL https://nixos.org/releases/nix/nix-2.2.2/install | bash
fi
fi

# shellcheck source=../dev-env/lib/ensure-nix
Expand Down
18 changes: 0 additions & 18 deletions dev-env/bin/jupyter

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,9 @@ object DamlOnXCommandCompletionService {
def create(indexService: IndexService)(
implicit ec: ExecutionContext,
mat: Materializer,
esf: ExecutionSequencerFactory)
: CommandCompletionServiceValidation with BindableService with CommandCompletionServiceLogging = {
esf: ExecutionSequencerFactory): CommandCompletionServiceValidation
with BindableService
with CommandCompletionServiceLogging = {

val ledgerId = Await.result(indexService.getLedgerId(), 5.seconds)
new CommandCompletionServiceValidation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ object DamlOnXSubmissionService {
ledgerId: LedgerId,
indexService: IndexService,
writeService: WriteService,
engine: Engine)(implicit ec: ExecutionContext, mat: ActorMaterializer)
: CommandSubmissionServiceGrpc.CommandSubmissionService with BindableService with CommandSubmissionServiceLogging =
engine: Engine)(
implicit ec: ExecutionContext,
mat: ActorMaterializer): CommandSubmissionServiceGrpc.CommandSubmissionService
with BindableService
with CommandSubmissionServiceLogging =
new GrpcCommandSubmissionService(
new DamlOnXSubmissionService(indexService, writeService, engine),
ledgerId.underlyingString,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ object DamlOnXTransactionService {
identifierResolver: IdentifierResolver)(
implicit ec: ExecutionContext,
mat: Materializer,
esf: ExecutionSequencerFactory)
: TransactionServiceGrpc.TransactionService with BindableService with TransactionServiceLogging =
esf: ExecutionSequencerFactory): TransactionServiceGrpc.TransactionService
with BindableService
with TransactionServiceLogging =
new GrpcTransactionService(
new DamlOnXTransactionService(indexService),
ledgerId.underlyingString,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,10 @@ object SandboxCommandCompletionService {
def apply(ledgerBackend: LedgerBackend)(
implicit ec: ExecutionContext,
mat: Materializer,
esf: ExecutionSequencerFactory)
: CommandCompletionServiceValidation with BindableService with AutoCloseable with CommandCompletionServiceLogging = {
esf: ExecutionSequencerFactory): CommandCompletionServiceValidation
with BindableService
with AutoCloseable
with CommandCompletionServiceLogging = {
val impl = new SandboxCommandCompletionService(ledgerBackend)
new CommandCompletionServiceValidation(impl, ledgerBackend.ledgerId) with BindableService
with AutoCloseable with CommandCompletionServiceLogging {
Expand Down
8 changes: 7 additions & 1 deletion nix/bazel.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ rec {
docker
gawk
gnutar
go
gzip
hlint
imagemagick
Expand All @@ -23,6 +22,13 @@ rec {
zip
;

# We need to have a file in GOPATH that we can use as
# root_file in go_wrap_sdk.
go = pkgs.go.overrideAttrs (oldAttrs: {
doCheck = false;
postFixup = ''touch $out/share/go/ROOT'';
});

# the GHC version we use plus custom overrides to sync with the
# stackage version as specified in stack.yaml. Prefer to use this for
# haskell binaries to keep the dev-env closure size as small
Expand Down
44 changes: 1 addition & 43 deletions nix/nixpkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

let
# See ./nixpkgs/README.md for upgrade instructions.
src = import ./nixpkgs/nixos-18.09;
src = import ./nixpkgs/nixos-19.03;

# package overrides
overrides = _: pkgs: rec {
Expand Down Expand Up @@ -43,48 +43,6 @@ let
wrapProgram $out/bin/pg_tmp --prefix PATH : ${pkgs.postgresql}/bin:$out/bin
'';
});
buildBazelPackage = pkgs.callPackage ./overrides/buildBazelPackage {
stdenv =
let
# XXX On Darwin, workaround
# https://github.com/NixOS/nixpkgs/issues/42059. See also
# https://github.com/NixOS/nixpkgs/pull/41589.
cc =
with pkgs;
with darwin.apple_sdk.frameworks;
runCommand "cc-wrapper-bazel" {
buildInputs = [ stdenv.cc makeWrapper ];
}
''
mkdir -p $out/bin
# Copy the content of stdenv.cc
for i in ${stdenv.cc}/bin/*
do
ln -sf $i $out/bin
done
# Override clang
rm $out/bin/clang
makeWrapper ${stdenv.cc}/bin/clang $out/bin/clang \
--add-flags "-isystem ${libcxx}/include/c++/v1 \
-F${CoreFoundation}/Library/Frameworks \
-F${CoreServices}/Library/Frameworks \
-F${Security}/Library/Frameworks \
-F${Foundation}/Library/Frameworks \
-L${libcxx}/lib \
-L${darwin.libobjc}/lib"
'';
in
if pkgs.stdenv.isDarwin then
pkgs.overrideCC pkgs.stdenv cc
else
pkgs.stdenv
;
bazel = bazel;
enableNixHacks = false;
};
haskellPackages = pkgs.haskellPackages.override {
overrides = self: super: {
hlint = super.callPackage ./overrides/hlint-2.1.15.nix {};
Expand Down
4 changes: 2 additions & 2 deletions nix/nixpkgs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This folder contains the upstream Nix channels that are used for the dev-env.

## Channels

- `nixos-18.03`
- `nixos-19.03`

## Updating

Expand All @@ -17,6 +17,6 @@ $ nix-update-src-json [CHANNEL]
Eg:

```
nix-update-src-json ./nixos-18.03
nix-update-src-json ./nixos-19.03
```

8 changes: 0 additions & 8 deletions nix/nixpkgs/nixos-18.09/default.nix

This file was deleted.

7 changes: 0 additions & 7 deletions nix/nixpkgs/nixos-18.09/default.src.json

This file was deleted.

4 changes: 2 additions & 2 deletions nix/nixpkgs/nixos-19.03/default.src.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"owner": "NixOS",
"repo": "nixpkgs-channels",
"branch": "nixos-19.03",
"rev": "5c52b25283a6cccca443ffb7a358de6fe14b4a81",
"sha256": "0fhbl6bgabhi1sw1lrs64i0hibmmppy1bh256lq8hxy3a2p1haip"
"rev": "915ce0f1e1a75adec7079ddb6cd3ffba5036b3fc",
"sha256": "1kmx29i3xy4701z4lgmv5xxslb1djahrjxmrf83ig1whb4vgk4wm"
}
107 changes: 0 additions & 107 deletions nix/overrides/buildBazelPackage/default.nix

This file was deleted.

12 changes: 1 addition & 11 deletions nix/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -138,23 +138,14 @@ in rec {
python3 = python36;
python36 = pkgs.python36Packages.python;

ipython = pkgs.python36Packages.ipython;
notebook = pkgs.python36Packages.notebook;
numpy = pkgs.python36Packages.numpy;
scipy = pkgs.python36Packages.scipy;
matplotlib = pkgs.python36Packages.matplotlib;
pandas = pkgs.python36Packages.pandas;
cram = pkgs.callPackage ./python-modules/cram {};
flake8 = pkgs.python36Packages.flake8;
yapf = pkgs.python36Packages.yapf;

# Pex packaging has been submitted upsteam as
# https://github.com/NixOS/nixpkgs/pull/45497.
# However, this one is for a newer version
pex = pkgs.callPackage ./tools/pex {};
# Pipenv packaging is taken from upstream commit:
# https://github.com/NixOS/nixpkgs/commit/40887a6dc635.
pipenv = pkgs.callPackage ./tools/pipenv {};
pipenv = pkgs.pipenv;

# Databases
cassandra = pkgs.cassandra;
Expand Down Expand Up @@ -287,7 +278,6 @@ in rec {
cacert = pkgs.cacert;
cheat = pkgs.cheat;
coreutils = pkgs.coreutils;
docker-compose = pkgs.python36Packages.docker_compose;
dockerd = pkgs.docker;
findutils = pkgs.findutils;
ftop = pkgs.ftop;
Expand Down
2 changes: 1 addition & 1 deletion nix/tools/bazel-deps/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ buildBazelPackage rec {
find . -type d -empty -delete
'';

sha256 = "0xnwg847zkxf6vfmhsi1g16a4q78rgaa87prwcqhxl9psyl9r30c";
sha256 = "0m36zfrbwxzjm5vpvrjgs3vmgk90x010wiki5aspjxs0n8l9dxvh";
};

buildAttrs = {
Expand Down
Loading

0 comments on commit f32caa7

Please sign in to comment.