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

Updates RUST_VERSION and bumps IronRDP rev to latest, adding RUST_MIN_STACK to fix ARM builds #39895

Merged
merged 2 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/dependency-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,12 @@ jobs:
with:
base-ref: ${{ github.event.pull_request.base.sha || 'master' }}
allow-ghsas: 'GHSA-xwh9-gc39-5298'
allow-dependencies-licenses: 'pkg:cargo/curve25519-dalek-derive, pkg:cargo/ring, pkg:cargo/sspi, pkg:cargo/tokio-boring'
allow-dependencies-licenses: >-
pkg:cargo/curve25519-dalek-derive,
pkg:cargo/ring,
pkg:cargo/sspi,
pkg:cargo/tokio-boring,
pkg:cargo/asn1-rs,
pkg:cargo/asn1-rs-derive,
pkg:cargo/asn1-rs-impl,
pkg:cargo/der-parser
Comment on lines +16 to +24
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Issue tracking these is here: #35993

57 changes: 25 additions & 32 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ codegen-units = 1
[workspace.dependencies]
# Note: To use a local IronRDP repository as a crate (for example, ironrdp-cliprdr), define the dependency as follows:
# ironrdp-cliprdr = { path = "/path/to/local/IronRDP/crates/ironrdp-cliprdr" }
ironrdp-cliprdr = { git = "https://github.com/Devolutions/IronRDP", rev = "c944674ecbb0952f9e7ecb964a6c79cdca669a08" }
ironrdp-connector = { git = "https://github.com/Devolutions/IronRDP", rev = "c944674ecbb0952f9e7ecb964a6c79cdca669a08" }
ironrdp-graphics = { git = "https://github.com/Devolutions/IronRDP", rev = "c944674ecbb0952f9e7ecb964a6c79cdca669a08" }
ironrdp-pdu = { git = "https://github.com/Devolutions/IronRDP", rev = "c944674ecbb0952f9e7ecb964a6c79cdca669a08" }
ironrdp-rdpdr = { git = "https://github.com/Devolutions/IronRDP", rev = "c944674ecbb0952f9e7ecb964a6c79cdca669a08" }
ironrdp-rdpsnd = { git = "https://github.com/Devolutions/IronRDP", rev = "c944674ecbb0952f9e7ecb964a6c79cdca669a08" }
ironrdp-session = { git = "https://github.com/Devolutions/IronRDP", rev = "c944674ecbb0952f9e7ecb964a6c79cdca669a08" }
ironrdp-svc = { git = "https://github.com/Devolutions/IronRDP", rev = "c944674ecbb0952f9e7ecb964a6c79cdca669a08" }
ironrdp-tls = { git = "https://github.com/Devolutions/IronRDP", rev = "c944674ecbb0952f9e7ecb964a6c79cdca669a08", features = ["rustls"]}
ironrdp-tokio = { git = "https://github.com/Devolutions/IronRDP", rev = "c944674ecbb0952f9e7ecb964a6c79cdca669a08" }
ironrdp-cliprdr = { git = "https://github.com/Devolutions/IronRDP", rev = "a1d8bb246e69af3252dcae38497f495100775c93" }
ironrdp-connector = { git = "https://github.com/Devolutions/IronRDP", rev = "a1d8bb246e69af3252dcae38497f495100775c93" }
ironrdp-graphics = { git = "https://github.com/Devolutions/IronRDP", rev = "a1d8bb246e69af3252dcae38497f495100775c93" }
ironrdp-pdu = { git = "https://github.com/Devolutions/IronRDP", rev = "a1d8bb246e69af3252dcae38497f495100775c93" }
ironrdp-rdpdr = { git = "https://github.com/Devolutions/IronRDP", rev = "a1d8bb246e69af3252dcae38497f495100775c93" }
ironrdp-rdpsnd = { git = "https://github.com/Devolutions/IronRDP", rev = "a1d8bb246e69af3252dcae38497f495100775c93" }
ironrdp-session = { git = "https://github.com/Devolutions/IronRDP", rev = "a1d8bb246e69af3252dcae38497f495100775c93" }
ironrdp-svc = { git = "https://github.com/Devolutions/IronRDP", rev = "a1d8bb246e69af3252dcae38497f495100775c93" }
ironrdp-tls = { git = "https://github.com/Devolutions/IronRDP", rev = "a1d8bb246e69af3252dcae38497f495100775c93", features = ["rustls"]}
ironrdp-tokio = { git = "https://github.com/Devolutions/IronRDP", rev = "a1d8bb246e69af3252dcae38497f495100775c93" }
2 changes: 1 addition & 1 deletion build.assets/versions.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ GOLANGCI_LINT_VERSION ?= v1.57.1
NODE_VERSION ?= 20.11.1

