Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ef33b9fc089a
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4dc8447c55fe
Choose a head ref

Commits on Mar 28, 2020

  1. buildRustCrate: remap the current build dir to / for (more) reproduci…

    …ble builds
    
    (cherry picked from commit 56e11bc)
    andir committed Mar 28, 2020

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    andir Andreas Rammhold
    Copy the full SHA
    1febd68 View commit details
  2. buildRustCrate: remove superfluous dependency overrides

    By overriding each dependency on every level of the dependency tree we
    are creating a lot of unnecessary instances of the same derivation
    
    Looking at the output size of `nix-instantiate --trace-function-calls
    -vvvv …` and the execution time I got about a 10x improvement after
    applying this change.
    
    It was probably good intentions that lead to these overrides but in
    practice no tooling (that I know of) really needs this. `carnix` and
    `crate2nix` are fine without those overrides. Furthermore I believe that
    it is the job of the tooling around `buildRustCrate` to provide a
    coherent set of overrides. By not enforcing all of the overrides, debug
    flags, verbosity, … to be the same throughout the closure we also allow
    consumers to override specific aspects of the crates. Some (older?)
    crates might need different `crateOverrides` then newer crates with the
    same name. Currently such situations can not (easily) be implemented
    with the override in-place.
    
    (cherry picked from commit be5597f)
    andir committed Mar 28, 2020

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    andir Andreas Rammhold
    Copy the full SHA
    be561c7 View commit details
  3. buildRustCrate: refactor colored logging

    * Make errors include the crate name and make them much more prominent.
    * Move more code into lib.sh
    * Already source generated logging code and lib.sh in configure
    
    (cherry picked from commit 04e7462)
    kolloch authored and andir committed Mar 28, 2020

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    andir Andreas Rammhold
    Copy the full SHA
    7d8d24e View commit details
  4. build-support/rust/buildRustCrate: Search for matching Cargo.toml in …

    …sub directories
    
    This is what cargo does for git repositories.
    
    See related issues:
    
    * nix-community/crate2nix#53
    * nix-community/crate2nix#33
    
    (cherry picked from commit 8a6638d)
    kolloch authored and andir committed Mar 28, 2020

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    andir Andreas Rammhold
    Copy the full SHA
    0965206 View commit details
  5. buildRustCrate: only link build deps into build script

    According to the Cargo documentation:
    
    > The build script does not have access to the dependencies listed in
    > the dependencies or dev-dependencies section (they’re not built
    > yet!). Also, build dependencies are not available to the package
    > itself unless also explicitly added in the [dependencies] table.
    
    https://doc.rust-lang.org/cargo/reference/build-scripts.html
    
    This change separates linkage of regular dependencies and build
    dependencies.
    
    (cherry picked from commit ea6e048)
    danieldk authored and andir committed Mar 28, 2020

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    andir Andreas Rammhold
    Copy the full SHA
    ed3dc87 View commit details
  6. buildRustCrate: sort linker options in-place

    (cherry picked from commit 412c72d)
    danieldk authored and andir committed Mar 28, 2020

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    andir Andreas Rammhold
    Copy the full SHA
    fcb8dc7 View commit details
  7. buildRustCrate: fewer backslashes

    This is a slight readability boost, I think.
    
    (cherry picked from commit 7533876)
    alyssais authored and andir committed Mar 28, 2020

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    andir Andreas Rammhold
    Copy the full SHA
    eb7d450 View commit details
  8. buildRustCrate: don't sort link flags

    Linkage order is significant and sorting can result in link errors.
    
    (cherry picked from commit d8b8537)
    symphorien authored and andir committed Mar 28, 2020

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    andir Andreas Rammhold
    Copy the full SHA
    2597875 View commit details
  9. buildRustCrateTests: add regression test for link order

    (cherry picked from commit 2f7fb1c)
    symphorien authored and andir committed Mar 28, 2020

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    andir Andreas Rammhold
    Copy the full SHA
    9408b0c View commit details

