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

Configure variable set by jbuilder exec #205

Closed
bobot opened this issue Jul 27, 2017 · 6 comments
Closed

Configure variable set by jbuilder exec #205

bobot opened this issue Jul 27, 2017 · 6 comments
Assignees

Comments

@bobot
Copy link
Collaborator

bobot commented Jul 27, 2017

Some tools need to access files in its own share directory. The path to its share module once installed is often hard coded in the binary, but an environment variable allows to change this value. In order to be able to use jbuilder exec with such tools we need to set the environment variable.

Could we add to jbuild file format?

(set-local-exec-env
  ((VAR  <value-with-variable-substitution>) ... )
)

EDIT: forgot a parenthesis for the list

@ghost
Copy link

ghost commented Jul 27, 2017

Possibly. I suppose we'd have to think about what happens when the variable is already set manually by the user and why not set it during the build as well, etc...

TBH at this point I'd much rather see progress on #23 or #35 :) These would benefit a lot more people and are hard to workaround, contrary to this request

@bobot
Copy link
Collaborator Author

bobot commented Jul 27, 2017

Do you need anything from me in #35?

@ghost
Copy link

ghost commented Jul 28, 2017

Just the changes we discussed by mail, i.e. having a field (import_dirs ...) in library/executable stanzas rather than copy_files at the toplevel. copy_files will be superseded by include

@emillon emillon self-assigned this Aug 9, 2018
@emillon
Copy link
Collaborator

emillon commented Aug 13, 2018

Hi @bobot,

The simplest version would be to allow (env) to define extra environment variables to be defined during the build and execution. That would be pretty simple to implement, but would make it harder to define per-executable environment variables.

Would that fit your use case?

Thanks!

@bobot
Copy link
Collaborator Author

bobot commented Aug 15, 2018

Yes it will. The definition of these variables should allow variable expansions such as the local directory where the share files of some package have been copied locally (in _build as defined in #680).

I'm just wondering if profile in the env stanza could be a "wildcard" to be effective in any profile, just to save some copy-paste perhaps, but it is not needed at first.

@ghost
Copy link

ghost commented Aug 15, 2018

@bobot, yep, you can already use _ as profile name to mean all profiles.

emillon added a commit that referenced this issue Oct 24, 2018
Closes #205

Signed-off-by: Etienne Millon <[email protected]>
shonfeder pushed a commit to shonfeder/dune that referenced this issue Dec 31, 2018
* Set environment variables through the workspace

Closes ocaml#205

Signed-off-by: Etienne Millon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants