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

Try building FFI in CI, including Windows #17

Merged
merged 13 commits into from
Jun 28, 2022
Merged

Try building FFI in CI, including Windows #17

merged 13 commits into from
Jun 28, 2022

Conversation

morrisonlevi
Copy link
Contributor

What does this PR do?

Builds the FFI artifacts on all platforms, including Windows.

Motivation

The FFI has been broken several times in the past because this wasn't being run in CI.

Additional Notes

I don't know much about Windows, I may need help fixing everything.

How to test the change?

No changes to test; the CI covers everything.

@morrisonlevi
Copy link
Contributor Author

It doesn't seem to be reusing the cache from the earlier cargo builds, so that's either something to look into or we should split it into a separate action so it starts earlier, as this step takes a bit of time.

Copy link
Member

@ivoanjo ivoanjo left a comment

Choose a reason for hiding this comment

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

👍 LGTM

Base automatically changed from levi/time to main May 27, 2022 14:27
@pawelchcki
Copy link
Contributor

Looks good to me!
thanks @morrisonlevi 🙇

@pawelchcki
Copy link
Contributor

@morrisonlevi
It doesn't seem to be reusing the cache from the earlier cargo builds, so that's either something to look into or we should split it into a separate action so it starts earlier, as this step takes a bit of time.

I think additional cache key needs to be added- since build-ffi uses --release build

@morrisonlevi
Copy link
Contributor Author

@pawelchcki I split the workflow; can you add the cache key? I need to work on some other stuff for a bit.

@pawelchcki
Copy link
Contributor

@pawelchcki I split the workflow; can you add the cache key? I need to work on some other stuff for a bit.

Will do

@morrisonlevi
Copy link
Contributor Author

I've handed this PR over to the .NET profiling people to get that windows stuff working.

@gleocadie
Copy link
Contributor

I've handed this PR over to the .NET profiling people to get that windows stuff working.

Sorry for the delay, I'm taking this.

@gleocadie gleocadie force-pushed the levi/ffi-ci branch 3 times, most recently from c8a07a5 to 7d53a90 Compare June 8, 2022 14:04
@gleocadie gleocadie force-pushed the levi/ffi-ci branch 6 times, most recently from aab435a to ee43b33 Compare June 8, 2022 23:25
@gleocadie gleocadie force-pushed the levi/ffi-ci branch 7 times, most recently from 8571b62 to ab26950 Compare June 10, 2022 09:51
@gleocadie gleocadie marked this pull request as ready for review June 10, 2022 11:31
@gleocadie gleocadie requested a review from a team as a code owner June 10, 2022 11:31
@gleocadie gleocadie force-pushed the levi/ffi-ci branch 3 times, most recently from 2a4c9a2 to 24f5b35 Compare June 10, 2022 13:59
@@ -2,18 +2,19 @@ name: Test
on: [push]
env:
CARGO_TERM_COLOR: always
RUST_VERSION: 1.56.1
Copy link
Contributor Author

@morrisonlevi morrisonlevi Jun 12, 2022

Choose a reason for hiding this comment

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

While this PR was open, it seems main upgraded to 1.60 and this PR brings it back down (probably not on purpose). Looking through the commits, we may need to merge in main?

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe updating from main is the thing to do.

Comment on lines +52 to +53
expected_native_static_libs="" # I don't know what to expect
native_static_libs="" # I don't know what to expect
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm. How did we not end up with test failures with these set to blank?

Copy link
Contributor

Choose a reason for hiding this comment

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

hum good question, maybe because cargo was not able to retrieve those informations

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 think the libs NtDll;UserEnv;Bcrypt;crypt32;wsock32;ws2_32;shlwapi should be in this list, rather than hard-coding them in the CMakeLists.txt. That's how it works on other platforms. That is, if cargo is working "correctly" and knows about the deps (it should).

Copy link
Contributor

Choose a reason for hiding this comment

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

but how would you compile using the CMake if you do not specify the list. (sorry new to that)
If the CMakeList is generated why pushing it ?

with:
path: |
~/.cargo/registry/
~/.cargo/git/db/
~/.cargo/bin/
target/
key: v1-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}-${{ inputs.rust_version }}
key: v1-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}-${{ inputs.rust_version }}-${{ inputs.build_profile }}
Copy link
Contributor

Choose a reason for hiding this comment

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

should we consider the lock file ?

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 think since we commit Cargo.lock anyway that it doesn't matter. If we update a version, then it won't be in the cache and it will pull it.

ffi-build.sh Outdated Show resolved Hide resolved
Copy link
Contributor

@r1viollet r1viollet left a comment

Choose a reason for hiding this comment

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

Yay windows things !
Also thanks for adding ffi builds. A few minor things in the windows part might need to be reviewed again.

@r1viollet
Copy link
Contributor

@pawelchcki we will need your approval on this one (core things)

Copy link
Contributor

@pawelchcki pawelchcki left a comment

Choose a reason for hiding this comment

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

Windows builds! LGTM

@morrisonlevi morrisonlevi merged commit 6a2c981 into main Jun 28, 2022
@morrisonlevi morrisonlevi deleted the levi/ffi-ci branch June 28, 2022 13:28
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.

5 participants