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

Prepare for updated toolchains #211

Merged
merged 6 commits into from
Sep 27, 2024
Merged

Conversation

chouquette
Copy link

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.

@chouquette chouquette requested a review from a team as a code owner September 26, 2024 14:46
Comment on lines 794 to 795
# Forward the toolchain env since some invoke tasks
# rely on it down the line

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.

Copy link
Author

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

Comment on lines 794 to 799
to_forward = {
"DD_CC" => "CC",
"DD_CXX" => "CXX",
"DD_CMAKE_TOOLCHAIN" => nil,
}

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.

View in Datadog  Leave us feedback  Documentation

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.
@chouquette chouquette merged commit 1c20696 into datadog-5.5.0 Sep 27, 2024
4 checks passed
@chouquette chouquette deleted the chouquette/glibc_2 branch September 27, 2024 12:38
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

Successfully merging this pull request may close these issues.

2 participants