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

Expand variables in install stanzas #690

Closed
rgrinberg opened this issue Apr 10, 2018 · 8 comments
Closed

Expand variables in install stanzas #690

rgrinberg opened this issue Apr 10, 2018 · 8 comments

Comments

@rgrinberg
Copy link
Member

Currently ${variables} aren't expanded in install stanzas as they should be [1].

cc @dilm @wokalski

[1] https://discuss.ocaml.org/t/dune-object-file-output-is-not-using-output-complete-obj/1828/6?u=rgrinberg

@Isweet
Copy link

Isweet commented Jun 30, 2018

I've started poking at this, but first issue w/ Dune so it'll be slow. Feel free to scoop me for the sake of expedition.

@rgrinberg
Copy link
Member Author

Thanks for taking intitative @Isweet .

Have a look at jbuild.ml. In particular, you're looking for uses of String_with_vars.t uses in the various t values which represent sexp parsers. This will you insert variables in the necessary fields.

Then, you'll be to eliminate String_with_vars.t values using String_with_vars.expand with a correct ~f function. Here you can refer to the expand_* family of functions in super_context.ml

Finally, keep in mind that we cannot support all variables in the installed stanza. For example, %{read:...} cannot be supported at the moment, because we're keeping the list of installed artifacts static, and hence cannot build anything before we know the full set of static artifacts.

Feel free to ask more questions.

@Isweet
Copy link

Isweet commented Jun 30, 2018

I was able to figure out the parsing yesterday. I'll open a WIP PR sometime today.

I started looking at the expand functions in super_context.ml to get an idea of how to use expand in string_with_vars.ml.

Thanks for the direction, I'll follow-up if I get stuck.

@rauanmayemir
Copy link

rauanmayemir commented Jul 23, 2018

Has anything changed here recently?

I can compile an executable in (exe) linking mode and run it as a standalone program, but I can't link app.exe.o built in (object) mode with my XCode project because it has its own libasmrun.a dependency. (i.e I start having 'duplicate symbol' issues)

I can't remove libasmrun.a dependency in my xcode project because I'm running caml_main in its main function.

I didn't have such issues before, so I'm wondering if something changed in -output-complete-obj.

My jbuild file:

(jbuild_version 1)

(executable (
 (name app)
 (libraries (brisk_cocoa))
 (modes (object))
))

(install (
  (package brisk)
  (section lib)
  (files ((app.exe.o as app.o)))
))

And then I run jbuilder build @install.

Note: I'm on ocaml 4.06 and jbuilder 1.0.1.

@ghost
Copy link

ghost commented Jul 30, 2018

@rauanmayemir could you open a separate issue?

@rauanmayemir
Copy link

@diml I created a discuss thread here, should I open a gh issue as well?

@ghost
Copy link

ghost commented Jul 30, 2018

Yes, please. It's easier to track issues at a central place. I believe all dune devs are on discuss, but for instance I personally don't consult discuss on a daily basis.

@rgrinberg
Copy link
Member Author

Fixed by @mseri

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

No branches or pull requests

3 participants