Repository navigation
Tools: Open the browser on Linux without stopping on an xdg-open error - #2386
Merged
Merged
Conversation
hxp 1.3.1's System.openURL() runs xdg-open with the URL and a literal "&" as two arguments, since it runs the command without a shell. xdg-open rejects the extra argument, and the failed command stops the tools. This went unnoticed while http-server opened the browser itself; the CrossByte server calls openURL(), so lime test html5 on Linux now stops before serving. Projects with an app.url hit it on HTML5 and Flash already. The new CommandHelper.openURL() runs xdg-open through the shell, in the background, with the URL quoted for the shell and its output discarded. Windows and macOS still go through hxp. The web server, HTML5Helper and FlashPlatform use it.
…'s only argument OpenURLTest puts a stand-in xdg-open first on the PATH, which records its arguments and takes 5 seconds to exit, and checks that CommandHelper.openURL() passes the URL, with & and quotes in it, as the only argument and returns without waiting. It runs in the tools tests of the Linux job and passes trivially elsewhere.
…en-browser # Conflicts: # src/lime/tools/CommandHelper.hx
Member
Author
|
Merged develop after #2389, which added |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
lime test html5on Linux stops right after starting the test server withxdg-open: unexpected argument '&', so the page can't even be opened by hand. hxp 1.3.1'sSystem.openURL()passes the URL and a literal&to xdg-open as two arguments, since it runs the command without a shell, and the failed command stops the tools. The bug has been in hxp for years; it surfaced now because http-server used to open the browser itself, and the CrossByte server callsopenURL(). Projects with anapp.urlhit it on HTML5 and Flash in 8.3 already.CommandHelper.openURL()runs xdg-open through the shell with the URL quoted, in the background, with its output discarded, and a failure no longer stops the tools. Windows and macOS still go through hxp.WebServer,HTML5HelperandFlashPlatformuse it. The same fix for hxp is openfl/hxp#44; once Lime depends on an hxp release with it, this can go back toSystem.openURL().The Tests commit adds
OpenURLTestto the tools tests: a stand-in xdg-open first on thePATHrecords its arguments and takes 5 seconds to exit, and the test checks that the URL, with&and quotes in it, is the only argument and thatopenURL()returns without waiting. It runs in the Linux job and passes trivially on Windows and macOS. Locally (Windows) the tools tests pass and the tools compile; the shell command and the stand-in script were also run throughshwith the same results the test expects. Not run on a Linux desktop with a real browser.