Skip to content

Commit 04cd122

Browse files
committed
Tup refactor - downstream changes (ci, docs)
ci/build/dev.sh: docs/a.md: docs/book/src/installation.md: docs/tests.md: justfile: nix/shells/armShell.nix: non-nix-build/env.sh: src/db-backend/editor-config/emacs/init.el: tup-build-staging-status.md: wdio.conf.js: Signed-off-by: Tzanko Matev <[email protected]>
1 parent 3c4888a commit 04cd122

File tree

10 files changed

+37
-35
lines changed

10 files changed

+37
-35
lines changed

ci/build/dev.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,8 @@ echo '##########################################################################
1515
# stop processes: make sure none of those processes left from last build
1616
stop_processes
1717

18-
git clean -xfd src/build-debug
19-
20-
mv src/links links
21-
git clean -xfd src/
22-
mv links src/links
18+
git clean -fdx src/build
19+
git clean -fdx src/build-debug/build
2320

2421
echo '###############################################################################'
2522
echo "Build:"
@@ -35,9 +32,12 @@ tup generate --config build-debug/tup.config "$TUP_OUTPUT_SCRIPT"
3532
./"$TUP_OUTPUT_SCRIPT"
3633
rm "$TUP_OUTPUT_SCRIPT"
3734

38-
# TODO: this is not really working, problems with variants: generated script produce
39-
# files directly in src/, instead of in src/build-debug, and so it can't run well
40-
# we need to see if we can generate it in a better way, or to wrap/restructure the resulting folders
41-
# to make possible to test the dev build in CI
35+
# Running the generated script populates the staging tree; clean it so that
36+
# subsequent `tup` invocations (locally or in CI) can start from a fresh slate.
37+
git clean -fx .
38+
39+
popd
4240

41+
pushd src/build-debug
42+
git clean -fx .
4343
popd

docs/a.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
### Local
99

1010
I sometimes do
11-
`set -gx PATH /home/al/codetracer/src/build-debug $PATH`
11+
`set -gx PATH /home/al/codetracer/src/build-debug/build $PATH`
1212
to get many codetracer-related binaries in my path: `codetracer`, `tester` and maybe others
1313

1414
# Fix preloading
@@ -83,4 +83,3 @@ to get many codetracer-related binaries in my path: `codetracer`, `tester` and m
8383

8484

8585

86-

docs/book/src/installation.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,12 @@ Direnv should be set up in your shell, as shown [here](https://direnv.net/docs/h
6262
```
6363
4. Run `nix develop`
6464
5. Run `direnv allow`
65-
6. To build codetracer simply run `just build`. The location of the resulting binary will be `./src/build-debug/bin/ct`
65+
6. To build codetracer simply run `just build`. The location of the resulting binary will be `./src/build-debug/build/bin/ct`
6666
7. Now every time you enter the `codetracer` directory your environment should be updated
6767

68+
> [!NOTE]
69+
> When you need to use `tup generate`, remember that the generated script writes into the staging tree. After it finishes, run `cd src/build && git clean -fx .` followed by `cd ../build-debug && git clean -fx .` before invoking `tup` again.
70+
6871
> [!TIP]
6972
> Users of Visual Studio Code might encounter issues when using `code .`. To fix them do the following:
7073
> 1. Run `direnv deny`

docs/tests.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ we can save the steps in a file by passing `--file`, instead of running those au
2121
Running:
2222

2323
```bash
24-
src/build-debug/tests/run/a_test <traceID>
25-
src/build-debug/tests/run/a_test examples/sum.nim
24+
src/build-debug/build/tests/run/a_test <traceID>
25+
src/build-debug/build/tests/run/a_test examples/sum.nim
2626
```

justfile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ build:
1414
# build-debug/codetracer user-setup
1515

1616
# Start building continuously
17-
cd src
17+
cd src/build
1818
tup build-debug
1919
tup monitor -a
20-
cd ../
20+
cd ../..
2121

2222
# start webpack
2323
node_modules/.bin/webpack --watch --progress & # building frontend_bundle.js
@@ -34,17 +34,18 @@ build-once:
3434
# problem because the Tupfiles refer to it.
3535
mkdir public/dist
3636

37-
cd src
37+
cd src/build
3838
tup build-debug
39-
cd ..
39+
cd ../..
4040

4141
# Build frontend_bundle.js in the dist folder
4242
node_modules/.bin/webpack --progress
4343

4444
# We need to execute another tup run because webpack may have created some new files
4545
# that tup will discover
46-
cd src
46+
cd src/build
4747
tup build-debug
48+
cd ../..
4849

4950
build-docs:
5051
#!/usr/bin/env bash
@@ -103,7 +104,7 @@ build-macos-app:
103104
build-app-image:
104105
./appimage-scripts/build_appimage.sh
105106

106-
tester := "src/build-debug/bin/tester"
107+
tester := "src/build-debug/build/bin/tester"
107108

108109
test-ui headless="0":
109110
#!/usr/bin/env bash
@@ -215,7 +216,7 @@ pid pid_or_current_or_last:
215216
#!/usr/bin/env bash
216217
# argument can be either `current`, `last` or a pid number
217218
if [[ "{{pid_or_current_or_last}}" == "current" ]]; then \
218-
echo $(ps aux | grep src/build-debug/codetracer | head -n 1 | awk '{print $2}') ; \
219+
echo $(ps aux | grep src/build-debug/build | head -n 1 | awk '{print $2}') ; \
219220
elif [[ "{{pid_or_current_or_last}}" == "last" ]]; then \
220221
TTMP=$(just findtmp) ; \
221222
echo $(cat $TTMP/last-start-pid) ; \

nix/shells/armShell.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ mkShell {
197197
198198
# ====
199199
200-
export CODETRACER_LINKS_PATH=$PWD/src/build-debug/
200+
export CODETRACER_LINKS_PATH=$PWD/src/build-debug/build
201201
202202
echo "{\"PYTHONPATH\": \"$CT_PYTHONPATH\",\"LD_LIBRARY_PATH\":\"$CT_LD_LIBRARY_PATH\"}" > ct_paths.json
203203
@@ -244,10 +244,10 @@ mkShell {
244244
rm -rf $ROOT_PATH/node_modules
245245
ln -s $NIX_NODE_PATH $ROOT_PATH/node_modules
246246
247-
export NIX_CODETRACER_EXE_DIR=$ROOT_PATH/src/build-debug/
248-
export LINKS_PATH_DIR=$ROOT_PATH/src/build-debug/
247+
export NIX_CODETRACER_EXE_DIR=$ROOT_PATH/src/build-debug/build
248+
export LINKS_PATH_DIR=$ROOT_PATH/src/build-debug/build
249249
export CODETRACER_REPO_ROOT_PATH=$ROOT_PATH
250-
export PATH=$PATH:$PWD/src/build-debug/bin
250+
export PATH=$PWD/src/build/bin:$PWD/src/build-debug/build/bin:$PATH
251251
export PATH=$PATH:$ROOT_PATH/node_modules/.bin/
252252
export CODETRACER_DEV_TOOLS=1
253253
export CODETRACER_LOG_LEVEL=INFO

non-nix-build/env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ if [ ! -f "$ROOT_DIR"/ct_paths.json ]; then
4949
echo "{\"PYTHONPATH\": \"\",\"LD_LIBRARY_PATH\":\"\"}" > "$ROOT_DIR"/ct_paths.json
5050
fi
5151

52-
export PATH=$DEPS_DIR/nim/bin:$ROOT_DIR/node_modules/.bin:$BIN_DIR:$CARGO_HOME/bin:$ROOT_DIR/src/build-debug/bin:$PATH
52+
export PATH=$DEPS_DIR/nim/bin:$ROOT_DIR/node_modules/.bin:$BIN_DIR:$CARGO_HOME/bin:$ROOT_DIR/src/build/bin:$ROOT_DIR/src/build-debug/build/bin:$PATH
5353

5454
if [ "$os" == "mac" ]; then
5555
brew install sqlite3 ruby node universal-ctags go capnp

src/db-backend/editor-config/emacs/init.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
(dap-register-debug-provider
3131
"rust"
3232
(lambda (conf)
33-
(plist-put conf :dap-server-path "/home/alexander92/codetracer/src/build-debug/bin/db-backend")
33+
(plist-put conf :dap-server-path "/home/alexander92/codetracer/src/build-debug/build/bin/db-backend")
3434
conf))
3535

3636
(dap-register-debug-template "CodeTracer db-backend rust"
@@ -40,4 +40,4 @@
4040
:traceFolder "/home/alexander92/.local/share/codetracer/trace-414/"
4141
:name "CodeTracer db-backend rust"))
4242

43-
(toggle-debug-on-error)
43+
(toggle-debug-on-error)

tup-build-staging-status.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44
- Relocated the entire Tup graph to `src/build/`, with `Tupfile.ini` still rooted in `src/`; `tup` now runs directly from the staging tree and no `src/Tupfile` shim is needed.
55
- Standardized on per-file `SRC_DIR` handling for relocated Tupfiles, added `!cp_preserve` plus `src/build/.gitignore`, and refreshed `.agents/codebase-insights.txt`; no further Tupfile edits are planned.
66
- Validated the build: both `tup` and `tup generate` succeed, `just build` / `just build-once` work end-to-end, and their outputs land under `src/build/` or `src/build-debug/build/` as intended.
7+
- Aligned developer tooling (Just recipes, CI helpers, Nix shells, non-Nix env scripts) and documentation—including contributor guides, mdBook outputs, and WebDriver specs—with the `src/build/` staging root and the new `build-debug/build` artifact paths, and documented the required clean-up after running generated scripts.
78

89
## In Progress
9-
- Update tooling, scripts, and documentation (CI jobs, `justfile`, Nix shells, onboarding guides) to reference `src/build-debug/build/**` and reflect the new staging entry point.
10-
- Capture the operational caveat that a generated script populates `src/build/`; developers must run `cd src/build && git clean -fx .` followed by `cd ../build-debug && git clean -fx .` before returning to live `tup` runs.
10+
- Monitor developer tooling and CI jobs for regressions now that their scripts target `src/build/` and `src/build-debug/build/**`; collect feedback from early adopters before marking ADR 0006 as accepted.
1111

1212
## Next
13-
- Sweep remaining references to `src/build-debug/bin` (arm shell, docs, helper scripts) and switch them to `src/build-debug/build/**`.
14-
- Document the post-`tup.sh` clean-up sequence across contributor docs and CI scripts, adding automation where possible to enforce a clean staging area.
1513
- Verify CI and developer tooling run successfully with the updated paths and documented clean-up, then mark ADR 0006 as accepted.
14+
- Capture any follow-up automation needed to enforce the post-`tup.sh` cleaning workflow (e.g., pre-commit hooks or CI guardrails) based on user feedback.

wdio.conf.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ const config = {
1414
[
1515
'electron',
1616
{
17-
// appPath: 'node_modules/.bin/', // join(__dirname, 'src/build-debug/dist'),
17+
// appPath: 'node_modules/.bin/', // join(__dirname, 'src/build-debug/build/dist'),
1818
// appName: 'electron',
1919
binaryPath: join(__dirname, 'node_modules', '.bin', 'electron'),
20-
appArgs: ['app=src/build-debug'],
20+
appArgs: ['app=src/build-debug/build'],
2121
chromedriver: {
2222
port: 9519,
2323
logFileName: 'wdio-chromedriver.log',
@@ -36,7 +36,7 @@ const config = {
3636
logLevel: 'debug',
3737
runner: 'local',
3838
outputDir: 'wdio-logs',
39-
specs: ['./src/build-debug/tests/dom_test.js'],
39+
specs: ['./src/build-debug/build/tests/dom_test.js'],
4040

4141
// framework: 'mocha',
4242
// mochaOpts: {

0 commit comments

Comments
 (0)