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

Allow setting the path to the Vala compiler using the VALAC env variable #1645

Closed
astavale opened this issue Apr 19, 2017 · 2 comments
Closed

Comments

@astavale
Copy link
Contributor

astavale commented Apr 19, 2017

It looks as though the executable for valac (and other compilers) is hard coded in /mesonbuild/environment.py :

def detect_vala_compiler(self):
    exelist = ['valac']

When developing the Vala compiler it is useful to build programs against a newly patched version of valac. With C the HowToX suggests the CC variable can be used:

Set compiler
When first running Meson, set it in an environment variable.
$ CC=mycc meson <options>

Is this the best way? So for Vala it would be:
$ VALAC=/home/development-vala/installed/bin/valac meson <options>

Another, maybe clearer, approach is to treat this as a cross compilation. So a cross file is created with the relevant binaries:

[binaries]
valac = '/home/development-vala/installed/bin/valac'

Then this is compiled with:
meson build --cross-file development_vala.txt

Thoughts?

@nirbheek
Copy link
Member

We should definitely read VALAC. I thought we already did that, but I just checked and we don't.

Treating the run as a cross-compilation is wrong though, because it has several non-obvious effects (such as, tests won't be run without an exe_wrapper, built programs won't be run, etc). However, we were discussing a dependency file of sorts, so maybe it's good to extend that to also include this.

I'll rename this bug to be about VALAC specifically. In the meantime, I recommend symlinking that valac inside ~/.local/bin and adding that to your PATH.

@nirbheek nirbheek changed the title Best way to set alternative compiler paths? Allow setting the path to the Vala compiler using the VALAC env variable Apr 21, 2017
@nirbheek
Copy link
Member

nirbheek commented Aug 9, 2017

Fixed by #1851

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

2 participants