-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
310 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[target.x86_64-unknown-linux-gnu] | ||
rustflags = [ | ||
"-C", "link-arg=-fuse-ld=lld", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM ubuntu:20.04 | ||
|
||
RUN apt-get update && apt-get upgrade | ||
|
||
# install sf | ||
RUN apt-get install apt-transport-https curl lsb-release wget gnupg2 software-properties-common debconf-utils -y | ||
|
||
RUN wget -q https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb \ | ||
&& dpkg -i packages-microsoft-prod.deb \ | ||
&& curl -fsSL https://packages.microsoft.com/keys/msopentech.asc | apt-key add - \ | ||
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \ | ||
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \ | ||
&& apt-get update | ||
|
||
RUN echo "servicefabric servicefabric/accepted-eula-ga select true" | debconf-set-selections \ | ||
&& echo "servicefabricsdkcommon servicefabricsdkcommon/accepted-eula-ga select true" | debconf-set-selections \ | ||
&& apt-get install servicefabricsdkcommon -y | ||
|
||
# install rust | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > ./rustup.sh | ||
RUN chmod u+x ./rustup.sh && ./rustup.sh -y | ||
|
||
# more tools | ||
RUN apt-get install cmake git -y | ||
RUN apt-get install clang lld -y | ||
|
||
# expose sf shared libs | ||
ENV LD_LIBRARY_PATH "$LD_LIBRARY_PATH:/opt/microsoft/servicefabric/bin/Fabric/Fabric.Code:/workspaces/service-fabric-rs/bintemp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp | ||
{ | ||
"name": "C++", | ||
"build": { | ||
"dockerfile": "Dockerfile" | ||
}, | ||
|
||
// "image" : "fabric-metadata:v1", | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "gcc -v", | ||
|
||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
|
||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-vscode.cpptools-extension-pack", | ||
"rust-lang.rust-analyzer"] | ||
} | ||
} | ||
|
||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
//use std::{path::Path, env}; | ||
use std::path::Path; | ||
|
||
fn main() { | ||
// add link dir for fabric support libs. This is propagated to downstream targets | ||
// let dir = String::from("build\\_deps\\fabric_metadata-build\\src"); | ||
// let package_root = env::var("CARGO_MANIFEST_DIR").unwrap(); | ||
// let abs_dir = package_root + &dir; | ||
// println!( | ||
// "cargo:rustc-link-search=native={}", | ||
// Path::new(&abs_dir).display() | ||
// ); | ||
if cfg!(unix) { | ||
// Add link dir for fabric libs on linux. | ||
let dir = String::from("/opt/microsoft/servicefabric/bin/Fabric/Fabric.Code/"); | ||
println!( | ||
"cargo:rustc-link-search={}", | ||
Path::new(&dir).display() | ||
); | ||
|
||
// On linux, for windows-rs to work we need have a pal shared lib. | ||
// No need to have search dir since it is in the target dir | ||
println!("cargo:rustc-link-lib=dylib=fabric_rust_pal"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[package] | ||
name = "pal" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
|
||
[lib] | ||
name = "fabric_rust_pal" | ||
path = "src/lib.rs" | ||
crate-type = ["cdylib"] | ||
|
||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies.windows] | ||
version = "0.43" | ||
features = [ | ||
"Win32_Foundation" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#[cfg(unix)] | ||
pub mod pal; |
Oops, something went wrong.