question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[question] Cross-compilation with SCons and tool_requires

See original GitHub issue

I am trying to setup cross-compilation with SCons where Conan provides the cross-compiler as a binary package. So, I have created a cross-compiler package which works fine with CMAKE when I add it as tool_requires and set the correct host profile.

For SCons however I am not sure how I can add the location of the cross-compiler binaries to the build environment. The SConscript_conan file does not contain anything regarding the packages installed via tool_requires. I would expect that they show up, so that I can add the BINPATH to the SCons environment. I can’t add the pakckage as normal requires because then the build and host environments don’t match anymore.

Does anyone have a suggestion what the recommend approach is for cross-compilation with SCons?

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
memshardedcommented, Aug 24, 2022

Yes, for example something like:

def generate(self):
    buildenv= VirtualBuildEnv(self)
    for name, value in buildenv.vars().items():
         # save them in your desired format to a file. 
         # you can even generate a .py file with python code that activate the environment

The nice things about the new integrations:

  • They explicitly differentiate between build-time and run-time environment
  • They have explicit constructs for paths vs non-paths variables
  • They have explicit management of clear/append/prepend/define semantics
  • They are more configurable and flexible
  • They also merge environment vars from the profiles [buildenv] and the dependencies self.buildenv_info (in package_info() of the dependencies)
0reactions
thesummercommented, Aug 24, 2022

Interesting I didn’t know about this. Thanks.

If I understand it correctly, I should be able to prepare an environment file with only the few variables/paths I actually need. And the structure can be kept quite simple, so I can read it with Python standard functions. Neat.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[question] Conan cross compilation - my experience #11027
Yes, cross compilation is difficult, and complex. Those settings are needed for some recipes and toolchains, and the definitions follow the ...
Read more >
Anatomy of Cross-compilation toolchains - eLinux.org
A set of tools that allows to build source code into binary code for a target ... There are four core components in...
Read more >
Anatomy of Cross-Compilation Toolchains - YouTube
Anatomy of Cross - Compilation Toolchains - Thomas Petazzoni, Free ElectronsAll embedded Linux developers use cross - compilation toolchains as ...
Read more >
Cross building — conan 1.56.0 documentation
In order to cross build a codebase the right toolchain is needed, with a proper compiler (cross compiler), a linker and the set...
Read more >
Cross-compilation in Rust - Sylvain Kerkour
The specificities of each OS force us to craft platform-dependent of code. Thus we will need to write some parts of our RAT...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found