Skip to content
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

clerk sets the cwd to the _build dir? #757

Closed
rprimet opened this issue Jan 6, 2025 · 3 comments
Closed

clerk sets the cwd to the _build dir? #757

rprimet opened this issue Jan 6, 2025 · 3 comments
Labels
🏗️ build system Build system or Makefile ❓ invalid This doesn't seem right

Comments

@rprimet
Copy link
Contributor

rprimet commented Jan 6, 2025

This is a behavior that I encountered while implementing the JSON output for traces.

If I send the json output in a file, for instance by calling

clerk run tests/fonctionnels/cas_1.catala_fr -s TestAF -c-t -c--trace-format=json -c--trace-output=hi.json in the poc-cnaf repository, then the file hi.json ends up being created in _build/hi.json rather than in the shell's current working directory. This could be confusing for users I guess?

@denismerigoux
Copy link
Contributor

The file should be copied out of _build. The Catala compiler should somehow send a signal to clerk signalling that it created a new file such that this file can be copied out of _build. clerk should deal with clerk run the same way it does with clerk test by controlling the launching of the interpretation?

@AltGr
Copy link
Contributor

AltGr commented Jan 8, 2025

This was actually already provisioned for: clerk doesn't directly run catala with CWD=_build, but passes it the --directory option so that it knows what's going on. The bit that was missing for it to work is that the output option, on the catala side, needed to use the raw_file argument parser rather than a plain string ; then a function is provided to convert that to a proper file path, taking directory sorcery into account. The required change is proposed in c9ce9fe

@rprimet
Copy link
Contributor Author

rprimet commented Jan 8, 2025

nice, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏗️ build system Build system or Makefile ❓ invalid This doesn't seem right
Projects
Status: Done
Development

No branches or pull requests

3 participants