Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to LF1.17, Support external daml-sdk tarball #1246

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion bin/update-daml-hashes
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

sdkVersion=$(yq .sdk-version $DIR/../daml.yaml)
damlVersion=$(yq .daml-version $DIR/../daml.yaml)
tarPath=$(yq .daml-tar-path $DIR/../daml.yaml)

release_exists() (
curl -I \
Expand Down Expand Up @@ -36,6 +37,9 @@ get_hash() (
exit 1
fi
;;
local)
ln -sf $tarPath $out
;;
esac
echo $(sha256sum $out | awk '{print $1}') | xxd -r -p | base64
)
Expand All @@ -45,7 +49,11 @@ update_yaml_files() (
find docs package -name daml.yaml -exec sed -i "s|sdk-version:.*|sdk-version: $version|" '{}' \;
)

if release_exists; then
if [ $tarPath != "null" ]; then
echo "Using provided tar with sdk version $sdkVersion"
src=local
update_yaml_files $sdkVersion
elif release_exists; then
echo "Using daml version $damlVersion."
src=public
update_yaml_files $sdkVersion
Expand Down
17 changes: 14 additions & 3 deletions daml.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# update the hashes. The sdk-version refers to the release folder names (or tags) found here:
# https://github.com/digital-asset/daml/releases
# For example 2.9.0-rc1 (in case of a release candidate) or 2.8.0 (for a regular release)
sdk-version: 2.9.5
sdk-version: 2.10.0-snapshot.20241106.0
# daml-version is not used by the daml assistant, only by the finance nix config
# It refers to the version number of the files of the release folder.
# For example, if you use a release candidate like:
Expand All @@ -16,7 +16,15 @@ sdk-version: 2.9.5
# On the other hand, if you use a regular release like:
# https://github.com/digital-asset/daml/releases/tag/v2.8.0
# the daml-version would simply be: 2.8.0
daml-version: 2.9.5
daml-version: 2.10.0-snapshot.20241101.13047.0.v1e6d5c93
# To use a custom daml, you must update the sdk-version across the project to that of the tar you have (likely 0.0.0)
# daml-version above will be ignored
# and uncomment the below tar path to point to your release tar.
# You can generate this tar from the daml repo (in sdk/) using `bazel build //release:sdk-release-tarball`
# which will generate the tar at <daml>/sdk/bazel-bin/release/sdk-release-tarball-ce.tar.gz
# Be sure to run bin/update-daml-hashes after adding or changing this path, and on rebuild
# NOTE: This must be an absolute path to the release tarball.
# daml-tar-path: <daml>/sdk/bazel-bin/release/sdk-release-tarball-ce.tar.gz
name: daml-finance
source: src/test/daml
# version is independent of the actual sdk-version. It is used to create an assembly artifact here
Expand All @@ -28,8 +36,11 @@ version: 1.5.0
dependencies:
- daml-prim
- daml-stdlib
- daml-script
- daml-script-beta
data-dependencies:
- .lib/daml-ctl/v2.4.1/daml-ctl-2.4.1.dar
build-options:
- --include=src/main/daml
- --target=1.17
- -Wno-upgrade-interfaces
- -Wno-upgrade-exceptions
4 changes: 2 additions & 2 deletions docs/code-samples/getting-started/daml.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

# *** DO NOT COPY THIS FILE TO THE DAML REPO ***

sdk-version: 2.9.5
sdk-version: 2.10.0-snapshot.20241106.0
name: quickstart-finance
source: daml
init-script: Scripts.Transfer:runTransfer
version: 0.0.6
dependencies:
- daml-prim
- daml-script
- daml-script-beta
- daml-stdlib
data-dependencies:
# INTERFACE DEPENDENCIES
Expand Down
2 changes: 1 addition & 1 deletion docs/code-samples/getting-started/daml.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ init-script: Scripts.Transfer:runTransfer
version: 0.0.6
dependencies:
- daml-prim
- daml-script
- daml-script-beta
- daml-stdlib
data-dependencies:
# INTERFACE DEPENDENCIES
Expand Down
4 changes: 2 additions & 2 deletions docs/code-samples/lifecycling/daml.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

# *** DO NOT COPY THIS FILE TO THE DAML REPO ***

sdk-version: 2.9.5
sdk-version: 2.10.0-snapshot.20241106.0
name: finance-lifecycling
source: daml
init-script: Scripts.FixedRateBond:runFixedRateBond
version: 0.0.6
dependencies:
- daml-prim
- daml-script
- daml-script-beta
- daml-stdlib
data-dependencies:
# INTERFACE DEPENDENCIES
Expand Down
2 changes: 1 addition & 1 deletion docs/code-samples/lifecycling/daml.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ init-script: Scripts.FixedRateBond:runFixedRateBond
version: 0.0.6
dependencies:
- daml-prim
- daml-script
- daml-script-beta
- daml-stdlib
data-dependencies:
# INTERFACE DEPENDENCIES
Expand Down
4 changes: 2 additions & 2 deletions docs/code-samples/payoff-modeling/daml.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

# *** DO NOT COPY THIS FILE TO THE DAML REPO ***

