Skip to content

Commit

Permalink
No need dkml_target_abi if SKIP_OPAM_MODIFICATIONS
Browse files Browse the repository at this point in the history
+ Add testing instructions
  • Loading branch information
jonahbeckford committed Oct 21, 2024
1 parent f6811b8 commit f254645
Show file tree
Hide file tree
Showing 13 changed files with 118 additions and 17 deletions.
10 changes: 10 additions & 0 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Developing

## Building

```console
$ opam install . --deps-only --yes

Expand All @@ -9,3 +11,11 @@ $ opam install ocaml-lsp-server ocamlformat ocamlformat-rpc --yes
$ opam exec -- dune runtest
$ opam exec -- dune runtest --auto-promote
```

## Testing

After building, you can test locally on Windows PowerShell with:

```powershell
& test\pc\setup-dkml-windows_x86_64.ps1
```
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ variable will also be available to use as
#### SKIP_OPAM_MODIFICATIONS

When set to `true` (the default is `false`) the opam root will not be
created or modified.
created or modified. Setting `dkml_target_abi` is no longer required.

The `cmdrun` script will be available for you to create your
own opam root and switches. The commands you run will have access to
Expand Down
9 changes: 8 additions & 1 deletion src/scripts/setup-dkml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ section_begin setup-info "Summary: setup-dkml"

SKIP_OPAM_MODIFICATIONS=${SKIP_OPAM_MODIFICATIONS:-false} # default is false

if [ "$SKIP_OPAM_MODIFICATIONS" = "false" ]; then
if [ -z "${dkml_target_abi:-}" ]; then
echo "dkml_target_abi environment variable is required unless SKIP_OPAM_MODIFICATIONS=true" >&2
exit 2
fi
fi