Commits on Mar 29, 2020

  1. buildRustCrateTests: Fix link order test on darwin

    As it turns out Darwin does most of the things differently then "normal"
    systems. They are using a different shared library extension and require
    an obscure commandline parameter that has to be added to every build
    system out there. That issue seems to be with clang on Darwin as on
    Linux that flag isn't required to build the very same tests (when using
    clang).
    
    After adjusting these two details the tests are running fine on the
    darwin box that I was able to obtain.
    
    (cherry picked from commit c8de31b)
    andir committed Mar 29, 2020

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    andir Andreas Rammhold
    Copy the full SHA
    32cbd89 View commit details
  2. buildRustCrate: Add tests for checking files in outputs.

    ...and remove superfluous dependency files (*.d).
    ...and copy dSYM directories on Mac OS when in release=false mode.
    
    (cherry picked from commit 782b304)
    kolloch authored and andir committed Mar 29, 2020

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    andir Andreas Rammhold
    Copy the full SHA
    040f611 View commit details

Commits on Apr 3, 2020

  1. freeoffice: 973 -> 974

    Cherry picked from PR #82038
    
    Changelog:
    
    https://www.freeoffice.com/en/download/servicepacks
    (cherry picked from commit 44085e3)
    danieldk authored and romildo committed Apr 3, 2020
    Copy the full SHA
    a1d49d6 View commit details
  2. freeoffice: 974 -> 976

    Cherry picked from PR #83495
    
    (cherry picked from commit 55b6146)
    romildo committed Apr 3, 2020
    Copy the full SHA
    26df648 View commit details
  3. sympa: 6.2.52 -> 6.2.54

    (cherry picked from commit adc7388)
    mmilata committed Apr 3, 2020
    Copy the full SHA
    769a5cc View commit details
  4. sympa: build with --enable-fhs

    Update module accordingly.
    
    (cherry picked from commit 8f632b4)
    mmilata committed Apr 3, 2020
    Copy the full SHA
    b95cf62 View commit details
  5. nixos/sympa: fix outgoing messaging

    Because ProtectKernelModules implies NoNewPrivileges, postfix's sendmail
    executable, which is setgid, wasn't able to send mail.
    
    (cherry picked from commit fdc36e2)
    mmilata committed Apr 3, 2020
    Copy the full SHA
    5edcadc View commit details
  6. pythonPackages.pint: 0.9 -> 0.11

    (cherry picked from commit 4b822bb)
    drewrisinger committed Apr 3, 2020
    Copy the full SHA
    029276f View commit details
  7. datasette: 0.35 -> 0.39

    (cherry picked from commit fb25290)
    drewrisinger committed Apr 3, 2020
    Copy the full SHA
    a1d1b7a View commit details
  8. Merge pull request #84216 from drewrisinger/dr-pr-backport-20.03-84197

    [20.03] python3Packages.pint: 0.9 -> 0.11
    bhipple authored Apr 3, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e8610d7 View commit details
  9. Merge pull request #84184 from romildo/upd.freeoffice

    [20.03] freeoffice: 973 -> 976
    bhipple authored Apr 3, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    aa3c504 View commit details
  10. Merge pull request #83601 from andir/20.03-buildRustCrate-fixes

    [20.03] buildRustCrate fixes backports
    flokli authored Apr 3, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e46f456 View commit details

Commits on Apr 4, 2020

  1. Merge pull request #84202 from mmilata/sympa-outgoing-20.03

    [20.03] nixos/sympa: fix outgoing emails, update package version
    bhipple authored Apr 4, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4dc8447 View commit details
12 changes: 5 additions & 7 deletions nixos/modules/services/mail/sympa.nix
Original file line number Diff line number Diff line change
@@ -25,8 +25,6 @@ let
StateDirectory = "sympa";
ProtectHome = true;
ProtectSystem = "full";
ProtectKernelTunables = true;
ProtectKernelModules = true;
ProtectControlGroups = true;
};

@@ -415,7 +413,7 @@ in
# force-copy static_content so it's up to date with package
# set permissions for wwsympa which needs write access (...)
"R ${dataDir}/static_content - - - - -"
"C ${dataDir}/static_content 0711 ${user} ${group} - ${pkg}/static_content"
"C ${dataDir}/static_content 0711 ${user} ${group} - ${pkg}/var/lib/sympa/static_content"
"e ${dataDir}/static_content/* 0711 ${user} ${group} - -"

"d /run/sympa 0755 ${user} ${group} - -"
@@ -497,7 +495,7 @@ in
-F ${toString cfg.web.fcgiProcs} \
-P /run/sympa/wwsympa.pid \
-s /run/sympa/wwsympa.socket \
-- ${pkg}/bin/wwsympa.fcgi
-- ${pkg}/lib/sympa/cgi/wwsympa.fcgi
'';

} // commonServiceConfig;
@@ -518,7 +516,7 @@ in
fastcgi_split_path_info ^(${loc})(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME ${pkg}/bin/wwsympa.fcgi;
fastcgi_param SCRIPT_FILENAME ${pkg}/lib/sympa/cgi/wwsympa.fcgi;
'';
}) // {
"/static-sympa/".alias = "${dataDir}/static_content/";
@@ -550,7 +548,7 @@ in
args = [
"flags=hqRu"
"user=${user}"
"argv=${pkg}/bin/queue"
"argv=${pkg}/libexec/queue"
"\${nexthop}"
];
};
@@ -562,7 +560,7 @@ in
args = [
"flags=hqRu"
"user=${user}"
"argv=${pkg}/bin/bouncequeue"
"argv=${pkg}/libexec/bouncequeue"
"\${nexthop}"
];
};
4 changes: 2 additions & 2 deletions pkgs/applications/office/softmaker/freeoffice.nix
Original file line number Diff line number Diff line change
@@ -2,13 +2,13 @@

