---
schema_version: "1"
id: ccd3f1978dcbf93ef99cc5a1a10f3471a04b18afb2d83570cecbddad347dcb4c
title: Compiling Custom Policies
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/pdk/1.9/policies-pdk-compile-policies.md
canonical_url: https://docs.mulesoft.com/pdk/1.9/policies-pdk-compile-policies
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 69a64163325db61adfaca8584ff8f8c8d01172ff14129778ec940c1e3a4d3091
description: MuleSoft Documentation Site
release: "1.9"
latest: false
---
---
product: Omni Gateway Policy Development Kit (PDK)
version: 1.9
---

# Compiling Custom Policies

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Compile your custom policy to create the policies binary target files by using the `make build`
command. You must compile your custom policy after every time you edit the policy’s source code
before you can deploy the policy to an Omni Gateway.

## Before You Begin

Ensure you have completed all the steps in
[Creating a Unified-Model (Regular) Policy Project](https://docs.mulesoft.com/pdk/1.9/policies-pdk-create-project).

## Compile Using Build Command

To compile the policy, run the `make build` command from the policy’s root folder:

```ssh
make build
```

The `make build` command preforms the following actions:

1.  Runs the `make build-asset-files` script

2.  Runs the `make build` command to compile the policy to a `WebAssembly` binary file

3.  Generates additional configuration files that are not generated by the `make build-asset-files`
    script and are required to execute the policy

The `make build` command outputs the generated files to the `target` directories.

You can execute the `make build` command as many times as necessary to generate compiled artifacts.
You must compile the custom policy for your source code and configuration edits to be present in the
compiled artifacts.

> [!NOTE] When compiling your policy the first time, Rust fetches the latest version dependencies.
> If a dependency requires a Rust version later than {rust-ver-max-var}, pin the latest compatible
> version of the dependency with this command:
>
> cargo update -p <conflicting\_crate> --precise <major.minor.patch>

## See Also

- [Testing and Debugging Custom Policies](https://docs.mulesoft.com/pdk/1.9/policies-pdk-test-debug-overview)

- [Applying Custom Policies](https://docs.mulesoft.com/pdk/1.9/policies-pdk-apply-policies)

- [PDK Troubleshooting](https://docs.mulesoft.com/pdk/1.9/policies-pdk-troubleshooting)
