Replies: 2 comments 5 replies
-
I think this is a @jpakkane question. I can't really answer it myself because I'm not entirely clear why it's a problem and would be willing to have this work if it were up to me. |
Beta Was this translation helpful? Give feedback.
-
I'm guessing it's something like meson wanting one specific configuration per system which should be universal across systems, and also passing a bunch of arguments during configuration is clumsy and ugly. Further, in cases like Android where it would basically need to be assumed all environment variables are already set and have been set correctly would require additional documentation per-project and would mean the configuration would fail for everyone who didn't read the documentation beforehand. So, my assumption is, the reason it's this way is to force conciseness and reduce pre-configuration steps which would be different per project or per system - every project should be buildable with the same arguments. But these are just guesses and I feel like there's a more concise design decision that probably went into this. To clarify, where I and so many others ran into problems was the Android NDK and embedded system compilers:
One of the devs noted in a comment and I also very much share this sentiment now: These are design issues with these specific SDKs/toolsets, not Meson. Regardless, without allowing for environment variables or overridable constants in the machine files; these two scenarios result in effectively everyone who wants to cross compile needing to basically edit or generate one or (in the case of Android maybe 4 or more) machine files extremely specific to their system. The need to do this, and the [design] reason why it's this way, was clearly noted in the documentation I think it would be helpful and save people like me some time and confusion (and hopefully reduce the amount of issues about the subject in the future). |
Beta Was this translation helpful? Give feedback.
-
I'd like to add to the documentation for cross compiling that machine files do not allow environment variables or configurable or overridable constants and also why they don't allow them.
Basically I've been trying to use environment variables in a cross compile machine file and couldn't figure out why it wasn't working. The documentation says nothing about environment variables (and I already knew overriding constants was not possible - again when trying to do so and only later finding out when digging through issues that it was not possible). Searching yielded multiple threads loosely related to this subject, and many threads about people asking how to pass options or override constants defined in machine files with no actual answers or reason why there was no such implementation. Then I ran across this specific post: #5859 (comment)
Which states:
But I can find no post nor reasoning on this, and I still do not know why environment variables can not be used or the reasoning behind making machines files so strictly static. Until this is clearly written in the documentation there will continue to be issues raised about this and people wasting time searching for solutions that do not exist. I'd modify the documents myself and put up a PR but I still don't actually know the reason and I'd rather not guess and misrepresent it - so if anyone can point me to this or clarify it would be much appreciated.
To clarify, while I'd surely appreciate such functionality, I'm assuming there's a good reason for not having it - clearly noting that would surely help others understand this is by design and simply not a missing feature.
Beta Was this translation helpful? Give feedback.
All reactions