# Run lint-rust check locally before merging code after you bump this.
RUST_VERSION ?= 1.71.1
RUST_VERSION ?= 1.77.0
WASM_PACK_VERSION ?= 0.12.1
LIBBPF_VERSION ?= 1.2.2
LIBPCSCLITE_VERSION ?= 1.9.9-teleport
Expand Down
18 changes: 12 additions & 6 deletions lib/srv/desktop/rdp/rdpclient/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use ironrdp_pdu::input::{InputEventError, MousePdu};
use ironrdp_pdu::mcs::DisconnectReason;
use ironrdp_pdu::rdp::capability_sets::MajorPlatformType;
use ironrdp_pdu::rdp::RdpError;
use ironrdp_pdu::{custom_err, function, PduError, PduParsing};
use ironrdp_pdu::{custom_err, function, PduError};
use ironrdp_rdpdr::pdu::efs::ClientDeviceListAnnounce;
use ironrdp_rdpdr::pdu::RdpdrPdu;
use ironrdp_rdpdr::Rdpdr;
Expand Down Expand Up @@ -209,6 +209,7 @@ impl Client {
connection_result.io_channel_id,
None,
None,
connection_result.connection_activation,
);

Ok(Self {
Expand Down Expand Up @@ -322,6 +323,13 @@ impl Client {
ProcessorOutput::Disconnect(reason) => {
return Ok(Some(reason));
}
ProcessorOutput::DeactivateAll(_) => {
// DeactivateAll is not implemented yet, but will
// be in the near future when resize support lands.
return Err(ClientError::InternalError(
"DeactivateAll not implemented".to_string(),
));
}
}
}
}
Expand Down Expand Up @@ -540,11 +548,9 @@ impl Client {
write_stream: &mut RdpWriteStream,
event: FastPathInputEvent,
) -> ClientResult<()> {
let mut data: Vec<u8> = Vec::new();
let input_pdu = FastPathInput(vec![event]);
input_pdu.to_buffer(&mut data)?;

write_stream.write_all(&data).await?;
write_stream
.write_all(&ironrdp_pdu::encode_vec(&FastPathInput(vec![event]))?)
.await?;
Ok(())
}

Expand Down
8 changes: 8 additions & 0 deletions web/packages/teleport/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,11 @@ then you can start your local development server:
```
$ yarn run start --target=https://example.com:3080/web
```

#### wasm-pack

The [`wasm-pack`](https://github.com/rustwasm/wasm-pack) version in [build.assets/Makefile](https://github.com/gravitational/teleport/blob/master/build.assets/versions.mk#L12) (search for `WASM_PACK_VERSION`) is required to build the WebAssembly module.

When calling `wasm-pack`, we set the environment variable `RUST_MIN_STACK=16777216`. This is necessary to avoid a `SIGSEGV` error when building the module on some systems.

`16777216` was chosen based on [the suggestion in the rust compiler error message](https://github.com/rust-lang/rust/blob/10a7aa14fed9b528b74b0f098c4899c37c09a9c7/compiler/rustc_driver_impl/src/signal_handler.rs#L104-L106) to double the [`DEFAULT_STACK_SIZE`](https://github.com/rust-lang/rust/blob/10a7aa14fed9b528b74b0f098c4899c37c09a9c7/compiler/rustc_interface/src/util.rs#L52) value.
4 changes: 2 additions & 2 deletions web/packages/teleport/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"start": "yarn build-wasm && vite",
"build-wasm": "wasm-pack build ./src/ironrdp --target web",
"build-wasm": "RUST_MIN_STACK=16777216 wasm-pack build ./src/ironrdp --target web",
"build": "yarn build-wasm && vite build",
"test": "npx jest",
"tdd": "jest . --watch"
Expand Down Expand Up @@ -35,4 +35,4 @@
"jest-websocket-mock": "^2.5.0",
"ts-loader": "^9.4.2"
}
}
}
Loading