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

Add feature flags for static builds #4691

Merged
merged 6 commits into from
Dec 17, 2024
Merged

Conversation

masa-koz
Copy link
Contributor

@masa-koz masa-koz commented Dec 6, 2024

Description

This pull request includes changes to add support for static linking. The most important changes include adding a new feature "static" to Cargo.toml and modifying the build script to handle static builds.

Testing

cargo test --features static

Documentation

No

@masa-koz masa-koz requested a review from a team as a code owner December 6, 2024 08:31
@nibanks
Copy link
Member

nibanks commented Dec 6, 2024

Could you update cargo.yml to build with this feature flag to make sure it works (and we don't break it in the future)?

@masa-koz
Copy link
Contributor Author

masa-koz commented Dec 6, 2024

I've added it in cargo.yml. Is this Ok?

.github/workflows/cargo.yml Outdated Show resolved Hide resolved
@nibanks
Copy link
Member

nibanks commented Dec 7, 2024

Looks like macOS fails to build static.

@masa-koz
Copy link
Contributor Author

masa-koz commented Dec 8, 2024

I've add framework linking for MacOS. Could you rerun cargo.yaml?

Copy link

codecov bot commented Dec 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.86%. Comparing base (9c41c71) to head (64a4561).
Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4691      +/-   ##
==========================================
+ Coverage   86.81%   86.86%   +0.04%     
==========================================
  Files          56       56              
  Lines       17361    17363       +2     
==========================================
+ Hits        15072    15082      +10     
+ Misses       2289     2281       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nibanks
Copy link
Member

nibanks commented Dec 10, 2024

Seeing some Ubuntu failures:

= note: /usr/bin/ld: /home/runner/work/msquic/msquic/target/debug/build/msquic-a397da1e6977dae8/out/lib/libmsquic.a(platform_posix.c.o): in function `CxPlatThreadCreate':
          /home/runner/work/msquic/msquic/src/platform/platform_posix.c:718: undefined reference to `numa_node_of_cpu'
          /usr/bin/ld: /home/runner/work/msquic/msquic/target/debug/build/msquic-a3[9](https://github.com/microsoft/msquic/actions/runs/12218329025/job/34128003790?pr=4691#step:12:10)7da1e6977dae8/out/lib/libmsquic.a(platform_posix.c.o): in function `CxPlatSystemLoad':
          /home/runner/work/msquic/msquic/src/platform/platform_posix.c:112: undefined reference to `numa_available'
          /usr/bin/ld: /home/runner/work/msquic/msquic/src/platform/platform_posix.c:[11](https://github.com/microsoft/msquic/actions/runs/12218329025/job/34128003790?pr=4691#step:12:12)3: undefined reference to `numa_num_configured_nodes'
          /usr/bin/ld: /home/runner/work/msquic/msquic/target/debug/build/msquic-a397da1e6977dae8/out/lib/libmsquic.a(platform_posix.c.o): in function `numa_node_to_cpus_compat':
          /usr/include/numa.h:464: undefined reference to `numa_node_to_cpus'
          collect2: error: ld returned 1 exit status

@nibanks nibanks added the external Proposed by non-MSFT label Dec 10, 2024
@masa-koz
Copy link
Contributor Author

masa-koz commented Dec 11, 2024

I've added libnuma linking for Linux.

@nibanks nibanks added the Language: Rust Related to the Rust interop layer label Dec 16, 2024
@nibanks nibanks enabled auto-merge (squash) December 17, 2024 12:56
@nibanks nibanks merged commit f8e9cec into microsoft:main Dec 17, 2024
484 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external Proposed by non-MSFT Language: Rust Related to the Rust interop layer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants