Closed bobajeff closed 1 year ago
I tried the following command-line, and it seemed to work properly:
patscc -DATS PACKAGE_LOCATION_targetloc='\"/home/monkeykong/ats/projects/ats_package_manager/src\"'
I've attached a small test case: define_error.zip
This is what I get when I run it:
I'm using the latest revision of ATS-Postiats:
$git log -1
commit 3e2cfab792d4d9f2598aca354297f06e5410b7df (HEAD -> master, origin/master, origin/HEAD)
Merge: fb1dc0bbf a620f96f8
Author: Hongwei Xi <gmhwxi@gmail.com>
Date: Tue Jan 3 16:00:33 2023 -0500
Merge pull request #274 from bobajeff/master
fix broken Makefiles
Thanks for your detailed reporting.
The order of the arguments passed to patscc is significant. The following order should work:
patscc -DATS CUSTOM_DEFINE_targetloc='\".\"' testload.dats test_define.dats && ./a.out
That results in:
patsopt: error(0): the command-line argument [CUSTOM_DEFINE_targetloc=.] cannot be properly parsed.
exit(ATS): uncaught exception: _2home_2monkeykong_2ats_2ATS_INSTALL4_2ATS2_2src_2pats_error_2esats__FatalErrorExn(1025)
Updated the test case: define_error_v2.zip
'"."' should be '\".\"' (a backslash in front of each double-quote).
Well that works. Thanks for the clarification. I've got to say it's awfully specific.
It won't work with just the backslash in front of double-quotes it has to have single quotes around the whole value plus the backslash in front of the double-quotes.
Also, the wiki should be updated to:
patscc -DATS JNI_targetloc='\"'"${JNI}"'\"' ...
Because bash won't expand variables inside single quotes you have to close each quote around the escaped double-quote and also double-quote the variable. (note the above is for linux/bash; I don't know about cygwin)
I took a note of this. Currently, a string-parser is used to parse targetloc-values. I suppose I could write a parser that does not require these values being surrounded by double-quotes.
I this small source file I have the following at the top.
I compile it with
-DATS PACKAGE_LOCATION_targetloc=\"/home/monkeykong/ats/projects/ats_package_manager/src\"
similar to what's shown hereBut PACKAGE_LOCATION doesn't get defined and instead it looks for the file
/tmp/.PATSRELOCROOT-monkeykong
instead resulting in this error: