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 a PR build workflow #78

Merged
merged 11 commits into from
Jun 4, 2024
Merged

Add a PR build workflow #78

merged 11 commits into from
Jun 4, 2024

Conversation

zadjii-msft
Copy link
Member

Obviously,

  • you can't test GH actions locally
  • and you can't test the actions in the repo without the actual source code
  • and you don't want to include the actions with the initial source code commit if its wrong

So, here's the GH action to test this that we think is right

@zadjii-msft
Copy link
Member Author

"/LIBPATH:D:\\a\\sudo\\sudo\\target\\i686-pc-windows-msvc\\debug\\deps" 
"/LIBPATH:D:\\a\\sudo\\sudo\\target\\debug\\deps" 
"/LIBPATH:C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.39.33519\\atlmfc\\lib\\x86" 
"/LIBPATH:D:\\a\\sudo\\sudo\\target\\i686-pc-windows-msvc\\debug\\build\\sudo-cf3b74afda2c19be\\out" 
"/LIBPATH:C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.39.33519\\atlmfc\\lib\\x86" 
"/LIBPATH:D:\\a\\sudo\\sudo\\target\\i686-pc-windows-msvc\\debug\\build\\sudo-cf3b74afda2c19be\\out" 
"/LIBPATH:D:\\a\\sudo\\sudo\\target\\i686-pc-windows-msvc\\debug\\build\\sudo-cf3b74afda2c19be\\out" 
"/LIBPATH:C:\\Users\\runneradmin\\.cargo\\registry\\src\\index.crates.io-1cd66030c949c28d\\windows_i686_msvc-0.52.3\\lib" 
"/LIBPATH:C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-i686-pc-windows-msvc\\lib\\rustlib\\i686-pc-windows-msvc\\lib"

uh, where is rpcrt4.lib? It's not in gci -Recurse -path "C:\Program Files\Microsoft Visual Studio\2022\Preview\VC" -Filter "rpcrt4.lib". Something wacky is afoot.

@zadjii-msft
Copy link
Member Author

@riverar any ideas why we can't seem to find the rpc lib only in the x86 builds? I thought passing /DEFAULTLIB:rpcrt4.lib in the config.toml would work (it does locally), but clearly that doesn't work

@riverar
Copy link

riverar commented May 31, 2024

@zadjii-msft rpcrt4.lib ships with the SDK, not Visual Studio, so can be found at C:\Program Files (x86)\Windows Kits\10\Lib\xxx\um\x86\rpcrt4.lib.

The Rust compiler leans heavily on the cc crate to find various tools and set up INCLUDE/LIB paths, so maybe something went awry there. Will follow up tomorrow after some sleep.

@riverar
Copy link

riverar commented May 31, 2024

@zadjii-msft The root issue here is that the RUSTFLAGS environment variable specified in the pipeline is overwriting the .config/cargo.toml-specified RUSTFLAGS (docs). So the linker isn't getting any of your specified flags. This environment variable is not normally set on developer machines.

Remove the following from your YAML:

env:
  RUSTFLAGS: -Dwarnings

And add to your .config/cargo.toml (or a flavor of):

rustflags = [
...
"-Dwarnings",
"-Clink-arg=/DEFAULTLIB:rpcrt4.lib"
...

(I would also revert a0ad35e and other assorted attempts.)

@zadjii-msft
Copy link
Member Author

The root issue here is that the RUSTFLAGS environment variable specified in the pipeline is overwriting the .config/cargo.toml-specified RUSTFLAGS

image

Thanks for helping me sort that out ☺️

@riverar
Copy link

riverar commented Jun 1, 2024

@zadjii-msft Holler if you need anything else 👍

@zadjii-msft zadjii-msft merged commit fa15df4 into main Jun 4, 2024
7 checks passed
@zadjii-msft zadjii-msft deleted the dev/migrie/workflows branch June 4, 2024 16:26
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