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

Problem running make codegenTest #3414

Closed
hrzhuang opened this issue May 11, 2023 · 9 comments · Fixed by #3446
Closed

Problem running make codegenTest #3414

hrzhuang opened this issue May 11, 2023 · 9 comments · Fixed by #3446
Assignees
Labels

Comments

@hrzhuang
Copy link
Collaborator

hrzhuang commented May 11, 2023

I am looking to generate the example GOOL programs under drasil-code/test. Based on the Makefile, I tried make codegenTest. However, this gives me the following error.

make: *** No rule to make target `codegenTest_gen', needed by `codegenTest'.  Stop.

I tried adding codegenTest to EXAMPLES in the Makefile just to test it out, but then make codegenTest results in the following error.

stack build --ghc-options="-Wall -j2" ""
cd "build/" && stack exec -- "" 
Executable named  not found on path: ["/Users/hrz/Drasil/code/.stack-work/install/aarch64-osx/4bbcd6936a38b56e3f3683c66cbd1584abde75323f410df1341259bc5a6ea9c9/9.2.7/bin","/Users/hrz/.stack/snapshots/aarch64-osx/4bbcd6936a38b56e3f3683c66cbd1584abde75323f410df1341259bc5a6ea9c9/9.2.7/bin","/Users/hrz/.stack/compiler-tools/aarch64-osx/ghc-9.2.7/bin","/Users/hrz/.stack/programs/aarch64-osx/ghc-9.2.7/bin","/Users/hrz/.opam/default/bin","/Users/hrz/.nix-profile/bin","/nix/var/nix/profiles/default/bin","/opt/homebrew/bin","/opt/homebrew/sbin","/usr/local/bin","/System/Cryptexes/App/usr/bin","/usr/bin","/bin","/usr/sbin","/sbin","/Library/TeX/texbin","/Library/Apple/usr/bin","/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin","/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin","/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin","/opt/homebrew/anaconda3/bin","/Users/hrz/bin","/usr/local/plan9/bin","/Users/hrz/.cabal/bin","/opt/homebrew/opt/llvm@12/bin"]
make: *** [codegenTest_gen] Error 1

Is there some other method that I am supposed to use to generate the GOOL examples?

@hrzhuang hrzhuang changed the title Problem running codegenTest Problem running make codegenTest May 11, 2023
@hrzhuang
Copy link
Collaborator Author

hrzhuang commented May 11, 2023

I was able to generate these examples using stack test (since codegenTest is a test as opposed to an exec), but I am still wondering what is the "official" way to do this?

I should also note that stack test (or just stack test drasil-code) generates the code directly under the drasil-code directory (e.g. drasil-code/cpp, drasil-code/java, etc.) whereas in stable these are under the gooltest directory.

@hrzhuang
Copy link
Collaborator Author

I just came across #3387, which seems related to the problems that I am having.

@balacij balacij added the bug label May 12, 2023
@balacij
Copy link
Collaborator

balacij commented May 12, 2023

Looks like an annoying bug. make gool is used to build the individual examples. The Makefile needs to be cleaned up a bit in this regard. For now, we can make a temporary target in the Makefile that just cds into build/...gool? and runs the test suite there. Later on, we can properly hook in the stack test for each package.

@hrzhuang
Copy link
Collaborator Author

Just to make sure we are talking about the same thing, I am referring to the manually written GOOL programs HelloWorld, FileTests, and PatternTest, under drasil-code/test.

@balacij
Copy link
Collaborator

balacij commented May 15, 2023

Yes 😄 My comment about make gool didn't say enough: make gool (I believe) previously also built the demo programs built by drasil-code.

@hrzhuang
Copy link
Collaborator Author

I see! I will continue using stack test drasil-code for now then. Do you know how to make it run in a different directory though? By default it runs in drasil-code (not the current directory in my shell). For stack exec there is a --cwd flag, but this doesn't work for stack test.

@JacquesCarette
Copy link
Owner

This issue seems worth fixing. @hrzhuang if you're going to be modifying GOOL, you really ought to have a test suite in place to make sure you don't break things, so it makes sense to me that you'd tackle this?

@hrzhuang hrzhuang self-assigned this May 24, 2023
@hrzhuang
Copy link
Collaborator Author

So the problem I am having is that in our Stack configuration, we have "executables" that generate the software artifacts, but the GOOL example code is a "test." Since "tests" are specialized for, well, testing, they are more restricted in Stack than regular "executables." There doesn't seem to be a way to decide in what directory the test runs, it just automatically runs under the drasil-code directory.

The thing is, this code is not really a test. It doesn't assert anything, it just generates C#, C++, Java, etc. from some small GOOL examples. So I think the right thing to do here is to modify the Stack configuration and change it to a regular "executable." This way, we'll be able to run it the same way we run the software artifact generation code.

@JacquesCarette
Copy link
Owner

Sounds good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging a pull request may close this issue.

3 participants