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

Redirect stdout/stderr on windows #23922

Merged
merged 1 commit into from Aug 10, 2019
Merged

Redirect stdout/stderr on windows #23922

merged 1 commit into from Aug 10, 2019

Conversation

@angelortiz1007
Copy link
Contributor

angelortiz1007 commented Aug 6, 2019

Added function redirect_stdout_stderr() to support stdout & stderr to be redirected to OutputDebugStringA().


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #23734 (GitHub issue number if applicable)
  • There are tests for these changes OR
    Functionality was verified by adding logic in unsafe fn init(). By building and running ServoApp, If redirect_stdout_stderr() failed, a warn!() message would be sent to the "output" window of VS2007 with the GetLastError() value. If the function redirect_stdout_stderr() succeeded, the println!("Capi/lib.rs: init() function called redirect_stdout_stderr() successfully.\n") output would be seen in the "output" window of VS2007.

  • These changes do not require tests because ___


This change is Reviewable

@angelortiz1007
Copy link
Contributor Author

angelortiz1007 commented Aug 6, 2019

Sorry, to add issue 23734.

@jdm jdm changed the title Added support for stdout/stderr (ref issue# 23734) to be redirected t… Redirect stdout/stderr on windows Aug 6, 2019
@angelortiz1007 angelortiz1007 force-pushed the angelortiz1007:redir branch from 326baf4 to 02cfba6 Aug 6, 2019
ports/libsimpleservo/capi/Cargo.toml Outdated Show resolved Hide resolved
ports/libsimpleservo/capi/src/lib.rs Outdated Show resolved Hide resolved
ports/libsimpleservo/capi/src/lib.rs Outdated Show resolved Hide resolved
ports/libsimpleservo/capi/src/lib.rs Outdated Show resolved Hide resolved
ports/libsimpleservo/capi/src/lib.rs Outdated Show resolved Hide resolved
ports/libsimpleservo/capi/src/lib.rs Outdated Show resolved Hide resolved
ports/libsimpleservo/capi/src/lib.rs Outdated Show resolved Hide resolved
ports/libsimpleservo/capi/src/lib.rs Outdated Show resolved Hide resolved
ports/libsimpleservo/capi/src/lib.rs Outdated Show resolved Hide resolved
@jdm jdm self-assigned this Aug 7, 2019
@angelortiz1007
Copy link
Contributor Author

angelortiz1007 commented Aug 7, 2019

@angelortiz1007
Copy link
Contributor Author

angelortiz1007 commented Aug 7, 2019

ports/libsimpleservo/capi/src/lib.rs Outdated Show resolved Hide resolved
ports/libsimpleservo/capi/src/lib.rs Outdated Show resolved Hide resolved
@angelortiz1007
Copy link
Contributor Author

angelortiz1007 commented Aug 7, 2019

ports/libsimpleservo/capi/src/lib.rs Outdated Show resolved Hide resolved
ports/libsimpleservo/capi/src/lib.rs Outdated Show resolved Hide resolved
ports/libsimpleservo/capi/src/lib.rs Outdated Show resolved Hide resolved
@jdm
Copy link
Member

jdm commented Aug 7, 2019

Looks good! Please squash and we can merge them.

@jdm jdm added S-needs-squash and removed S-awaiting-review labels Aug 7, 2019
@angelortiz1007 angelortiz1007 force-pushed the angelortiz1007:redir branch from c078451 to cd4d901 Aug 7, 2019
@angelortiz1007
Copy link
Contributor Author

angelortiz1007 commented Aug 7, 2019

Squash complete. Thanks for reviewing and all the comments.

Copy link
Member

jdm left a comment

The CI problems are caused by the job exceeding the timeout because we rebuild Servo from scratch twice.

@@ -17,6 +17,10 @@ simpleservo = { path = "../api" }
log = "0.4"
env_logger = "0.6"

[target.'cfg(target_os = "windows")'.dependencies]
libc = "0.2"
winapi = {version = "0.3.7", features = ["winnt", "winbase", "processenv", "namedpipeapi", "ntdef", "minwindef", "handleapi", "debugapi"]}

This comment has been minimized.

@jdm

jdm Aug 9, 2019

Member

Could you change thus to "0.3" instead? I think we're using a different version here than the rest of Servo and we end up rebuilding everything.

This comment has been minimized.

@angelortiz1007

angelortiz1007 Aug 9, 2019

Author Contributor

Will work on it ASAP.

This comment has been minimized.

@jdm

jdm Aug 9, 2019

Member

Ok, so it's not that. We should duplicate this list of features to

winapi = { version = "0.3", features = ["wingdi", "winuser"] }
(keeping the existing features) and add windgi and winuser to this list. That will unify the features enabled across all builds, which sucks but will improve the build situation.

This comment has been minimized.

@angelortiz1007

angelortiz1007 Aug 9, 2019

Author Contributor

Ok to leave version at "0.3.7" and add the 2 features?

This comment has been minimized.

@jdm

jdm Aug 9, 2019

Member

I think we need to add the two features to the libsimpleservo/capi/Cargo.toml, and add all the other features to glutin/Cargo.toml.

This comment has been minimized.

@angelortiz1007

angelortiz1007 Aug 9, 2019

Author Contributor

Sounds good. Added the additional features to glutin/Cargo.toml. Building to verify.

@angelortiz1007 angelortiz1007 force-pushed the angelortiz1007:redir branch from cd4d901 to 16d9b8b Aug 9, 2019
…o OutputDebugStringA().
@angelortiz1007 angelortiz1007 force-pushed the angelortiz1007:redir branch from 16d9b8b to 2bd2281 Aug 9, 2019
@angelortiz1007
Copy link
Contributor Author

angelortiz1007 commented Aug 9, 2019

Squashed/Rebased new commit with the changes to the Cargo.toml files.

@jdm
Copy link
Member

jdm commented Aug 9, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Aug 9, 2019

📌 Commit 2bd2281 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Aug 9, 2019

Testing commit 2bd2281 with merge a223ffa...

bors-servo added a commit that referenced this pull request Aug 9, 2019
Redirect stdout/stderr on windows

Added function redirect_stdout_stderr() to support stdout & stderr to be redirected to OutputDebugStringA().

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `23734` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #23734 (GitHub issue number if applicable)

<!-- Either: -->
- [X] There are tests for these changes OR
Functionality was verified by adding logic in unsafe fn init().  By building and running ServoApp, If  redirect_stdout_stderr() failed, a warn!() message would be sent to the "output" window of VS2007 with the GetLastError() value.   If the function redirect_stdout_stderr() succeeded, the println!("Capi/lib.rs: init() function called redirect_stdout_stderr() successfully.\n") output would be seen in the "output" window of VS2007.

- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23922)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Aug 9, 2019