callPackage ./generic.nix (args // rec {
pname = "freeoffice";
version = "973";
version = "976";
edition = "2018";
suiteName = "FreeOffice";

src = fetchurl {
url = "https://www.softmaker.net/down/softmaker-freeoffice-${version}-amd64.tgz";
sha256 = "0xac4ynf1lfh8qmni5bhp4ybaamdfngva4bqaq21n1m4pgrx1ba5";
sha256 = "13yh4lyqakbdqf4r8vw8imy5gwpfva697iqfd85qmp3wimqvzskl";
};

archive = "freeoffice${edition}.tar.lzma";
8 changes: 3 additions & 5 deletions pkgs/build-support/rust/build-rust-crate/build-crate.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, echo_build_heading, noisily, mkRustcDepArgs, rust }:
{ lib, stdenv, mkRustcDepArgs, rust }:
{ crateName,
dependencies,
crateFeatures, crateRenames, libName, release, libPath,
@@ -11,6 +11,7 @@
baseRustcOpts =
[(if release then "-C opt-level=3" else "-C debuginfo=2")]
++ ["-C codegen-units=$NIX_BUILD_CORES"]
++ ["--remap-path-prefix=$NIX_BUILD_TOP=/" ]
++ [(mkRustcDepArgs dependencies crateRenames)]
++ [crateFeatures]
++ extraRustcOpts
@@ -34,16 +35,13 @@
build_bin = if buildTests then "build_bin_test" else "build_bin";
in ''
runHook preBuild
${echo_build_heading colors}
${noisily colors verbose}
# configure & source common build functions
LIB_RUSTC_OPTS="${libRustcOpts}"
BIN_RUSTC_OPTS="${binRustcOpts}"
LIB_EXT="${stdenv.hostPlatform.extensions.sharedLibrary}"
LIB_PATH="${libPath}"
LIB_NAME="${libName}"
source ${./lib.sh}
CRATE_NAME='${lib.replaceStrings ["-"] ["_"] libName}'
85 changes: 65 additions & 20 deletions pkgs/build-support/rust/build-rust-crate/configure-crate.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, echo_build_heading, noisily, mkRustcDepArgs }:
{ lib, stdenv, echo_colored, noisily, mkRustcDepArgs }:
{ build
, buildDependencies
, colors
@@ -31,42 +31,88 @@ let version_ = lib.splitString "-" crateVersion;
completeDepsDir = lib.concatStringsSep " " completeDeps;
completeBuildDepsDir = lib.concatStringsSep " " completeBuildDeps;
in ''
cd ${workspace_member}
runHook preConfigure
${echo_build_heading colors}
${echo_colored colors}
${noisily colors verbose}
source ${./lib.sh}
${lib.optionalString (workspace_member != null) ''
noisily cd "${workspace_member}"
''}
${lib.optionalString (workspace_member == null) ''
echo_colored "Searching for matching Cargo.toml (${crateName})"
local cargo_toml_dir=$(matching_cargo_toml_dir "${crateName}")
if [ -z "$cargo_toml_dir" ]; then
echo_error "ERROR configuring ${crateName}: No matching Cargo.toml in $(pwd) found." >&2
exit 23
fi
noisily cd "$cargo_toml_dir"
''}
runHook preConfigure
symlink_dependency() {
# $1 is the nix-store path of a dependency
# $2 is the target path
i=$1
ln -s -f $i/lib/*.rlib $2 #*/
ln -s -f $i/lib/*.so $i/lib/*.dylib $2 #*/
if [ -e "$i/lib/link" ]; then
cat $i/lib/link >> target/link
cat $i/lib/link >> target/link.final
fi
if [ -e $i/env ]; then
source $i/env
fi
}
# The following steps set up the dependencies of the crate. Two
# kinds of dependencies are distinguished: build dependencies
# (used by the build script) and crate dependencies. For each
# dependency we have to:
#
# - Make its Rust library available to rustc. This is done by
# symlinking all library dependencies into a directory that
# can be provided to rustc.
# - Accumulate linking flags. These flags are largely used for
# linking native libraries.
#
# The crate link flags are added to the `link` and `link.final`
# files. The `link` file is used for linkage in the current
# crate. The `link.final` file will be copied to the output and can
# be used by downstream crates to get the linker flags of this
# crate.
mkdir -p target/{deps,lib,build,buildDeps}
chmod uga+w target -R
echo ${extraLinkFlags} > target/link
echo ${extraLinkFlags} > target/link.final
# Prepare crate dependencies
for i in ${completeDepsDir}; do
symlink_dependency $i target/deps
if [ -e "$i/lib/link" ]; then
cat $i/lib/link >> target/link
cat $i/lib/link >> target/link.final
fi
done
# Prepare crate build dependencies that are used for the build script.
for i in ${completeBuildDepsDir}; do
symlink_dependency $i target/buildDeps
symlink_dependency $i target/buildDeps
if [ -e "$i/lib/link" ]; then
cat $i/lib/link >> target/link.build
fi
done
if [[ -e target/link ]]; then
sort -u target/link > target/link.sorted
mv target/link.sorted target/link
sort -u target/link.final > target/link.final.sorted
mv target/link.final.sorted target/link.final
tr '\n' ' ' < target/link > target/link_
# Remove duplicate linker flags from the build dependencies.
if [[ -e target/link.build ]]; then
sort -uo target/link.build target/link.build
fi
# Remove duplicate linker flags from the dependencies.
sort -uo target/link target/link
tr '\n' ' ' < target/link > target/link_
# Remove duplicate linker flags from the that are written
# to the derivation's output.
sort -uo target/link.final target/link.final
EXTRA_BUILD=""
BUILD_OUT_DIR=""
export CARGO_PKG_NAME=${crateName}
@@ -105,15 +151,14 @@ in ''
elif [[ -e "build.rs" ]]; then
BUILD="build.rs"
fi
# Compile and run the build script, when available.
if [[ ! -z "$BUILD" ]] ; then
echo_build_heading "$BUILD" ${libName}
mkdir -p target/build/${crateName}
EXTRA_BUILD_FLAGS=""
if [ -e target/link_ ]; then
EXTRA_BUILD_FLAGS=$(cat target/link_)
fi
if [ -e target/link.build ]; then
EXTRA_BUILD_FLAGS="$EXTRA_BUILD_FLAGS $(cat target/link.build)"
EXTRA_BUILD_FLAGS="$EXTRA_BUILD_FLAGS $(tr '\n' ' ' < target/link.build)"
fi
noisily rustc --crate-name build_script_build $BUILD --crate-type bin ${rustcOpts} \
${crateFeatures} --out-dir target/build/${crateName} --emit=dep-info,link \
@@ -127,7 +172,7 @@ in ''
set +e
EXTRA_BUILD=$(sed -n "s/^cargo:rustc-flags=\(.*\)/\1/p" target/build/${crateName}.opt | tr '\n' ' ' | sort -u)
EXTRA_FEATURES=$(sed -n "s/^cargo:rustc-cfg=\(.*\)/--cfg \1/p" target/build/${crateName}.opt | tr '\n' ' ')
EXTRA_LINK=$(sed -n "s/^cargo:rustc-link-lib=\(.*\)/\1/p" target/build/${crateName}.opt | tr '\n' ' ' | sort -u)
EXTRA_LINK=$(sed -n "s/^cargo:rustc-link-lib=\(.*\)/\1/p" target/build/${crateName}.opt | tr '\n' ' ')
EXTRA_LINK_SEARCH=$(sed -n "s/^cargo:rustc-link-search=\(.*\)/\1/p" target/build/${crateName}.opt | tr '\n' ' ' | sort -u)
for env in $(sed -n "s/^cargo:rustc-env=\(.*\)/\1/p" target/build/${crateName}.opt); do
21 changes: 10 additions & 11 deletions pkgs/build-support/rust/build-rust-crate/default.nix
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
# This can be useful for deploying packages with NixOps, and to share
# binary dependencies between projects.

{ lib, stdenv, defaultCrateOverrides, fetchCrate, rustc, rust }:
{ lib, stdenv, defaultCrateOverrides, fetchCrate, rustc, rust, cargo, jq }:

let
# This doesn't appear to be officially documented anywhere yet.
@@ -29,14 +29,14 @@ let
" --extern ${name}=${dep.lib}/lib/lib${extern}-${dep.metadata}${stdenv.hostPlatform.extensions.sharedLibrary}")
) dependencies;

