Skip to content

Replace Makefile with Justfile#16199

Open
s5bug wants to merge 2 commits into
Qiskit:mainfrom
s5bug:justfile
Open

Replace Makefile with Justfile#16199
s5bug wants to merge 2 commits into
Qiskit:mainfrom
s5bug:justfile

Conversation

@s5bug
Copy link
Copy Markdown

@s5bug s5bug commented May 16, 2026

I originally just ported just c because it's very hard to find a GNU Make for Windows, but I figured why not go the whole way and make a PR. No expectation for this to be merged, but since I went through the effort, I'll at least share 😄

The new Makefile forwards to Just. On my AArch64 Linux machine, fish completions properly detect the Just rules in tab completion from make <TAB>. make with no arguments remains forwarding to just default.

I felt Just was appropriate:

  • the original Makefile is not making use of any dependency calculation features (i.e. every rule is marked as PHONY)
  • just is as easy to install on the big 3 (Windows, Mac, Linux) as make is on Linuxes

I've tested just c on amd64 Windows and AArch64 Linux, and just ctest on amd64 Windows. I don't have Conda on either machine so at the moment I haven't tested just env.

AI/LLM disclosure

  • I didn't use LLM tooling, or only used it privately.
  • I used the following tool to help write this PR description:
  • I used the following tool to generate or modify code:

@s5bug s5bug requested a review from a team as a code owner May 16, 2026 23:21
@s5bug s5bug requested a review from raynelfss May 16, 2026 23:21
@qiskit-bot qiskit-bot added the Community PR PRs from contributors that are not 'members' of the Qiskit repo label May 16, 2026
@qiskit-bot
Copy link
Copy Markdown
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core

@jakelishman
Copy link
Copy Markdown
Member

Thanks for this, and the interest in the project!

Honestly, my tendency is against swapping away from Make here. I do think just is better suited for our uses and I don't particularly like make, but it's a completely standard tool, whereas just is still very early and pretty niche, so it adds an awkward barrier to entry. Even knowing that the tool exists is a barrier that make doesn't have, but also, GNU make is not uncommonly pre-installed in the base images of Linux distros. We're pretty conservative about introducing new required tooling on Qiskit, and I worry about just.

For Windows: yeah, it's not great, but GNU Make is available via choco install make, which is about as good as we can hope for on Windows. Honestly, we don't optimise for the C development experience on Windows - it's so different, and very few core contributors use it heavily (most Windows users use WSL for that).


Btw, I'd be totally open to PRs that allow POSIX Make instead of GNU Make so it's a little easier by default on macOS / BSDs, but I don't think that'd be easy, and I think GNU Make is standard enough we've not put in a huge amount of effort to mitigate it.

@s5bug
Copy link
Copy Markdown
Author

s5bug commented May 18, 2026

Re maturity of Just: that's pretty much how I feel as well 🙇 Especially while working on this I felt user-defined functions could be appropriate for mkdir -p, rm -rf, etc. but those are an "unstable" language feature of Just, and needing to enable unstable features manually quite surprised me!

The Make available on WinGet (from GnuWin32) to my knowledge is 2 decades old, and I'm not sure how it interacts with not having SH on the system.

Regarding the C development experience, my main goal was simply being able to include qiskit-rs in a project built for Windows. Qiskit/qiskit-rs@6bc2005 fixes that particular issue but it's not in main. (I'm seeing what I can do to make some forward progress on Qiskit/qiskit-rs#16 again now that 2.4 is out and there's no longer the hard dependency on Python that was being a blocker; I was actually getting linking issues on Windows but I think that's my fault and not Qiskit's and I have to spend some time to figure that out.)

I'm not actually sure what parts of the current Makefile are non-POSIX. I'd have to go through and check.

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

Labels

Community PR PRs from contributors that are not 'members' of the Qiskit repo

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants