Skip to content

Commit

Permalink
feat: INF-1395: Update common after split (#869)
Browse files Browse the repository at this point in the history
Similarly to dfinity-lab/dfinity#4669, the split simplifies the code. There's also a few new lint warnings from Rust 1.43 that were fixed.
  • Loading branch information
nmattia committed Jul 31, 2020
1 parent 1f2a56a commit 20f051a
Show file tree
Hide file tree
Showing 14 changed files with 12 additions and 19 deletions.
2 changes: 1 addition & 1 deletion distributed-canisters.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ pkgs ? import ./nix {}
}:
let
distributed = lib.noNixFiles (lib.gitOnlySource ./. ./src/distributed);
distributed = lib.noNixFiles (lib.gitOnlySource ./src/distributed);
lib = pkgs.lib;

in
Expand Down
2 changes: 1 addition & 1 deletion e2e/bats/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
, use_ic_ref ? false
}:
let
e2e = lib.noNixFiles (lib.gitOnlySource ../../. ./.);
e2e = lib.noNixFiles (lib.gitOnlySource ./.);
lib = pkgs.lib;
sources = pkgs.sources;

Expand Down
2 changes: 1 addition & 1 deletion e2e/node/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
, dfx ? import ../../dfx.nix { inherit pkgs; }
, agent-js ? import ../../src/agent/javascript { inherit pkgs; }
}:
pkgs.napalm.buildPackage (pkgs.lib.noNixFiles (pkgs.lib.gitOnlySource ../../. ./.)) {
pkgs.napalm.buildPackage (pkgs.lib.noNixFiles (pkgs.lib.gitOnlySource ./.)) {
root = ./.;
name = "node-e2e-tests";
buildInputs = [ dfx.standalone agent-js ];
Expand Down
7 changes: 4 additions & 3 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,17 @@ let
sha256 = "007bgq4zy1mjnnkbmaaxvvn4kgpla9wkm0d3lfrz3y1pa3wp9ha1";
};

pkgs = import commonSrc {
pkgs = import (commonSrc + "/pkgs") {
inherit system;
extraSources = sources;
repoRoot = ../.;
overlays = [
(
self: super:
let
nixFmt = self.lib.nixFmt { root = ../.; };
nixFmt = self.lib.nixFmt {};
in
{
sources = super.sources // sources;

# The RustSec-advisory-db used by cargo-audit.nix.
# Hydra injects the latest RustSec-advisory-db, otherwise we piggy
Expand Down
2 changes: 1 addition & 1 deletion nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"common": {
"ref": "master",
"repo": "ssh://git@github.com/dfinity-lab/common",
"rev": "05c44eddb864464c06c27295460eabcf923bc2e9",
"rev": "ecb33243930b8f7ecc0b819215de8599e7be4edc",
"type": "git"
},
"dfinity": {
Expand Down
2 changes: 1 addition & 1 deletion public/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
let
install =
pkgs.runCommandNoCC "install.sh.template" {
src = pkgs.lib.gitOnlySource ../. ./install;
src = pkgs.lib.gitOnlySource ./install;
preferLocalBuild = true;
allowSubstitutes = false;
nativeBuildInputs = [ pkgs.shfmt pkgs.shellcheck ];
Expand Down
3 changes: 1 addition & 2 deletions src/agent/javascript/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
, system ? builtins.currentSystem
}:
let
repoRoot = ../../..;
src = pkgs.lib.noNixFiles (pkgs.lib.gitOnlySource repoRoot ./.);
src = pkgs.lib.noNixFiles (pkgs.lib.gitOnlySource ./.);
in
pkgs.napalm.buildPackage src {
root = ./.;
Expand Down
1 change: 0 additions & 1 deletion src/agent/rust/src/types/canister_id.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::types::blob::Blob;
use crc8::Crc8;
use hex;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use std::{fmt, str};

Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
, system ? builtins.currentSystem
, agent-js ? import ../agent/javascript { inherit pkgs; }
}:
pkgs.napalm.buildPackage (pkgs.lib.noNixFiles (pkgs.lib.gitOnlySource ../../. ./.)) {
pkgs.napalm.buildPackage (pkgs.lib.noNixFiles (pkgs.lib.gitOnlySource ./.)) {
root = ./.;
name = "bootstrap-js";
buildInputs = [ agent-js ];
Expand Down
1 change: 0 additions & 1 deletion src/dfx/src/commands/language_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use crate::lib::environment::Environment;
use crate::lib::error::{DfxError, DfxResult};
use crate::lib::message::UserMessage;
use crate::lib::package_arguments::{self, PackageArguments};
use atty;
use clap::{App, AppSettings, Arg, ArgMatches, SubCommand};
use std::process::Stdio;

Expand Down
2 changes: 1 addition & 1 deletion src/dfx/src/lib/builders/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ fn delete_output_directory(
let output_assets_path = output_assets_path.canonicalize()?;
if !output_assets_path.starts_with(info.get_workspace_root()) {
return Err(DfxError::DirectoryIsOutsideWorkspaceRoot(
output_assets_path.to_path_buf(),
output_assets_path,
));
}
fs::remove_dir_all(output_assets_path)?;
Expand Down
2 changes: 0 additions & 2 deletions src/dfx/src/lib/canister_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,13 @@ impl CanisterInfo {
.join(PathBuf::from(&self.name))
.join(&self.name)
.with_extension("wasm")
.to_path_buf()
}

pub fn get_build_idl_path(&self) -> PathBuf {
self.build_root
.join(PathBuf::from(&self.name))
.join(&self.name)
.with_extension("did")
.to_path_buf()
}

pub fn get_output_wasm_path(&self) -> Option<PathBuf> {
Expand Down
2 changes: 0 additions & 2 deletions src/dfx/src/lib/logger.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use crate::config::dfx_version_str;
use slog::{Drain, Level, Logger};
use slog_async;
use slog_term;
use std::fs::File;
use std::path::PathBuf;

Expand Down
1 change: 0 additions & 1 deletion src/dfx/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use crate::lib::environment::{Environment, EnvironmentImpl};
use crate::lib::error::*;
use crate::lib::logger::{create_root_logger, LoggingMode};
use clap::{App, AppSettings, Arg, ArgMatches};
use slog;
use std::path::PathBuf;

mod actors;
Expand Down

0 comments on commit 20f051a

Please sign in to comment.