Skip to content

Conversation

@Karrq
Copy link
Contributor

@Karrq Karrq commented Apr 20, 2025

Hello! I'm a mac user and wanted to make use of your derivations to manage my solana install.
Unfortunately, it seemed like there was no support for mac at the time, but looking at the forks it seems like @0xPlish was working on a multi-system derivation, also making use of flakes.

For me it @0xPlish's work wasn't building properly, in my case crossbeam-epoch (for solana-cli) wasn't able to build due to no_atomic.rs being a symlink to a file outside the crate root (in the repo root), thus the source wasn't available for buildRustPackage.
I tried multiple ways to override the dependendy but couldn't figure it out, so in the end I switched to crane which handled the build out of the box.

Then I had an issue with anchor-cli, where the unpatched sources were used to build the dependencies of the binary (as part of a caching step, due to crane's build methodology) and thus the resulting binary had erroneous behaviour.

I also excluded the stripping of rlib files since rustc was unable to compile libcore (among others) without those.

Finally, I expanded the systemMapping in solana-platform-tools to also hold the output hashes.

@0xPlish
Copy link
Contributor

0xPlish commented Apr 20, 2025

Amazing @Karrq looking forward to trying your version. I didn't quite get my branch working.

Karrq added 4 commits April 25, 2025 16:43
deps(platform-tools): partial 1.43 support
fix(anchor): avoid calling +nightly on bundled cargo
fix(flake): don't package anchor 0.30.1 directly
fix(anchor): 0.30.1 full patch
feat: passthru.otherVersions
Copy link
Owner

@arijoon arijoon left a comment

Choose a reason for hiding this comment

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

Thanks @Karrq for the PR and the work. This is a clear improvement to support multi systems and allow flake access so its easier to get started with a single command

Unfortunately I don't really have the expertise to maintain this due to unfamiliarity with crane and not having access to a Mac system to know if it'll break at a future point in time

If you'd like to maintain this as a fork, I'd be happy to link to your fork in the README file as superseding this repo for mac/multi system instead of just x86 linux.
Alternatively we'll need to setup some ci/github actions to make sure it'll remain functional across all systems

pkgs.nix Outdated
Comment on lines 12 to 13
solana-platform-tools =
self.callPackage (import ./solana-platform-tools.nix) {};
Copy link
Owner

Choose a reason for hiding this comment

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

in flake.nix, there's a custom crane override for these. Is that not needed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

crane is just a way for nix to orchestrate the build for rust crates, but in this case platform-tools is just a set of binaries as we don't built them from source in the derivation, hence why it's not needed.

@Karrq
Copy link
Contributor Author

Karrq commented Apr 28, 2025

Alternatively we'll need to setup some ci/github actions to make sure it'll remain functional across all systems

I'll investigate this, I agree that would be ideal, and also allow the project to ensure it works in other platforms without having to test it manually

@Karrq
Copy link
Contributor Author

Karrq commented Apr 28, 2025

Alright, I formatted the codebase with the rfc formatter, unified all inputs (to be managed by flakes), made sure that the current interface (shell, pkgs) is supported, and added a CI workflow that should check that the tools at least build properly.

I think to actually see the workflow running I'd need to add it to main, as I can't even run it as "workflow dispatch" on this branch. If you want I could open a separate PR with CI for the existing methodology, so this PR would also update that workflow

@Karrq Karrq requested a review from arijoon April 28, 2025 18:42
Copy link
Owner

@arijoon arijoon left a comment

Choose a reason for hiding this comment

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

Thanks we can merge to master and see it in action, its mainly for the future updates to make sure other systems don't break. Just need to change the workflows to run on master instead of main

@Karrq
Copy link
Contributor Author

Karrq commented May 2, 2025

Ok, I will keep an eye out and make a followup PR with eventual fixes if necessary.
Fixed the branch name 🙈

@arijoon arijoon merged commit f140bf7 into arijoon:master May 3, 2025
@arijoon
Copy link
Owner

arijoon commented May 3, 2025

Unfortunately the current system does not work due to this solana-foundation/anchor#3663

@arijoon
Copy link
Owner

arijoon commented May 3, 2025

I've tried to address it here: 4746896

I managed to get a working build on Linux, given the toolchain hasn't changed, I'm hoping it works on mac too, but I couldn't find a way without giving anchor the nightly build. Really wish rust projects would stop depending on unstable features, this seems like an abuse of nightly channel when its meant to try new features, not include them in stable software

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants