Skip to content

Conversation

@DenuxPlays
Copy link

@DenuxPlays DenuxPlays commented Oct 13, 2025

closes: #2130

Adds support for FreeBSD cross compilation using cross.

This PR also adds the ability to cross compile with cross.

TODOs:

  • add tests
  • install cross
  • manual testing

@DenuxPlays
Copy link
Author

@mistydemeo

Hey,
I found some time implementing freebsd & cross support.
I've tested it locally and building works.

I would really like to add some automated tests can you tell me how to do that?
I would also like to know if I could test the github workflow locally somehow?

Also I found out during debugging that your debug profile is really bad for debugging.
Due to opt-level being 2 a lot of variables are getting inlined & removed so debugging using lldb gets kind of impossible.
Just wanted to say that for I know I commented out the custom debug profile override.

@DenuxPlays DenuxPlays marked this pull request as ready for review October 13, 2025 21:59
@mistydemeo
Copy link
Contributor

Wonderful, thank you!

We won't be able to do automated tests that actually produce the binaries, but we can test the CI and installer setup by adding more tests to the integration tests here. Maybe add freebsd as a platform to one of the existing tests and see if the diff from cargo test looks right? https://github.com/axodotdev/cargo-dist/blob/main/cargo-dist/tests/integration-tests.rs

If you'd like to do some manual testing, you can do something like my cargodisttest repo with a toy app you have set up to build for freebsd using a git branch as the source for fetching cargo-dist: https://github.com/mistydemeo/cargodisttest

Let me know if you need help with any of that.

@DenuxPlays DenuxPlays force-pushed the feature/freebsd-support branch from 26c69c6 to cac09ca Compare October 22, 2025 05:37
@DenuxPlays
Copy link
Author

I have another question.

Was it correct to start from main or should I have started my work from the stable branch?

@DenuxPlays
Copy link
Author

I also could not test the release.

I've created cargodisttest repo and tried to use my version of dist but I get this error:
https://github.com/DenuxPlays/cargodisttest/actions/runs/18706582046/job/53345700511

Maybe you can help me figure this out?

@mistydemeo
Copy link
Contributor

I'm very sorry for the late reply!

Taking a look at your build, it looks like the problem is that the changes you've made to your local generated config for testing aren't reflected in the code in this branch.

When dist runs, it checks to see that your generated CI config is identical to what dist would generate. In this case, you've hand-edited the CI config to pull down your build of dist, but you haven't changed the template in your branch to have those same changes.

You can use the allow-dirty setting to disable this check. https://axodotdev.github.io/cargo-dist/book/ci/customizing.html#hand-editing-releaseyml Keep in mind that does mean that if you make any new changes to the template as a part of this branch, you'll have to remember to make those changes in your CI config. Alternately, you can update the template in your branch here to point at your repo temporarily while you're testing and only back that out when we're ready to merge.

Again, I'm sorry for the inconvenience. :/ I know these aren't super great answers. I'll also take a look at our from-git dev config and see about setting up a way to make it possible to configure a different remote for the repo instead of hardcoding axodotdev.

@DenuxPlays
Copy link
Author

Hey,

all good thanks for the reply.
I tried it now i get a different error but I think I caused that.
Gonna take a look at it soon

@DenuxPlays
Copy link
Author

Hey,
this has to wait a bit sorry :/

I am currently fully invested in preparing for the spring boot 4 migration.

If you want you can a look at the error I meant:
https://github.com/DenuxPlays/cargodisttest/actions/runs/18866003066/job/53833673844

We plan to finish the migration in novemeber so I'll have time again at the end of november.

@mistydemeo
Copy link
Contributor

Hm, I think you might have just forgotten to bump the version in your Cargo.toml! It looks like the tag you pushed is 0.2.1, but the program itself doesn't have version 0.2.1. cargo-dist validates that the version you're trying to release actually exists in the Cargo package.

@mistydemeo
Copy link
Contributor

And no worries - please take your time! I appreciate you taking the time to work on this.

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.

Add support for x86_64-unknown-freebsd

2 participants