sdk-version: 2.9.5
sdk-version: 2.10.0-snapshot.20241106.0
name: finance-payoff-modeling
source: daml
init-script: PayoffBuilder:runCreateAndLifecycle
version: 0.0.6
dependencies:
- daml-prim
- daml-stdlib
- daml-script
- daml-script-beta
data-dependencies:
# INTERFACE DEPENDENCIES
- .lib/daml-finance-interface-claims.dar
Expand Down
2 changes: 1 addition & 1 deletion docs/code-samples/payoff-modeling/daml.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version: 0.0.6
dependencies:
- daml-prim
- daml-stdlib
- daml-script
- daml-script-beta
data-dependencies:
# INTERFACE DEPENDENCIES
- .lib/daml-finance-interface-claims.dar
Expand Down
4 changes: 2 additions & 2 deletions docs/code-samples/settlement/daml.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

# *** DO NOT COPY THIS FILE TO THE DAML REPO ***

sdk-version: 2.9.5
sdk-version: 2.10.0-snapshot.20241106.0
name: finance-settlement
source: daml
init-script: Scripts.Transfer:runDualControlTransfer
version: 0.0.6
dependencies:
- daml-prim
- daml-script
- daml-script-beta
- daml-stdlib
data-dependencies:
# INTERFACE DEPENDENCIES
Expand Down
2 changes: 1 addition & 1 deletion docs/code-samples/settlement/daml.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ init-script: Scripts.Transfer:runDualControlTransfer
version: 0.0.6
dependencies:
- daml-prim
- daml-script
- daml-script-beta
- daml-stdlib
data-dependencies:
# INTERFACE DEPENDENCIES
Expand Down
4 changes: 2 additions & 2 deletions docs/code-samples/upgrades/daml.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

# *** DO NOT COPY THIS FILE TO THE DAML REPO ***

