From e4e104e792019a2b5481f0ab58700e14881c0a2d Mon Sep 17 00:00:00 2001 From: acheron Date: Thu, 7 Dec 2023 13:09:22 +0100 Subject: [PATCH 1/3] Add checks to decide which SDK crate to use --- programs/address-lookup-table/src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/programs/address-lookup-table/src/lib.rs b/programs/address-lookup-table/src/lib.rs index 11d9b4b0dd34e4..200d69965d8dfd 100644 --- a/programs/address-lookup-table/src/lib.rs +++ b/programs/address-lookup-table/src/lib.rs @@ -4,6 +4,7 @@ pub mod processor; +#[cfg(not(target_os = "solana"))] #[deprecated( since = "1.17.0", note = "Please use `solana_sdk::address_lookup_table` instead" @@ -13,3 +14,14 @@ pub use solana_sdk::address_lookup_table::{ program::{check_id, id, ID}, state, }; + +#[cfg(target_os = "solana")] +#[deprecated( + since = "1.17.0", + note = "Please use `solana_program::address_lookup_table` instead" +)] +pub use solana_program::address_lookup_table::{ + error, instruction, + program::{check_id, id, ID}, + state, +}; From 58ad14441f9988cdd5779c596f83324b07ec4401 Mon Sep 17 00:00:00 2001 From: acheron Date: Thu, 7 Dec 2023 13:16:53 +0100 Subject: [PATCH 2/3] Make module only available in non-program environments --- programs/address-lookup-table/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/programs/address-lookup-table/src/lib.rs b/programs/address-lookup-table/src/lib.rs index 200d69965d8dfd..1868b5958b3a04 100644 --- a/programs/address-lookup-table/src/lib.rs +++ b/programs/address-lookup-table/src/lib.rs @@ -2,6 +2,7 @@ #![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(specialization))] #![cfg_attr(RUSTC_NEEDS_PROC_MACRO_HYGIENE, feature(proc_macro_hygiene))] +#[cfg(not(target_os = "solana"))] pub mod processor; #[cfg(not(target_os = "solana"))] From 2bce424490fcbdb4bfcd24ecd13ac3675de3422d Mon Sep 17 00:00:00 2001 From: acheron Date: Thu, 7 Dec 2023 13:59:54 +0100 Subject: [PATCH 3/3] Remove `solana-sdk` export and only export from `solana-program` --- programs/address-lookup-table/src/lib.rs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/programs/address-lookup-table/src/lib.rs b/programs/address-lookup-table/src/lib.rs index 1868b5958b3a04..737ec32c8f6782 100644 --- a/programs/address-lookup-table/src/lib.rs +++ b/programs/address-lookup-table/src/lib.rs @@ -5,18 +5,6 @@ #[cfg(not(target_os = "solana"))] pub mod processor; -#[cfg(not(target_os = "solana"))] -#[deprecated( - since = "1.17.0", - note = "Please use `solana_sdk::address_lookup_table` instead" -)] -pub use solana_sdk::address_lookup_table::{ - error, instruction, - program::{check_id, id, ID}, - state, -}; - -#[cfg(target_os = "solana")] #[deprecated( since = "1.17.0", note = "Please use `solana_program::address_lookup_table` instead"