# shellcheck disable=SC2154
echo "
=============
Expand Down Expand Up @@ -147,7 +154,7 @@ GIT_LOCATION=${GIT_LOCATION:-}
Matrix
------
dkml_host_abi=$dkml_host_abi
dkml_target_abi=$dkml_target_abi
dkml_target_abi=${dkml_target_abi:-}
abi_pattern=$abi_pattern
opam_root=${opam_root}
opam_root_cacheable=${opam_root_cacheable}
Expand Down
11 changes: 9 additions & 2 deletions test/gh-darwin/pre/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,13 @@ runs:
SKIP_OPAM_MODIFICATIONS=${SKIP_OPAM_MODIFICATIONS:-false} # default is false
if [ "$SKIP_OPAM_MODIFICATIONS" = "false" ]; then
if [ -z "${dkml_target_abi:-}" ]; then
echo "dkml_target_abi environment variable is required unless SKIP_OPAM_MODIFICATIONS=true" >&2
exit 2
fi
fi
# shellcheck disable=SC2154
echo "
=============
Expand Down Expand Up @@ -508,7 +515,7 @@ runs:
Matrix
------
dkml_host_abi=$dkml_host_abi
dkml_target_abi=$dkml_target_abi
dkml_target_abi=${dkml_target_abi:-}
abi_pattern=$abi_pattern
opam_root=${opam_root}
opam_root_cacheable=${opam_root_cacheable}
Expand Down Expand Up @@ -1808,7 +1815,7 @@ runs:
shell: bash
run: |
set -x
echo '7b3d80-${{ steps.full_matrix_vars.outputs.dkml_host_abi }}-${{ steps.full_matrix_vars.outputs.dkml_target_abi }}' > .ci/sd4/cachekey.opam.binaries
echo '7a34d1-${{ steps.full_matrix_vars.outputs.dkml_host_abi }}-${{ steps.full_matrix_vars.outputs.dkml_target_abi }}' > .ci/sd4/cachekey.opam.binaries
echo '${{ steps.full_matrix_vars.outputs.abi_pattern }}-${{ steps.full_matrix_vars.outputs.vsstudio_arch }}-${{ steps.full_matrix_vars.outputs.vsstudio_hostarch }}-${{ steps.full_matrix_vars.outputs.vsstudio_dir }}-${{ steps.full_matrix_vars.outputs.vsstudio_vcvarsver }}-${{ steps.full_matrix_vars.outputs.vsstudio_winsdkver }}-${{ steps.full_matrix_vars.outputs.vsstudio_msvspreference }}-${{ steps.full_matrix_vars.outputs.vsstudio_cmakegenerator }}' > .ci/sd4/cachekey.vsstudio
echo '${{ inputs.OCAML_COMPILER }}-${{ inputs.DISKUV_OPAM_REPOSITORY }}-${{ inputs.DKML_COMPILER }}-${{ inputs.CONF_DKML_CROSS_TOOLCHAIN }}' > .ci/sd4/cachekey.ci.inputs
Expand Down
11 changes: 9 additions & 2 deletions test/gh-linux/pre/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,13 @@ runs:
SKIP_OPAM_MODIFICATIONS=${SKIP_OPAM_MODIFICATIONS:-false} # default is false
if [ "$SKIP_OPAM_MODIFICATIONS" = "false" ]; then
if [ -z "${dkml_target_abi:-}" ]; then
echo "dkml_target_abi environment variable is required unless SKIP_OPAM_MODIFICATIONS=true" >&2
exit 2
fi
fi
# shellcheck disable=SC2154
echo "
=============
Expand Down Expand Up @@ -534,7 +541,7 @@ runs:
Matrix
------
dkml_host_abi=$dkml_host_abi
dkml_target_abi=$dkml_target_abi
dkml_target_abi=${dkml_target_abi:-}
abi_pattern=$abi_pattern
opam_root=${opam_root}
opam_root_cacheable=${opam_root_cacheable}
Expand Down Expand Up @@ -1834,7 +1841,7 @@ runs:
shell: bash
run: |
set -x
echo '7b3d80-${{ steps.full_matrix_vars.outputs.dkml_host_abi }}-${{ steps.full_matrix_vars.outputs.dkml_target_abi }}' > .ci/sd4/cachekey.opam.binaries
echo '7a34d1-${{ steps.full_matrix_vars.outputs.dkml_host_abi }}-${{ steps.full_matrix_vars.outputs.dkml_target_abi }}' > .ci/sd4/cachekey.opam.binaries
echo '${{ steps.full_matrix_vars.outputs.abi_pattern }}-${{ steps.full_matrix_vars.outputs.vsstudio_arch }}-${{ steps.full_matrix_vars.outputs.vsstudio_hostarch }}-${{ steps.full_matrix_vars.outputs.vsstudio_dir }}-${{ steps.full_matrix_vars.outputs.vsstudio_vcvarsver }}-${{ steps.full_matrix_vars.outputs.vsstudio_winsdkver }}-${{ steps.full_matrix_vars.outputs.vsstudio_msvspreference }}-${{ steps.full_matrix_vars.outputs.vsstudio_cmakegenerator }}' > .ci/sd4/cachekey.vsstudio
echo '${{ inputs.OCAML_COMPILER }}-${{ inputs.DISKUV_OPAM_REPOSITORY }}-${{ inputs.DKML_COMPILER }}-${{ inputs.CONF_DKML_CROSS_TOOLCHAIN }}' > .ci/sd4/cachekey.ci.inputs
Expand Down
11 changes: 9 additions & 2 deletions test/gh-windows/pre/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,13 @@ runs:
SKIP_OPAM_MODIFICATIONS=${SKIP_OPAM_MODIFICATIONS:-false} # default is false
if [ "$SKIP_OPAM_MODIFICATIONS" = "false" ]; then
if [ -z "${dkml_target_abi:-}" ]; then
echo "dkml_target_abi environment variable is required unless SKIP_OPAM_MODIFICATIONS=true" >&2
exit 2
fi
fi
# shellcheck disable=SC2154
echo "
=============
Expand Down Expand Up @@ -567,7 +574,7 @@ runs:
Matrix
------
dkml_host_abi=$dkml_host_abi
dkml_target_abi=$dkml_target_abi
dkml_target_abi=${dkml_target_abi:-}
abi_pattern=$abi_pattern
opam_root=${opam_root}
opam_root_cacheable=${opam_root_cacheable}
Expand Down Expand Up @@ -2005,7 +2012,7 @@ runs:
shell: bash
run: |
set -x
echo '7b3d80-${{ steps.full_matrix_vars.outputs.dkml_host_abi }}-${{ steps.full_matrix_vars.outputs.dkml_target_abi }}' > .ci/sd4/cachekey.opam.binaries
echo '7a34d1-${{ steps.full_matrix_vars.outputs.dkml_host_abi }}-${{ steps.full_matrix_vars.outputs.dkml_target_abi }}' > .ci/sd4/cachekey.opam.binaries
echo '${{ steps.full_matrix_vars.outputs.abi_pattern }}-${{ steps.full_matrix_vars.outputs.vsstudio_arch }}-${{ steps.full_matrix_vars.outputs.vsstudio_hostarch }}-${{ steps.full_matrix_vars.outputs.vsstudio_dir }}-${{ steps.full_matrix_vars.outputs.vsstudio_vcvarsver }}-${{ steps.full_matrix_vars.outputs.vsstudio_winsdkver }}-${{ steps.full_matrix_vars.outputs.vsstudio_msvspreference }}-${{ steps.full_matrix_vars.outputs.vsstudio_cmakegenerator }}' > .ci/sd4/cachekey.vsstudio
echo '${{ inputs.OCAML_COMPILER }}-${{ inputs.DISKUV_OPAM_REPOSITORY }}-${{ inputs.DKML_COMPILER }}-${{ inputs.CONF_DKML_CROSS_TOOLCHAIN }}' > .ci/sd4/cachekey.ci.inputs
Expand Down
27 changes: 24 additions & 3 deletions test/gl/setup-dkml.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,13 @@ variables:
SKIP_OPAM_MODIFICATIONS=${SKIP_OPAM_MODIFICATIONS:-false} # default is false
if [ "$SKIP_OPAM_MODIFICATIONS" = "false" ]; then
if [ -z "${dkml_target_abi:-}" ]; then
echo "dkml_target_abi environment variable is required unless SKIP_OPAM_MODIFICATIONS=true" >&2
exit 2
fi
fi
# shellcheck disable=SC2154
echo "
=============
Expand Down Expand Up @@ -818,7 +825,7 @@ variables:
Matrix
------
dkml_host_abi=$dkml_host_abi
dkml_target_abi=$dkml_target_abi
dkml_target_abi=${dkml_target_abi:-}
abi_pattern=$abi_pattern
opam_root=${opam_root}
opam_root_cacheable=${opam_root_cacheable}
Expand Down Expand Up @@ -2801,6 +2808,13 @@ variables:
SKIP_OPAM_MODIFICATIONS=${SKIP_OPAM_MODIFICATIONS:-false} # default is false
if [ "$SKIP_OPAM_MODIFICATIONS" = "false" ]; then
if [ -z "${dkml_target_abi:-}" ]; then
echo "dkml_target_abi environment variable is required unless SKIP_OPAM_MODIFICATIONS=true" >&2
exit 2
fi
fi
# shellcheck disable=SC2154
echo "
=============
Expand Down Expand Up @@ -2847,7 +2861,7 @@ variables:
Matrix
------
dkml_host_abi=$dkml_host_abi
dkml_target_abi=$dkml_target_abi
dkml_target_abi=${dkml_target_abi:-}
abi_pattern=$abi_pattern
opam_root=${opam_root}
opam_root_cacheable=${opam_root_cacheable}
Expand Down Expand Up @@ -4549,6 +4563,13 @@ variables:
SKIP_OPAM_MODIFICATIONS=${SKIP_OPAM_MODIFICATIONS:-false} # default is false
if [ "$SKIP_OPAM_MODIFICATIONS" = "false" ]; then
if [ -z "${dkml_target_abi:-}" ]; then
echo "dkml_target_abi environment variable is required unless SKIP_OPAM_MODIFICATIONS=true" >&2
exit 2
fi
fi
# shellcheck disable=SC2154
echo "
=============
Expand Down Expand Up @@ -4595,7 +4616,7 @@ variables:
Matrix
------
dkml_host_abi=$dkml_host_abi
dkml_target_abi=$dkml_target_abi
dkml_target_abi=${dkml_target_abi:-}
abi_pattern=$abi_pattern
opam_root=${opam_root}
opam_root_cacheable=${opam_root_cacheable}
Expand Down
9 changes: 8 additions & 1 deletion test/pc/setup-dkml-darwin_arm64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1259,6 +1259,13 @@ section_begin setup-info "Summary: setup-dkml"
SKIP_OPAM_MODIFICATIONS=${SKIP_OPAM_MODIFICATIONS:-false} # default is false
if [ "$SKIP_OPAM_MODIFICATIONS" = "false" ]; then
if [ -z "${dkml_target_abi:-}" ]; then
echo "dkml_target_abi environment variable is required unless SKIP_OPAM_MODIFICATIONS=true" >&2
exit 2
fi
fi
# shellcheck disable=SC2154
echo "
=============
Expand Down Expand Up @@ -1305,7 +1312,7 @@ GIT_LOCATION=${GIT_LOCATION:-}
Matrix
------
dkml_host_abi=$dkml_host_abi
dkml_target_abi=$dkml_target_abi
dkml_target_abi=${dkml_target_abi:-}
abi_pattern=$abi_pattern
opam_root=${opam_root}
opam_root_cacheable=${opam_root_cacheable}
Expand Down
9 changes: 8 additions & 1 deletion test/pc/setup-dkml-darwin_x86_64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1262,6 +1262,13 @@ section_begin setup-info "Summary: setup-dkml"
SKIP_OPAM_MODIFICATIONS=${SKIP_OPAM_MODIFICATIONS:-false} # default is false
if [ "$SKIP_OPAM_MODIFICATIONS" = "false" ]; then
if [ -z "${dkml_target_abi:-}" ]; then
echo "dkml_target_abi environment variable is required unless SKIP_OPAM_MODIFICATIONS=true" >&2
exit 2
fi
fi
# shellcheck disable=SC2154
echo "
=============
Expand Down Expand Up @@ -1308,7 +1315,7 @@ GIT_LOCATION=${GIT_LOCATION:-}
Matrix
------
dkml_host_abi=$dkml_host_abi
dkml_target_abi=$dkml_target_abi
dkml_target_abi=${dkml_target_abi:-}
abi_pattern=$abi_pattern
opam_root=${opam_root}
opam_root_cacheable=${opam_root_cacheable}
Expand Down
9 changes: 8 additions & 1 deletion test/pc/setup-dkml-linux_x86.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,13 @@ section_begin setup-info "Summary: setup-dkml"
SKIP_OPAM_MODIFICATIONS=${SKIP_OPAM_MODIFICATIONS:-false} # default is false
if [ "$SKIP_OPAM_MODIFICATIONS" = "false" ]; then
if [ -z "${dkml_target_abi:-}" ]; then
echo "dkml_target_abi environment variable is required unless SKIP_OPAM_MODIFICATIONS=true" >&2
exit 2
fi
fi
# shellcheck disable=SC2154
echo "
=============
Expand Down Expand Up @@ -1311,7 +1318,7 @@ GIT_LOCATION=${GIT_LOCATION:-}
Matrix
------
dkml_host_abi=$dkml_host_abi
dkml_target_abi=$dkml_target_abi
dkml_target_abi=${dkml_target_abi:-}
abi_pattern=$abi_pattern
opam_root=${opam_root}
opam_root_cacheable=${opam_root_cacheable}
Expand Down
9 changes: 8 additions & 1 deletion test/pc/setup-dkml-linux_x86_64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,13 @@ section_begin setup-info "Summary: setup-dkml"
SKIP_OPAM_MODIFICATIONS=${SKIP_OPAM_MODIFICATIONS:-false} # default is false
if [ "$SKIP_OPAM_MODIFICATIONS" = "false" ]; then
if [ -z "${dkml_target_abi:-}" ]; then
echo "dkml_target_abi environment variable is required unless SKIP_OPAM_MODIFICATIONS=true" >&2
exit 2
fi
fi
# shellcheck disable=SC2154
echo "
=============
Expand Down Expand Up @@ -1311,7 +1318,7 @@ GIT_LOCATION=${GIT_LOCATION:-}
Matrix
------
dkml_host_abi=$dkml_host_abi
dkml_target_abi=$dkml_target_abi
dkml_target_abi=${dkml_target_abi:-}
abi_pattern=$abi_pattern
opam_root=${opam_root}
opam_root_cacheable=${opam_root_cacheable}
Expand Down
9 changes: 8 additions & 1 deletion test/pc/setup-dkml-windows_x86.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1536,6 +1536,13 @@ section_begin setup-info "Summary: setup-dkml"
SKIP_OPAM_MODIFICATIONS=${SKIP_OPAM_MODIFICATIONS:-false} # default is false
if [ "$SKIP_OPAM_MODIFICATIONS" = "false" ]; then
if [ -z "${dkml_target_abi:-}" ]; then
echo "dkml_target_abi environment variable is required unless SKIP_OPAM_MODIFICATIONS=true" >&2
exit 2
fi
fi
# shellcheck disable=SC2154
echo "
=============
Expand Down Expand Up @@ -1582,7 +1589,7 @@ GIT_LOCATION=${GIT_LOCATION:-}
Matrix
------
dkml_host_abi=$dkml_host_abi
dkml_target_abi=$dkml_target_abi
dkml_target_abi=${dkml_target_abi:-}
abi_pattern=$abi_pattern
opam_root=${opam_root}
opam_root_cacheable=${opam_root_cacheable}
Expand Down
9 changes: 8 additions & 1 deletion test/pc/setup-dkml-windows_x86_64.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1536,6 +1536,13 @@ section_begin setup-info "Summary: setup-dkml"
SKIP_OPAM_MODIFICATIONS=${SKIP_OPAM_MODIFICATIONS:-false} # default is false
if [ "$SKIP_OPAM_MODIFICATIONS" = "false" ]; then
if [ -z "${dkml_target_abi:-}" ]; then
echo "dkml_target_abi environment variable is required unless SKIP_OPAM_MODIFICATIONS=true" >&2
exit 2
fi
fi
# shellcheck disable=SC2154
echo "
=============
Expand Down Expand Up @@ -1582,7 +1589,7 @@ GIT_LOCATION=${GIT_LOCATION:-}
Matrix
------
dkml_host_abi=$dkml_host_abi
dkml_target_abi=$dkml_target_abi
dkml_target_abi=${dkml_target_abi:-}
abi_pattern=$abi_pattern
opam_root=${opam_root}
opam_root_cacheable=${opam_root_cacheable}
Expand Down

0 comments on commit f254645

Please sign in to comment.