2022-10-17 17:20:48 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, buildGoModule
|
|
|
|
, coreutils
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, git
|
2022-10-18 19:17:01 +00:00
|
|
|
# passthru
|
|
|
|
, runCommand
|
|
|
|
, makeWrapper
|
|
|
|
, pulumi
|
|
|
|
, pulumiPackages
|
2022-10-17 17:20:48 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "pulumi";
|
2023-11-08 14:24:31 +00:00
|
|
|
version = "3.93.0";
|
2022-10-17 17:20:48 +00:00
|
|
|
|
2022-12-18 10:12:42 +00:00
|
|
|
# Used in pulumi-language packages, which inherit this prop
|
2023-10-25 09:24:59 +00:00
|
|
|
sdkVendorHash = lib.fakeHash;
|
2022-12-18 10:12:42 +00:00
|
|
|
|
2022-10-17 17:20:48 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-11-08 14:24:31 +00:00
|
|
|
hash = "sha256-EaYYIbV7IItnmVfyEHtaAbAXvrZ8CXMjW+yNXOBIxg8=";
|
2023-01-07 12:13:34 +00:00
|
|
|
# Some tests rely on checkout directory name
|
|
|
|
name = "pulumi";
|
2022-10-17 17:20:48 +00:00
|
|
|
};
|
|
|
|
|
2023-11-08 14:24:31 +00:00
|
|
|
vendorHash = "sha256-G+LspC6b2TvboMU6rKB0qrhhMNaLPVt/nUYZzkiVr/Q=";
|
2022-10-17 17:20:48 +00:00
|
|
|
|
2023-01-07 12:13:34 +00:00
|
|
|
sourceRoot = "${src.name}/pkg";
|
2022-10-17 17:20:48 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
# Bundle release metadata
|
|
|
|
ldflags = [
|
|
|
|
# Omit the symbol table and debug information.
|
|
|
|
"-s"
|
|
|
|
# Omit the DWARF symbol table.
|
|
|
|
"-w"
|
|
|
|
] ++ importpathFlags;
|
|
|
|
|
|
|
|
importpathFlags = [
|
|
|
|
"-X github.com/pulumi/pulumi/pkg/v3/version.Version=v${version}"
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2022-12-14 08:53:04 +00:00
|
|
|
disabledTests = [
|
|
|
|
# Flaky test
|
|
|
|
"TestPendingDeleteOrder"
|
2023-10-24 16:06:00 +00:00
|
|
|
# Tries to clone repo: github.com/pulumi/templates.git
|
|
|
|
"TestGenerateOnlyProjectCheck"
|
|
|
|
# Following tests give this error, not quite sure why:
|
|
|
|
# Error Trace: /build/pulumi/pkg/engine/lifecycletest/update_plan_test.go:273
|
|
|
|
# Error: Received unexpected error:
|
|
|
|
# Unexpected diag message: <{%reset%}>using pulumi-resource-pkgA from $PATH at /build/tmp.bS8caxmTx7/pulumi-resource-pkgA<{%reset%}>
|
|
|
|
# Test: TestUnplannedDelete
|
|
|
|
"TestExpectedDelete"
|
|
|
|
"TestPlannedInputOutputDifferences"
|
|
|
|
"TestPlannedUpdateChangedStack"
|
|
|
|
"TestExpectedCreate"
|
|
|
|
"TestUnplannedDelete"
|
|
|
|
# Following test gives this error, not sure why:
|
|
|
|
# --- Expected
|
|
|
|
# +++ Actual
|
|
|
|
# @@ -1 +1 @@
|
|
|
|
# -gcp
|
|
|
|
# +aws
|
|
|
|
"TestPluginMapper_MappedNamesDifferFromPulumiName"
|
2022-12-14 08:53:04 +00:00
|
|
|
];
|
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [
|
2022-10-17 17:20:48 +00:00
|
|
|
git
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
# The tests require `version.Version` to be unset
|
|
|
|
ldflags=''${ldflags//"$importpathFlags"/}
|
|
|
|
|
|
|
|
# Create some placeholders for plugins used in tests. Otherwise, Pulumi
|
|
|
|
# tries to donwload them and fails, resulting in really long test runs
|
|
|
|
dummyPluginPath=$(mktemp -d)
|
|
|
|
for name in pulumi-{resource-pkg{A,B},-pkgB}; do
|
|
|
|
ln -s ${coreutils}/bin/true "$dummyPluginPath/$name"
|
|
|
|
done
|
|
|
|
|
|
|
|
export PATH=$dummyPluginPath''${PATH:+:}$PATH
|
|
|
|
|
|
|
|
# Code generation tests also download dependencies from network
|
|
|
|
rm codegen/{docs,dotnet,go,nodejs,python,schema}/*_test.go
|
2022-11-14 18:56:57 +00:00
|
|
|
rm -R codegen/{dotnet,go,nodejs,python}/gen_program_test
|
2022-12-14 08:53:04 +00:00
|
|
|
|
|
|
|
# Only run tests not marked as disabled
|
|
|
|
buildFlagsArray+=("-run" "[^(${lib.concatStringsSep "|" disabledTests})]")
|
2022-10-17 17:20:48 +00:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
|
|
|
export PULUMI_HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Allow tests that bind or connect to localhost on macOS.
|
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
PULUMI_SKIP_UPDATE_CHECK=1 $out/bin/pulumi version | grep v${version} > /dev/null
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd pulumi \
|
|
|
|
--bash <($out/bin/pulumi gen-completion bash) \
|
|
|
|
--fish <($out/bin/pulumi gen-completion fish) \
|
|
|
|
--zsh <($out/bin/pulumi gen-completion zsh)
|
|
|
|
'';
|
|
|
|
|
2022-10-18 19:17:01 +00:00
|
|
|
passthru = {
|
|
|
|
pkgs = pulumiPackages;
|
|
|
|
withPackages = f: runCommand "${pulumi.name}-with-packages"
|
|
|
|
{
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
}
|
|
|
|
''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
makeWrapper ${pulumi}/bin/pulumi $out/bin/pulumi \
|
|
|
|
--suffix PATH : ${lib.makeSearchPath "bin" (f pulumiPackages)}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2022-10-17 17:20:48 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://pulumi.io/";
|
|
|
|
description = "Pulumi is a cloud development platform that makes creating cloud programs easy and productive";
|
2023-01-02 02:48:04 +00:00
|
|
|
sourceProvenance = [ sourceTypes.fromSource ];
|
2022-10-17 17:20:48 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [
|
|
|
|
trundle
|
|
|
|
veehaitch
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|