solana-developers / program-examples

A repository of Solana program examples
807 stars 303 forks source link

Add tokens/pda-mint-authority/steel #189

Open Perelyn-sama opened 1 month ago

heyAyushh commented 1 week ago

to fix the CI Issues @Perelyn-sama,

1. checkout to main branch
2. change directory to root folder `/program-examples/`
3. `git pull` 
4. pnpm install
5. checkout to your branch
6. merge main branch
7. pnpm fix
Perelyn-sama commented 1 week ago

Hey @heyAyushh so I think Steel / Rust Checks fails because solana can't be found.

I use a build script here - https://github.com/Perelyn-sama/program-examples/blob/pda-mint-authority/tokens/pda-mint-authority/steel/program/build.rs to get the .so file of the metadata program, so I can I use it in ProgramTest.

Is there something you can do on the gh actions side to make this work? or should I just add the metadata_program.so to the repo?

I'll also add this check in the build script:

    // Check if Solana is installed
    if let Err(err) = check_solana_installation() {
        println!("cargo:warning=Solana check failed: {}", err);
        return;
    }

to make sure my assumption is right.

I tried reproducing this error with act but it passed locally :(

Perelyn-sama commented 1 week ago

pasting the error here before my next commit resets it all

      Checking mpl-token-metadata v4.1.2
  error: failed to run custom build command for `pda-mint-authority-program v0.1.0 (/home/runner/work/program-examples/program-examples/tokens/pda-mint-authority/steel/program)`

  Caused by:
    process didn't exit successfully: `/home/runner/work/program-examples/program-examples/tokens/pda-mint-authority/steel/target/debug/build/pda-mint-authority-program-a1ef98f611132165/build-script-build` (exit status: 101)
    --- stdout
    cargo:rerun-if-changed=build.rs

    --- stderr
    thread 'main' panicked at program/build.rs:19:10:
    Failed to run solana program dump command: Os { code: 2, kind: NotFound, message: "No such file or directory" }
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
  warning: build failed, waiting for other jobs to finish...
  Error: Process completed with exit code 101.