sdk-version: 2.9.5
sdk-version: 2.10.0-snapshot.20241106.0
name: finance-upgrades
source: daml
init-script: Scripts.UpgradeHolding:upgradeHolding
version: 0.0.6
dependencies:
- daml-prim
- daml-script
- daml-script-beta
- daml-stdlib
data-dependencies:
# INTERFACE DEPENDENCIES
Expand Down
2 changes: 1 addition & 1 deletion docs/code-samples/upgrades/daml.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ init-script: Scripts.UpgradeHolding:upgradeHolding
version: 0.0.6
dependencies:
- daml-prim
- daml-script
- daml-script-beta
- daml-stdlib
data-dependencies:
# INTERFACE DEPENDENCIES
Expand Down
18 changes: 15 additions & 3 deletions nix/daml.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ stdenv, jdk, curl, curl_cert, sdkVersion, damlVersion, os, osJFrog, hashes }:
{ stdenv, jdk, curl, curl_cert, sdkVersion, damlVersion, tarPath, os, osJFrog, hashes }:
let
nixTarPath = if tarPath == null then null else /. + tarPath;
tarball = stdenv.mkDerivation {
pname = "daml-tarball";
version = sdkVersion;
Expand All @@ -14,6 +15,17 @@ let
source .envrc.private
fi

get_local() (
tar_path="${if nixTarPath == null then "" else nixTarPath}"
if [ -z $tar_path ]; then
echo "No explict tar set, attempting to download"
exit 1
else
echo "Using explicit tar"
cp $tar_path $out
chmod -x $out
fi
)
get_os() (
echo "Downloading SDK from GitHub..."
curl --location \
Expand All @@ -33,7 +45,7 @@ let
fi
)

get_os || get_ee
get_local || get_os || get_ee
'';
dontInstall = true;
outputHashAlgo = "sha256";
Expand All @@ -54,7 +66,7 @@ in
installPhase = ''
cd daml
export DAML_HOME=$out
./daml/daml install --install-assistant yes --install-with-internal-version yes $src
./daml/daml install --install-assistant yes --install-with-custom-version $version $src
'';
propagatedBuildInputs = [ jdk ];
preFixup = ''
Expand Down
7 changes: 5 additions & 2 deletions package/main/daml/ContingentClaims.Core/daml.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

sdk-version: 2.9.5
sdk-version: 2.10.0-snapshot.20241106.0
name: contingent-claims-core
source: daml
version: 2.0.2
Expand All @@ -10,5 +10,8 @@ dependencies:
- daml-stdlib
data-dependencies:
- .lib/daml-ctl/v2.4.1/daml-ctl-2.4.1.dar
build-options: null
build-options:
- --target=1.17
- -Wno-upgrade-interfaces
- -Wno-upgrade-exceptions

7 changes: 5 additions & 2 deletions package/main/daml/ContingentClaims.Lifecycle/daml.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

sdk-version: 2.9.5
sdk-version: 2.10.0-snapshot.20241106.0
name: contingent-claims-lifecycle
source: daml
version: 2.0.2
Expand All @@ -11,5 +11,8 @@ dependencies:
data-dependencies:
- .lib/daml-ctl/v2.4.1/daml-ctl-2.4.1.dar
- .lib/daml-finance/ContingentClaims.Core/2.0.2/contingent-claims-core-2.0.2.dar
build-options: null
build-options:
- --target=1.17
- -Wno-upgrade-interfaces
- -Wno-upgrade-exceptions

7 changes: 5 additions & 2 deletions package/main/daml/ContingentClaims.Valuation/daml.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

sdk-version: 2.9.5
sdk-version: 2.10.0-snapshot.20241106.0
name: contingent-claims-valuation
source: daml
version: 0.2.3
Expand All @@ -11,5 +11,8 @@ dependencies:
data-dependencies:
- .lib/daml-ctl/v2.4.1/daml-ctl-2.4.1.dar
- .lib/daml-finance/ContingentClaims.Core/2.0.2/contingent-claims-core-2.0.2.dar
build-options: null
build-options:
- --target=1.17
- -Wno-upgrade-interfaces
- -Wno-upgrade-exceptions

7 changes: 5 additions & 2 deletions package/main/daml/Daml.Finance.Account/daml.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

sdk-version: 2.9.5
sdk-version: 2.10.0-snapshot.20241106.0
name: daml-finance-account
source: daml
version: 3.0.1
Expand All @@ -14,5 +14,8 @@ data-dependencies:
- .lib/daml-finance/Daml.Finance.Interface.Types.Common/2.0.1/daml-finance-interface-types-common-2.0.1.dar
- .lib/daml-finance/Daml.Finance.Interface.Util/2.1.1/daml-finance-interface-util-2.1.1.dar
- .lib/daml-finance/Daml.Finance.Util/3.1.1/daml-finance-util-3.1.1.dar
build-options: null
build-options:
- --target=1.17
- -Wno-upgrade-interfaces
- -Wno-upgrade-exceptions

7 changes: 5 additions & 2 deletions package/main/daml/Daml.Finance.Claims/daml.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

sdk-version: 2.9.5
sdk-version: 2.10.0-snapshot.20241106.0
name: daml-finance-claims
source: daml
version: 2.1.1
Expand All @@ -20,5 +20,8 @@ data-dependencies:
- .lib/daml-finance/Daml.Finance.Interface.Util/2.1.1/daml-finance-interface-util-2.1.1.dar
- .lib/daml-finance/Daml.Finance.Lifecycle/3.0.1/daml-finance-lifecycle-3.0.1.dar
- .lib/daml-finance/Daml.Finance.Util/3.1.1/daml-finance-util-3.1.1.dar
build-options: null
build-options:
- --target=1.17
- -Wno-upgrade-interfaces
- -Wno-upgrade-exceptions

7 changes: 5 additions & 2 deletions package/main/daml/Daml.Finance.Data/daml.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

sdk-version: 2.9.5
sdk-version: 2.10.0-snapshot.20241106.0
name: daml-finance-data
source: daml
version: 3.0.1
Expand All @@ -15,5 +15,8 @@ data-dependencies:
- .lib/daml-finance/Daml.Finance.Interface.Types.Date/2.1.1/daml-finance-interface-types-date-2.1.1.dar
- .lib/daml-finance/Daml.Finance.Interface.Util/2.1.1/daml-finance-interface-util-2.1.1.dar
- .lib/daml-finance/Daml.Finance.Util/3.1.1/daml-finance-util-3.1.1.dar
build-options: null
build-options:
- --target=1.17
- -Wno-upgrade-interfaces
- -Wno-upgrade-exceptions

7 changes: 5 additions & 2 deletions package/main/daml/Daml.Finance.Holding/daml.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

sdk-version: 2.9.5
sdk-version: 2.10.0-snapshot.20241106.0
name: daml-finance-holding
source: daml
version: 3.0.2
Expand All @@ -14,5 +14,8 @@ data-dependencies:
- .lib/daml-finance/Daml.Finance.Interface.Types.Common/2.0.1/daml-finance-interface-types-common-2.0.1.dar
- .lib/daml-finance/Daml.Finance.Interface.Util/2.1.1/daml-finance-interface-util-2.1.1.dar
- .lib/daml-finance/Daml.Finance.Util/3.1.1/daml-finance-util-3.1.1.dar
build-options: null
build-options:
- --target=1.17
- -Wno-upgrade-interfaces
- -Wno-upgrade-exceptions

7 changes: 5 additions & 2 deletions package/main/daml/Daml.Finance.Instrument.Bond/daml.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

sdk-version: 2.9.5
sdk-version: 2.10.0-snapshot.20241106.0
name: daml-finance-instrument-bond
source: daml
version: 2.0.1
Expand All @@ -20,5 +20,8 @@ data-dependencies:
- .lib/daml-finance/Daml.Finance.Interface.Types.Date/2.1.1/daml-finance-interface-types-date-2.1.1.dar
- .lib/daml-finance/Daml.Finance.Interface.Util/2.1.1/daml-finance-interface-util-2.1.1.dar
- .lib/daml-finance/Daml.Finance.Util/3.1.1/daml-finance-util-3.1.1.dar
build-options: null
build-options:
- --target=1.17
- -Wno-upgrade-interfaces
- -Wno-upgrade-exceptions

Loading