Skip to content

Commit 8068345

Browse files
committed
Restore "make build" as default target, use .yarn/install-state.gz as stamp
1 parent 0c6f48a commit 8068345

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

AGENTS.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ This file provides guidance to AI coding assistants when working with code in th
55
## Quick Start: Essential Commands
66

77
```bash
8-
# Build the platform toolchain + stdlib (default target)
8+
# Build the platform toolchain (default target)
99
make
1010

11+
# Build the platform toolchain + stdlib
12+
make lib
13+
1114
# Build the platform toolchain + stdlib and run tests
1215
make test
1316

CONTRIBUTING.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,16 @@ You can also open this dev container with [GitHub Codespaces](https://github.com
7373

7474
To build the compiler, the build tools (rewatch and ninja), and the ReScript runtime/standard library, just run:
7575

76+
Main targets:
77+
7678
```sh
79+
# Build the compiler and the build tools (rewatch and ninja)
7780
make
78-
```
7981

80-
To run tests, execute:
82+
# Build the runtime/standard library
83+
make lib
8184

82-
```sh
85+
# Run the tests
8386
make test
8487
```
8588

Makefile

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,19 @@ DUNE_BIN_DIR = ./_build/install/default/bin
4545

4646
# Build stamps
4747

48-
YARN_INSTALL_STAMP := node_modules/.yarn.stamp
49-
COMPILER_BUILD_STAMP := _build/.compiler.stamp
48+
# Yarn creates `.yarn/install-state.gz` whenever dependencies are installed.
49+
# Using that file as our stamp ensures manual `yarn install` runs are detected.
50+
YARN_INSTALL_STAMP := .yarn/install-state.gz
51+
# Dune updates `_build/log` for every build invocation, even when run manually.
52+
# Treat that log file as the compiler build stamp so manual `dune build`
53+
# keeps Make targets up to date.
54+
COMPILER_BUILD_STAMP := _build/log
5055
RUNTIME_BUILD_STAMP := _build/.runtime.stamp
5156

57+
# Default target
58+
59+
build: compiler rewatch ninja
60+
5261
# Yarn
5362

5463
WORKSPACE_PACKAGE_JSONS := $(shell find packages -path '*/lib' -prune -o -name package.json -print)
@@ -58,7 +67,6 @@ yarn-install: $(YARN_INSTALL_STAMP)
5867

5968
$(YARN_INSTALL_STAMP): $(YARN_INSTALL_SOURCES)
6069
yarn install
61-
@mkdir -p $(dir $@)
6270
touch $@
6371

6472
# Ninja
@@ -133,7 +141,6 @@ lib: $(RUNTIME_BUILD_STAMP)
133141

134142
$(RUNTIME_BUILD_STAMP): $(RUNTIME_SOURCES) $(COMPILER_EXES) $(RESCRIPT_EXE) | $(YARN_INSTALL_STAMP)
135143
yarn workspace @rescript/runtime build
136-
@mkdir -p $(dir $@)
137144
touch $@
138145

139146
clean-lib:
@@ -167,7 +174,7 @@ test-gentype: | $(YARN_INSTALL_STAMP)
167174
make -C tests/gentype_tests/typescript-react-example clean test
168175
make -C tests/gentype_tests/stdlib-no-shims clean test
169176

170-
test-rewatch: | $(YARN_INSTALL_STAMP)
177+
test-rewatch: $(RESCRIPT_EXE) | $(YARN_INSTALL_STAMP)
171178
./rewatch/tests/suite-ci.sh
172179

173180
test-all: test test-gentype test-analysis test-tools test-rewatch
@@ -204,6 +211,6 @@ clean: clean-lib clean-compiler clean-rewatch clean-ninja
204211
dev-container:
205212
docker build -t rescript-dev-container docker
206213

207-
.DEFAULT_GOAL := lib
214+
.DEFAULT_GOAL := build
208215

209-
.PHONY: yarn-install ninja rewatch compiler lib artifacts bench test test-analysis test-tools test-syntax test-syntax-roundtrip test-gentype test-rewatch test-all playground playground-cmijs playground-release format checkformat clean-ninja clean-rewatch clean-compiler clean-lib clean-gentype clean-tests clean dev-container
216+
.PHONY: yarn-install build ninja rewatch compiler lib artifacts bench test test-analysis test-tools test-syntax test-syntax-roundtrip test-gentype test-rewatch test-all playground playground-cmijs playground-release format checkformat clean-ninja clean-rewatch clean-compiler clean-lib clean-gentype clean-tests clean dev-container

0 commit comments

Comments
 (0)