-
Notifications
You must be signed in to change notification settings - Fork 232
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
Introduce --ocamlenv #3565
Merged
Merged
Introduce --ocamlenv #3565
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This options allows to easily extend a shell with an OCAMLPATH suitable for building F* OCaml programs, and also to simply run a build command easily by prepending `fstar.exe --ocamlenv` to it. Example below. Hello.fst: module Hello open FStar.IO let _ = print_string "Hello F*!\n" $ fstar.exe --ocamlenv OCAMLPATH='/home/guido/r/fstar/master/lib:'; export OCAMLPATH; $ fstar.exe --ocamlenv ocamlfind ocamlopt -linkpkg -package fstar.lib Hello.ml findlib: [WARNING] Interface ratio.cmi occurs in several directories: /home/guido/.opam/4.14.1/lib/num, /home/guido/.opam/4.14.1/lib/ocaml findlib: [WARNING] Interface num.cmi occurs in several directories: /home/guido/.opam/4.14.1/lib/num, /home/guido/.opam/4.14.1/lib/ocaml findlib: [WARNING] Interface topdirs.cmi occurs in several directories: /home/guido/.opam/4.14.1/lib/ocaml/compiler-libs, /home/guido/.opam/4.14.1/lib/ocaml findlib: [WARNING] Interface big_int.cmi occurs in several directories: /home/guido/.opam/4.14.1/lib/num, /home/guido/.opam/4.14.1/lib/ocaml findlib: [WARNING] Interface nat.cmi occurs in several directories: /home/guido/.opam/4.14.1/lib/num, /home/guido/.opam/4.14.1/lib/ocaml findlib: [WARNING] Interface arith_status.cmi occurs in several directories: /home/guido/.opam/4.14.1/lib/num, /home/guido/.opam/4.14.1/lib/ocaml ocamlfind: [WARNING] Package `threads': Linking problems may arise because of the missing -thread or -vmthread switch $ ./a.out Hello F*! Obviously the command required is not as simple as it could be, but this is already an improvement since it provides a standard way of locating the needed OCAMLPATHs.
gebner
reviewed
Oct 14, 2024
src/fstar/FStarC.Main.fst
Outdated
let shellescape (s:string) : string = | ||
String.list_of_string s |> | ||
List.map (function | ||
| '\\' -> "\\\\" // backslashes can be escaped by themselves |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this works:
❯ echo '\\'
\\
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah thanks! I misremembered, backslashes don't need escaping in single quotes.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This options allows to easily extend a shell with an OCAMLPATH suitable
for building F* OCaml programs, and also to simply run a build command easily
by prepending
fstar.exe --ocamlenv
to it.Example below.
Obviously the command required is not as simple as it could be, but this
is already an improvement since it provides a standard way of locating
the needed OCAMLPATHs.