inherit (import ./log.nix { inherit lib; }) noisily echo_build_heading;
inherit (import ./log.nix { inherit lib; }) noisily echo_colored;

configureCrate = import ./configure-crate.nix {
inherit lib stdenv echo_build_heading noisily mkRustcDepArgs;
inherit lib stdenv echo_colored noisily mkRustcDepArgs;
};

buildCrate = import ./build-crate.nix {
inherit lib stdenv echo_build_heading noisily mkRustcDepArgs rust;
inherit lib stdenv mkRustcDepArgs rust;
};

installCrate = import ./install-crate.nix { inherit stdenv; };
@@ -62,9 +62,6 @@ let crate = crate_ // (lib.attrByPath [ crate_.crateName ] (attr: {}) crateOverr
extraRustcOpts_ = extraRustcOpts;
buildTests_ = buildTests;

# take a list of crates that we depend on and override them to fit our overrides, rustc, release, …
makeDependencies = map (dep: lib.getLib (dep.override { inherit release verbose crateOverrides; }));

# crate2nix has a hack for the old bash based build script that did split
# entries at `,`. No we have to work around that hack.
# https://github.com/kolloch/crate2nix/blame/5b19c1b14e1b0e5522c3e44e300d0b332dc939e7/crate2nix/templates/build.nix.tera#L89
@@ -91,10 +88,10 @@ stdenv.mkDerivation (rec {

src = crate.src or (fetchCrate { inherit (crate) crateName version sha256; });
name = "rust_${crate.crateName}-${crate.version}${lib.optionalString buildTests_ "-test"}";
depsBuildBuild = [ rust stdenv.cc ];
depsBuildBuild = [ rust stdenv.cc cargo jq ];
buildInputs = (crate.buildInputs or []) ++ buildInputs_;
dependencies = makeDependencies dependencies_;
buildDependencies = makeDependencies buildDependencies_;
dependencies = map lib.getLib dependencies_;
buildDependencies = map lib.getLib buildDependencies_;

completeDeps = lib.unique (dependencies ++ lib.concatMap (dep: dep.completeDeps) dependencies);
completeBuildDeps = lib.unique (
@@ -103,7 +100,7 @@ stdenv.mkDerivation (rec {
);

crateFeatures = lib.optionalString (crate ? features)
(lib.concatMapStringsSep " " (f: "--cfg feature=\\\"${f}\\\"") (crate.features ++ features));
(lib.concatMapStringsSep " " (f: ''--cfg feature=\"${f}\"'') (crate.features ++ features));

libName = if crate ? libName then crate.libName else crate.crateName;
libPath = if crate ? libPath then crate.libPath else "";
@@ -117,6 +114,8 @@ stdenv.mkDerivation (rec {
in lib.substring 0 10 hashedMetadata;

build = crate.build or "";
# Either set to a concrete sub path to the crate root
# or use `null` for auto-detect.
workspace_member = crate.workspace_member or ".";
crateVersion = crate.version;
crateDescription = crate.description or "";
4 changes: 2 additions & 2 deletions pkgs/build-support/rust/build-rust-crate/install-crate.nix
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ if !buildTests then ''
fi
if [[ "$(ls -A target/lib)" ]]; then
mkdir -p $lib/lib
cp target/lib/* $lib/lib #*/
cp -r target/lib/* $lib/lib #*/
for library in $lib/lib/*.so $lib/lib/*.dylib; do #*/
ln -s $library $(echo $library | sed -e "s/-${metadata}//")
done
@@ -26,7 +26,7 @@ if !buildTests then ''
if [[ -d target/bin ]]; then
if [[ "$(ls -A target/bin)" ]]; then
mkdir -p $out/bin
cp -P target/bin/* $out/bin # */
cp -rP target/bin/* $out/bin # */
fi
fi
runHook postInstall
Loading