Commit Graph

14 Commits

Author SHA1 Message Date
Ivan Petkov
17f4ff6ad7 buildPackage: use mkCargoDerivation instead of cargoBuild 2022-10-09 12:56:21 -10:00
Ivan Petkov
fc545e6784
hooks: do not use substitutions for needed tools (#128)
* Using substitutions for build hooks is a great way to ensure the
  necessary utility is present without making the caller supply it to
  the builder, except it makes things confusing when applying overrides
* For example, the `installFromCargoBuildLog` hook was inadvertently
  ignoring any `cargo` overrides applied to the entire `lib`
  instantiation
* By removing all explicit substations we also side step the issue of
  trying to select the correct build/host/target version of the tool and
  use whatever is present in the build environment
2022-10-09 02:03:05 +00:00
Ivan Petkov
06b1f7bd80
Improve stripping references to vendored sources (#120)
* Also add removeReferencesToVendoredSourcesHook
2022-09-24 23:45:56 +00:00
Ivan Petkov
352c7ff1b8
mkCargoDerivation: add default configurePhase (#106)
This is done to avoid breaking builds by including puts happen to have
setup-hooks which try to claim the configure phase (such as `cmake`).

The old behavior can be brought back by setting `configurePhase = null;`
on the derivation.
2022-09-18 01:18:03 +00:00
Ivan Petkov
dbda889c05
Replace source prefix mapping with remove-references-to (#90) 2022-08-28 01:44:07 +00:00
Ivan Petkov
a2dd1b8ad4
Allow configuring which cargo profile is selected 2022-07-23 11:10:45 -07:00
Ivan Petkov
bce972e03b
Add cargoHelperFunctionsHook
* It will automatically capture and log all `cargo` invocations
2022-07-23 11:11:36 -07:00
Ivan Petkov
7fc1a8fec3
Remove --workspace from all default commands
* This allows for fewer assumptions about the project structure
* The old behavior can easily be brought back by setting `cargoExtraArgs
  = "--workspace";` in any derivation
2022-07-20 19:27:52 -07:00
Ivan Petkov
49ef407216
Rename doCopyTargetToOutput to doInstallCargoArtifacts
* Similarly rename `installCargoTargetDirHook` to
  `installCargoArtifactsHook`
* The intention is to highlight that "install" implies "copy to output"
  and not anywhere else
* Also avoids the potential confusion of "cargo target dir" (location of
  cargo's artifacts) with "cargo target" (which is the target
  architecture/platform we want cargo to build for)
2022-01-08 17:14:05 -08:00
Ivan Petkov
44e9060497
Print cargo version before building
* Just for the benefit of being able to tell at which cargo version is
  used at a glance
2022-01-07 20:48:52 -08:00
Ivan Petkov
ba50659d0d
Rename buildWithCargo to cargoBuild 2022-01-04 14:18:29 -08:00
Ivan Petkov
ab283fb5f7
Echo all build/check/install commands for easier debugging 2022-01-04 09:49:04 -08:00
Ivan Petkov
dc553e3853
Remove installFromCargoArtifactsHook
* This hook was never a great implementation to begin with since it
  would simply search the cargo artifacts directory for binaries and
  libraries to install
* This isn't really great since if we have multiple builds (say one with
  debug artifacts, one with release artifacts) it isn't exactly clear
  which artifacts would get installed (or which will get clobbered).
* Now that we have installFromCargoBuildLogHook we can simplify the
  options a bit and only have one main installation method. The caller
  can always provide their own if they wish
2022-01-03 14:42:59 -08:00
Ivan Petkov
f69c8a4c44
Add buildPackage for building and installing cargo packages 2022-01-03 14:32:51 -08:00