Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

(PA-6324) Add windowsfips-2016-x64 to agent-runtime-main and agent-runtime-7.x #900

Merged

Conversation

shubhamshinde360
Copy link
Contributor

  • Add the platform file for windowsfips-2016-x64.
  • Add windowsfips-2016 to ruby dtrace for both 7.x and main.
  • Set fips version and fips flags properly.
  • Set NM to the system nm (version 2.42) since mingw nm (version 2.25) conflicts with sed during curl-build.
  • Patch rbconfig.rb to remove the '\r' character appended to CONFIG["ruby_version"] during ruby-build.

…ntime-7.x

 - Add the platform file for windowsfips-2016-x64.
 - Add windowsfips-2016 to ruby dtrace for both 7.x and main.
 - Set fips version and fips flags properly.
 - Set NM to the system nm (version 2.42) since mingw nm (version 2.25) conflicts with sed during curl-build.
 - Patch rbconfig.rb to remove the '\r' character appended to CONFIG["ruby_version"] during ruby-build.
@shubhamshinde360 shubhamshinde360 requested review from a team as code owners August 22, 2024 18:48
@mhashizume
Copy link
Contributor

Could you link to a successful build using these changes?

@shubhamshinde360 shubhamshinde360 marked this pull request as draft August 23, 2024 06:32
@shubhamshinde360 shubhamshinde360 marked this pull request as ready for review August 27, 2024 19:51
CONFIG["rubyarchdir"] = "$(rubylibdir)/$(arch)"
CONFIG["rubylibdir"] = "$(rubylibprefix)/$(ruby_version)"
- CONFIG["ruby_version"] = "2.7.0\r"
+ CONFIG["ruby_version"] = "2.7.0"
Copy link
Contributor

@joshcooper joshcooper Aug 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe ruby_version is detected during the ruby build by https://github.com/ruby/ruby/blob/31d0f1a2e7dbfb60731d1f05b868e1d578cda493/configure.ac#L4203 It emits a conftest.c program, compiles and runs it, and uses sed to extract the version. As mentioned in https://cygwin.com/cygwin-ug-net/using-textbinary.html, cygwin sed "Most other programs (such as sed, cmp, tr) use the default mode." The default behavior depends on the filesystem that is mounted. I'm guessing the win2016 cygwin is configured differently than 2012r2. Is it possible 2016 has mounted / as text? See https://cygwin.com/cygwin-ug-net/mount.html for details

@@ -27,6 +27,7 @@
elsif platform.is_windows?
pkg.build_requires "runtime-#{settings[:runtime_project]}"
pkg.environment "PATH", "$(shell cygpath -u #{settings[:gcc_bindir]}):$(PATH)"
pkg.environment "NM" , "/usr/bin/nm" if platform.name =~ /windowsfips-2016/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what the implications are of using Cygwin nm with binaries built by mingw... I assume this problem would go away if we were using a newer version of mingw tool chain?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to find 13.2.0 in the default repository(https://chocolatey.org/api/v2) of choco: https://community.chocolatey.org/packages/mingw
I think this is the latest version. It ships with nm 2.39. Unfortunately, it still results in the global_symbol_pipe variable being empty with this version.
The system nm (/usr/bin/nm) is version 2.42 which doesn't result the global_symbol_pipe issue. So, I manually set it to system nm.

I also tried with mingw 8.1.0 (nm version 2.25) which was available in the default repo, that also fails with the same error.

@shubhamshinde360 shubhamshinde360 merged commit 39639ec into puppetlabs:master Aug 29, 2024
3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants