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

Versioning of ctru-sys crate #100

Open
ian-h-chamberlain opened this issue Mar 17, 2023 · 2 comments
Open

Versioning of ctru-sys crate #100

ian-h-chamberlain opened this issue Mar 17, 2023 · 2 comments

Comments

@ian-h-chamberlain
Copy link
Member

ian-h-chamberlain commented Mar 17, 2023

Pick initial numbers for each crate and coordinate publishing a release!

In my opinion, ctru-rscan release with a generic version number (like 1.0or 0.5), and the same can be said for pthread-3dsand linker-fix-3ds. However, I would like to underline the importance of ctru-sys's version number, since we could release it with the same version number of libctru (which would double down as a "supported version" number). We'd need to be careful about doc generation though, since we wouldn't be able to easily make a patch release.

Originally posted by @Meziu in #97 (comment)


This is an interesting idea I hadn't considered before! For inspiration I thought I'd look at some other sys crates, and I found this which looks kinda interesting: https://gitlab.com/taricorp/llvm-sys.rs#llvm-compatibility

Basically, we could have a ctru-sys version 21.2.x for the current release, and bump the minor version whenever we regenerate bindings for a new patch of libctru. This would also allow us to make docgen improvements, etc. as a patch version on the crate instead.

In the case of llvm-sys, they have some checks in place to verify library versions at build time. It might be harder to do that with libctru, since it's just a static library, but I was thinking there might be some ways to check it with dkp-pacman / pacman, and spit out a build warning if the versions mismatch, which would be displayed if the build failed (link errors etc).

Opening this issue to track + discuss the possibilities.

@Meziu
Copy link
Member

Meziu commented Mar 17, 2023

Nice research! I really like the idea of the version number being related (we could specify this to the user in the README). I'm not an expert on GitHub CI, so I don't know the actual limitations, but retrieving libctru's version number should be as easy as:
sudo dkp-pacman -Si libctru | grep "Version\s*:\s\K.*" -o

@ian-h-chamberlain
Copy link
Member Author

As mentioned in #133 (comment) it sounds like we will probably move to a different versioning scheme than we had before, since that PR is now generating bindings on the fly instead of checking them into the repo. With those changes, I guess we can reset the ctru-sys version (maybe to 0.2.0?) and require a minimum libctru version somewhere in its build script.

I guess in principle, ctru depends on the libctru version more than ctru-sys does, so perhaps it makes more sense to have the minimum libctru version check in ctru? Otherwise, we'd probably have a kind of indirect relationship from ctru -> ctru-sys -> libctru, which maybe is fine but perhaps a direct relationship would be better.

On a semi-related note, I was debating whether it might be worth it to wrap up the bindgen stuff that @FenrirWolf did into a separate crate so we could reuse it for citro3d-sys (and possibly citro2d in the future)? I have been thinking about creating a common tools type of repo to put common stuff in, like reusable Github Actions, and maybe something like this would make sense to put in there too. The downside of an extra crate would be yet another package to put on https://crates.io which is kind of a pain and maybe not worth it. Thoughts?

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

No branches or pull requests

2 participants