Skip to content

Conversation

@cknitt
Copy link
Member

@cknitt cknitt commented Oct 21, 2025

Reworked the Makefile to orchestrate the various builds so that:

  • Starting in a freshly checked out repo, a simple make is sufficient to run yarn, build the compiler, ninja, rewatch, copy those exes to the platform bin dir and build runtime/stdlib.
  • Dependencies are modeled correctly, so
    • no unnecessary builds are started
    • e.g., the standard library is rebuilt when the compiler or rewatch changed
    • "make test" depends on compiler, stdlib, etc. being up to date
  • rewatch is built in debug mode, not release mode (much faster)

This is a huge DX improvement and makes things much less confusing for our AI agents, too.

There is still more cleanup one could do regarding the clean and test targets, leaving that for future PRs.

process.env.CXXFLAGS = "-flto";
}
execSync(buildCommand, { stdio: [0, 1, 2], cwd: ninjaDir });
execSync("strip ninja", { stdio: [0, 1, 2], cwd: ninjaDir });
Copy link
Member Author

Choose a reason for hiding this comment

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

Not needed anymore, done by the Makefile / copyExes.js anyway.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Member

@nojaf nojaf left a comment

Choose a reason for hiding this comment

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

Haven't tested this, looks good from afar.
Is there any opportunity to use moar make in our ci.yml file?
Just curious.

make artifacts

# Format code
make format
Copy link
Member

Choose a reason for hiding this comment

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

Total nitpick, but how do we feel about make fmt? It is cargo fmt and dune fmt as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

But rescript format 🙂

@cknitt
Copy link
Member Author

cknitt commented Oct 21, 2025

Haven't tested this, looks good from afar. Is there any opportunity to use moar make in our ci.yml file? Just curious.

I would like to investigate that separately later. There are a few differences, like release vs. debug build and static build with musl libc for Linux.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 22, 2025

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript-lang/rescript@7975

@rescript/darwin-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-arm64@7975

@rescript/darwin-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-x64@7975

@rescript/linux-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-arm64@7975

@rescript/linux-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-x64@7975

@rescript/runtime

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/runtime@7975

@rescript/win32-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/win32-x64@7975

commit: 31f1c87

@cknitt
Copy link
Member Author

cknitt commented Oct 22, 2025

@codex review

@chatgpt-codex-connector
Copy link

To use Codex here, create a Codex account and connect to github.

@cknitt
Copy link
Member Author

cknitt commented Oct 22, 2025

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. You're on a roll.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@cknitt cknitt merged commit 6cfac38 into rescript-lang:master Oct 22, 2025
25 checks passed
@cknitt cknitt deleted the makefile branch October 22, 2025 08:26
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.

2 participants