microsoft / microsoft/yardl

Building yardl fails with matlab/generated/+yardl: file exists

Open
#273 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
35
Forks
14
Avg merge
5d 17h
Merged PRs (30d)
1

Description

On Ubuntu 22.04, I cloned a fresh copy, used conda install go giving me go1.25.4, but get

(petsird) kris@ASC-HYDRA:~/devel/yardl$ just -v
===> Running recipe `install`...
cd tooling/cmd/yardl; go install -ldflags="-s -w" .
===> Running recipe `generate`...
cd models/test && yardl generate
✅ Wrote C++ to /home/kris/devel/yardl/cpp/test/generated.
✅ Wrote Python to /home/kris/devel/yardl/python.
✅ Wrote JSON to /home/kris/devel/yardl/cpp/test/generated.
✅ Wrote Matlab to /home/kris/devel/yardl/matlab/generated.
===> Running recipe `generate-sandbox`...
cd models/sandbox && yardl generate
ERR mkdir /home/kris/devel/yardl/matlab/generated/+yardl: file exists
error: Recipe `generate-sandbox` failed on line 29 with exit code 1

Removing the directory and doing just generate-sandbox works. I believe this is because just first runs generate, which will run yardl generate in models/test. This creates the directory, just generate-sandbox then complains as the directory is already there (and not compatible).

https://github.com/microsoft/yardl/blob/26a875148169265866cb8a5a2cc136d139c3d7f5/models/test/_package.yml#L20
https://github.com/microsoft/yardl/blob/26a875148169265866cb8a5a2cc136d139c3d7f5/models/sandbox/_package.yml#L11

I'm not sure why you don't see this, but it is the same error as in #252, where I also use go from conda.

In any case, it seems dangerous to let 2 different models generate files in the same location.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing models/test/_package.yml and models/sandbox/_package.yml, then run just -v on Ubuntu 22.04 to reproduce the shared matlab/generated/+yardl collision. Trace the generate and generate-sandbox recipes to determine why both models target the same output directory. Done means a fresh checkout can run the full command without manually removing generated files.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, matlab
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.