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

Build IDL Anchor 0.30 #48

Merged
merged 17 commits into from
Jun 19, 2024
23 changes: 14 additions & 9 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-audit
- run: cargo audit --ignore RUSTSEC-2022-0093 --ignore RUSTSEC-2023-0065 --ignore RUSTSEC-2024-0336
- run: cargo audit --ignore RUSTSEC-2022-0093 --ignore RUSTSEC-2023-0065 --ignore RUSTSEC-2024-0336 --ignore RUSTSEC-2024-0344

lint:
name: lint
Expand Down Expand Up @@ -81,9 +81,9 @@ jobs:
run: echo "/home/runner/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH

# build the program and IDL; exit if error
- run: anchor build --no-idl
# - name: Check for diff on IDL
# run: git diff --exit-code
- run: anchor build --idl idl
- name: Check for diff on IDL
run: git diff --exit-code

# run verified build
- run: solana-verify build --library-name validator_history
Expand All @@ -100,11 +100,16 @@ jobs:
with:
name: jito_steward.so
path: target/deploy/jito_steward.so
# - name: Upload IDL
# uses: actions/upload-artifact@v4
# with:
# name: validator_history.json
# path: programs/validator-history/idl/validator_history.json
- name: Upload Validator History IDL
uses: actions/upload-artifact@v4
with:
name: validator_history.json
path: programs/validator-history/idl/validator_history.json
- name: Upload Jito Steward IDL
uses: actions/upload-artifact@v4
with:
name: jito_steward.json
path: programs/steward/idl/jito_steward.json

# tests run on verified build
test:
Expand Down
70 changes: 65 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions programs/steward/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ no-log-ix-name = []
cpi = ["no-entrypoint"]
default = ["custom-heap"]
custom-heap = []
# idl-build = ["anchor-lang/idl-build"]
idl-build = ["anchor-lang/idl-build", "no-entrypoint"]

[dependencies]
anchor-lang = "0.30.0"
anchor-lang = { features = ["idl-build"], version = "0.30.0" }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I was just passing by and saw you've enabled the idl-build feature for the default target. This should be avoided, as the IDL generation process is a separate build process that doesn't use Solana's build tools.

This seems harmless now other than adding a bit of unnecessary compilation, but it could very well break the compilation of your program in the future. For this reason, I added warnings for this usage in coral-xyz/anchor#3061.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@acheroncrypto thanks for the input, will make the change!

bincode = "1.3.3"
blake3 = "1.3.1"
borsh = "0.10.0"
Expand Down
Loading
Loading