buildRustPackage: factor out setting up cargoBuildHook, add maturinBuildHook#112804
buildRustPackage: factor out setting up cargoBuildHook, add maturinBuildHook#112804Mic92 merged 8 commits intoNixOS:stagingfrom
Conversation
- API change: remove the `target` argument of `buildRustPackage`, the target should always be in sync with the C/C++ compiler that is used. - Gathering of binaries has moved from `buildPhase` to `installPhase`, this simplifies the hook and orders this functionality logically with the installation logic.
This avoids that non-buildRustPackage derivations need to specify sourceRoot when the fetcher performs root stripping.
eeb1952 to
9e79253
Compare
|
Added documentation and lifted the Draft PR toggle. |
This build hook can be used to build Python packages using maturin.
c1dd623 to
dbc8633
Compare
|
@Mic92 is this ok for you to merge? |
|
Result of 3 packages built:
|
|
I just noticed that I made an error -- finding libraries and executables must be done before |
|
Is there a chance that this broke gnome-tour on master? When built via meson/ninja, it compiles resources (using Useful links:
|
|
In the meantime I really bisected the regression to the first commit of this PR (without understanding it). A catch is that you need a later change --- a/pkgs/development/libraries/webkitgtk/default.nix
+++ b/pkgs/development/libraries/webkitgtk/default.nix
@@ -155,6 +155,9 @@ stdenv.mkDerivation rec {
"-DPORT=GTK"
"-DUSE_LIBHYPHEN=OFF"
"-DUSE_WPE_RENDERER=OFF"
+ # ensure backward compatibility with the latest version of icu:
+ # http://linuxfromscratch.org/blfs/view/svn/x/webkitgtk.html
+ "-DCMAKE_CXX_FLAGS=-DU_DEFINE_FALSE_AND_TRUE=1"
] ++ optionals stdenv.isDarwin [
"-DENABLE_GRAPHICS_CONTEXT_3D=OFF"
"-DENABLE_GTKDOC=OFF"to fix the build of the webkit dependency (and some of these take a long time to build, too). |
|
Yes, it landed at once with the breakage during the last |
As far as I can tell, a8efb20 removed the `target =` escape hatch. See NixOS#112804 This commit removes it from the documentation. Signed-off-by: Arthur Gautier <[email protected]>
Motivation for this change
Convert the build phase of
buildRustPackageinto thecargoBuildHookhook. Also add amaturinBuildHookand convert the derivations that usematurintobuildPythonPackage+cargoSetupHook+maturinBuildHook.Additional comments:
buildRustPackagehas an API change: remove thetargetargument ofbuildRustPackage, the target should always be in sync with the C/C++ compiler that is used.buildPhasetoinstallPhase, this simplifies the hook and orders this functionality logically with the installation logic.Todo:
Related issues:
CC @FRidh @Mic92 @adisbladis @DavHau
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)