-
Notifications
You must be signed in to change notification settings - Fork 11
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
Prepare for updated toolchains #211
Conversation
lib/omnibus/software.rb
Outdated
# Forward the toolchain env since some invoke tasks | ||
# rely on it down the line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥜 nitpick: since this comment seems to apply to all the if
statements, it should be moved to a more "global" place, or duplicated per.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I took the opportunity to attempt another approach which will allow simpler additional variables if we need them
lib/omnibus/software.rb
Outdated
to_forward = { | ||
"DD_CC" => "CC", | ||
"DD_CXX" => "CXX", | ||
"DD_CMAKE_TOOLCHAIN" => nil, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚪ Code Quality Violation
Consider using symbols instead of string hash keys (...read more)
In Ruby, it is a best practice to use symbols instead of strings as hash keys. This rule emphasizes that it's more efficient and idiomatic to use symbols for this purpose. Symbols are immutable and unique, which makes them ideal for identifying things, whereas strings are mutable and can create multiple objects for the same sequence of characters.
The importance of this rule lies in the performance and memory usage of your Ruby application. Using symbols as hash keys reduces memory usage because they are stored in memory only once during a Ruby process. This can make a significant difference in the efficiency of your application, especially when dealing with large data sets.
To ensure you're following good coding practices, always use symbols for hash keys unless there's a specific reason to use a string. A simple refactoring from values = { 'foo' => 42, 'bar' => 99, 'baz' => 123 }
to values = { foo: 42, bar: 99, baz: 123 }
will make your code compliant with this rule. This not only improves your code's performance but also makes it more readable and consistent with Ruby's conventions.
This fixes the link with depended upon libraries, which are not found when this flag is lacking and the libraries are not explicitely provided. This is basically the equivalent of `-L` for libraries that are listed in the `DT_NEEDED` section of a library boing linked with. This is fixing some issues with (at least) curl & gcrypt, but I introduced this before trying to build other dependencies so there are likely more. If I'm being honest I don't understand why this wasn't required before, I'm guessing some change in libtool, but I wasn't able to identify something precisely.
fd4dbdb
to
ac0d176
Compare
This PR contains some preliminary work for DataDog/datadog-agent#28262
It fixes implicit linking with our libraries dependencies, and allows us to chose a different compiler that the default
gcc
/g++
without having to override the environment variable globally.