💔 Test failed - status-taskcluster

@Manishearth
Copy link
Member

Manishearth commented Aug 10, 2019

@bors-servo retry



Tests with unexpected results:
  ▶ FAIL [expected PASS] /css/CSS2/backgrounds/background-color-023.xht
  └   → /css/CSS2/backgrounds/background-color-023.xht 06890d7bc181367ac440b551bd122cd8099d0e98
/css/CSS2/backgrounds/background-color-013-ref.xht e6fad0917cd55322ee51fe64d7a5ed32591f3950

  ▶ Unexpected subtest result in /fetch/content-type/response.window.html:
  └ PASS [expected FAIL] <iframe>: combined response Content-Type: text/html */*

  ▶ Unexpected subtest result in /fetch/content-type/response.window.html:
  └ PASS [expected FAIL] <iframe>: combined response Content-Type: */* text/html

  ▶ Unexpected subtest result in /fetch/content-type/response.window.html:
  └ PASS [expected FAIL] <iframe>: separate response Content-Type: text/plain */*;charset=gbk

  ▶ Unexpected subtest result in /fetch/content-type/response.window.html:
  └ PASS [expected FAIL] <iframe>: separate response Content-Type: text/html;" text/plain

  ▶ Unexpected subtest result in /fetch/content-type/response.window.html:
  │ FAIL [expected PASS] <iframe>: combined response Content-Type: text/html;" text/plain
  │   → assert_equals: expected (string) "b" but got (undefined) undefined
  │ 
  │ runFrameTest/</frame.onload<@http://web-platform.test:8000/fetch/content-type/response.window.js:30:9
  │ Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:1611:25
  └ Test.prototype.step_func_done/<@http://web-platform.test:8000/resources/testharness.js:1651:32

  ▶ Unexpected subtest result in /workers/WorkerGlobalScope-close.html:
  │ FAIL [expected PASS] Test sending a message after closing.
  │   → assert_not_equals: got disallowed value "pong"
  │ 
  │ worker.onmessage</worker.onmessage<@http://web-platform.test:8000/workers/WorkerGlobalScope-close.html:28:7
  │ Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:1611:25
  └ Test.prototype.step_func/<@http://web-platform.test:8000/resources/testharness.js:1635:35

  ▶ Unexpected subtest result in /fetch/content-type/script.window.html:
  │ FAIL [expected PASS] separate text/javascript error
  └   → assert_unreached: Reached unreachable code

  ▶ Unexpected subtest result in /fetch/nosniff/parsing-nosniff.window.html:
  └ PASS [expected FAIL] X-Content-Type-Options%3A%20'NosniFF'

  ▶ Unexpected subtest result in /html/semantics/scripting-1/the-script-element/execution-timing/077.html:
  │ FAIL [expected PASS]  adding several types of scripts through the DOM and removing some of them confuses scheduler 
  │   → assert_array_equals: property 1, expected "Script #1 ran" but got "Script #3 ran"
  │ 
  │ test/<@http://web-platform.test:8000/html/semantics/scripting-1/the-script-element/execution-timing/077.html:30:48
  │ Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:1611:25
  └ Test.prototype.step_func/<@http://web-platform.test:8000/resources/testharness.js:1635:35
@bors-servo
Copy link
Contributor

bors-servo commented Aug 10, 2019

Testing commit 2bd2281 with merge b3c0ed2...

bors-servo added a commit that referenced this pull request Aug 10, 2019
Redirect stdout/stderr on windows

Added function redirect_stdout_stderr() to support stdout & stderr to be redirected to OutputDebugStringA().

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `23734` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #23734 (GitHub issue number if applicable)

<!-- Either: -->
- [X] There are tests for these changes OR
Functionality was verified by adding logic in unsafe fn init().  By building and running ServoApp, If  redirect_stdout_stderr() failed, a warn!() message would be sent to the "output" window of VS2007 with the GetLastError() value.   If the function redirect_stdout_stderr() succeeded, the println!("Capi/lib.rs: init() function called redirect_stdout_stderr() successfully.\n") output would be seen in the "output" window of VS2007.

- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23922)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Aug 10, 2019

☀️ Test successful - linux-rel-css, linux-rel-wpt, status-taskcluster
Approved by: jdm
Pushing b3c0ed2 to master...

@bors-servo bors-servo merged commit 2bd2281 into servo:master Aug 10, 2019
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
Taskcluster (pull_request) TaskGroup: success
Details
homu Test successful
Details
bors-servo added a commit that referenced this pull request Aug 12, 2019
Immersive WebXR on Hololens

This PR adds support to the OpenXR backend (servo/webxr#37) for Hololens. We support _entering_ immersive mode, but currently do nothing in immersive mode (servo/webxr#38, applying https://github.com/servo/webxr/tree/d3d11-draw should render some red).

This should be ready to land as-is aside from its dependency on #23922. It can be tested on https://manishearth.github.io/webgl-to-webxr/webxr-ar.html (make sure to click through the alerts).

This is based on #23922 .

This builds off of @paulrouget's work.

r? @jdm @paulrouget

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23945)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this pull request Aug 12, 2019
Immersive WebXR on Hololens

This PR adds support to the OpenXR backend (servo/webxr#37) for Hololens. We support _entering_ immersive mode, but currently do nothing in immersive mode (servo/webxr#38, applying https://github.com/servo/webxr/tree/d3d11-draw should render some red).

This should be ready to land as-is aside from its dependency on #23922. It can be tested on https://manishearth.github.io/webgl-to-webxr/webxr-ar.html (make sure to click through the alerts).

This is based on #23922 .

This builds off of @paulrouget's work.

r? @jdm @paulrouget

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23945)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this pull request Aug 12, 2019
Immersive WebXR on Hololens

This PR adds support to the OpenXR backend (servo/webxr#37) for Hololens. We support _entering_ immersive mode, but currently do nothing in immersive mode (servo/webxr#38, applying https://github.com/servo/webxr/tree/d3d11-draw should render some red).

This should be ready to land as-is aside from its dependency on #23922. It can be tested on https://manishearth.github.io/webgl-to-webxr/webxr-ar.html (make sure to click through the alerts).

This is based on #23922 .

This builds off of @paulrouget's work.

r? @jdm @paulrouget

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23945)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this pull request Aug 13, 2019
Immersive WebXR on Hololens

This PR adds support to the OpenXR backend (servo/webxr#37) for Hololens. We support _entering_ immersive mode, but currently do nothing in immersive mode (servo/webxr#38, applying https://github.com/servo/webxr/tree/d3d11-draw should render some red).

This should be ready to land as-is aside from its dependency on #23922. It can be tested on https://manishearth.github.io/webgl-to-webxr/webxr-ar.html (make sure to click through the alerts).

This is based on #23922 .

This builds off of @paulrouget's work.

r? @jdm @paulrouget

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23945)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

6 participants
You can’t perform that action at this time.