-
Notifications
You must be signed in to change notification settings - Fork 25
Specify artifact dependencies #202
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
Conversation
a61ed80 to
d100f03
Compare
jfly
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tried a fresh checkout of this PR and tried a random command, got a warning. Is this concerning?
$ make ./dist/lib/@cubing/icons/cubing-icons.css
bun run script/build-lib-js.ts
▲ [WARNING] Cannot find base config file "./node_modules/@cubing/dev-config/ts/es2022-types/tsconfig.json" [tsconfig.json]
tsconfig.json:2:13:
2 │ "extends": "./node_modules/@cubing/dev-config/ts/es2022-types/tsconfig.json",
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The library has been built at: ./dist/lib/@cubing/icons
| ./dist/lib/@cubing/icons/cubing-icons.css: ./.temp/lib/cubing-icons.css | ||
| ./dist/lib/@cubing/icons/cubing-icons.woff2: ./.temp/lib/cubing-icons.woff2 | ||
| ./dist/lib/@cubing/icons/js/index.js: ./src/js/*.ts ./.temp/lib/cubing-icons.ts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think I understand these rules. Does creating the /.temp directory also create the stuff under ./dist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bun run script/build-lib-js.ts creates all of them, per #201
In case something goes wrong with the build process, the tree in this Makefile provides an approximation to the semantic dependencies that should cause enough steps to run.
This still keeps `build-web` and the linting targets as `.PHONY` commands for simplicity and safety. The dependencies are very fragile, and require significant discipline to maintain. Just to give one example: `./dist/lib/@cubing/icons/js/index.d.ts` depends on `./src/js/index.ts` instead of `./src/js/*.ts` or `./src/js/**/*.ts` because the latter are not portable. This means that if a new source file is added under `./src/js` it must be added manually. But it would also be easy to miss adding this file, because some development flows would be unaffected. | Command | Before | After | | ------------------------------------- | ------------------- | ------------------- | | `hyperfile "make build-lib-js"` | 340.9 ms ± 45.3 ms | 19.9 ms ± 1.2 ms | | `hyperfile "make lint"` | 2.414 s ± 0.064 s | 1.804 s ± 0.081 s | | `hyperfile "make clean build-lib-js"` | 373.9 ms ± 69.6 ms | 324.1 ms ± 10.7 ms | | `hyperfile "make clean lint"` | 2.393 s ± 0.033 s | 2.402 s ± 0.037 s |
`setup` is `.PHONY`, but it's needed to run the build script.
d100f03 to
eb7fa73
Compare
Ah, I had to avoid putting We could test for this in CI by running |
…ugh testing. `bun` is fast enough for this, given 1) `bun`'s local caching, and 2) we don't use a dependency with heavy setup (e.g. post-install scripts).
Never mind, this is a bit too slow. |
81dfa96 to
b9e3f0f
Compare
|
@lgarron, what's the state of the PR? Are you still experimenting, or do you want eyes on it? |
Eh, I don't really like it. I wish specifying proper dependencies was more of a solved problem, but it's just not. In practice, this only saves up to a second of building, at the expense of making everything more fragile. :-/ I think I'd rather not land it, unless at some point the perf annoys us enough. |
|
Looks like it also breaks https://github.com/lgarron/mak , which I'm sure I could fix but is just one more strike against this for me. |
I have no concerns about the performance. Feel free to close this out. |
This still keeps
build-weband the linting targets as.PHONYcommands for simplicity and safety.The dependencies are very fragile, and require significant discipline to maintain. Just to give one example:
./dist/lib/@cubing/icons/js/index.d.tsdepends on./src/js/index.tsinstead of./src/js/*.tsor./src/js/**/*.tsbecause the latter are not portable. This means that if a new source file is added under./src/jsit must be added manually. But it would also be easy to miss adding this file, because some development flows would be unaffected.hyperfine "make build-lib-js"hyperfine "make lint"hyperfine "make clean build-lib-js"hyperfine "make clean lint"