Coder Social home page Coder Social logo

Comments (13)

Seeker14491 avatar Seeker14491 commented on August 15, 2024 1

That's because the currently released version of rustup is using v0.4.1 of this crate. There hasn't been a rustup release since I made the PR updating to v0.5.

from opener.

gdnathan avatar gdnathan commented on August 15, 2024 1

ooooh i get it, so this gonna be fixed when the pr is accepted, thanks for your time!

from opener.

Seeker14491 avatar Seeker14491 commented on August 15, 2024 1

I'm closing this issue. Feel free to make a new issue if this is still a problem with the current version of the library.

from opener.

Seeker14491 avatar Seeker14491 commented on August 15, 2024

@japrogramer continuing our discussion from rust-lang/rustup#1125, if you don't mind, I'd like you to check if my updated branch works for you by running the following commands.

First, confirm the bug triggers on the master branch:

git clone https://github.com/Seeker14491/opener.git
cd opener/opener-bin/
echo 'Hello' > index.html
cargo run -- index.html

If you get the message Opened path successfully., but nothing happens, you've triggered the bug.

Then, check if the inherit-stdio branch works correctly and opens your browser:

git checkout -f inherit-stdio
echo 'Hello' > index.html
cargo run -- index.html

from opener.

japrogramer avatar japrogramer commented on August 15, 2024

The first set of commands work.

▶ cargo run -- index.html                                                                     69%
   Compiling unicode-width v0.1.6
   Compiling rustc-demangle v0.1.16
   Compiling ansi_term v0.11.0
   Compiling cfg-if v0.1.10
   Compiling strsim v0.8.0
   Compiling vec_map v0.8.1
   Compiling opener v0.4.1 (/home/archangel/Code/Rust/opener/opener)
   Compiling libc v0.2.65
   Compiling bitflags v1.2.1
   Compiling textwrap v0.11.0
   Compiling atty v0.2.13
   Compiling backtrace-sys v0.1.32
   Compiling backtrace v0.3.40
   Compiling clap v2.33.0
   Compiling failure v0.1.6
   Compiling structopt v0.3.3
   Compiling opener-bin v0.1.0 (/home/archangel/Code/Rust/opener/opener-bin)
    Finished dev [unoptimized + debuginfo] target(s) in 13.75s
     Running `/home/archangel/Code/Rust/opener/target/debug/opener-bin index.html`
Opened path successfully.

and the second in the other branch also works

▶ cargo run -- index.html                                                                   67%
   Compiling proc-macro2 v1.0.6
   Compiling unicode-xid v0.2.0
   Compiling syn v1.0.5
   Compiling libc v0.2.65
   Compiling cc v1.0.46
   Compiling bitflags v1.2.1
   Compiling unicode-width v0.1.6
   Compiling unicode-segmentation v1.3.0
   Compiling failure_derive v0.1.6
   Compiling vec_map v0.8.1
   Compiling strsim v0.8.0
   Compiling rustc-demangle v0.1.16
   Compiling ansi_term v0.11.0
   Compiling cfg-if v0.1.10
   Compiling opener v0.4.1 (/home/archangel/Code/Rust/opener/opener)
   Compiling textwrap v0.11.0
   Compiling heck v0.3.1
   Compiling backtrace-sys v0.1.32
   Compiling atty v0.2.13
   Compiling clap v2.33.0
   Compiling quote v1.0.2
   Compiling backtrace v0.3.40
   Compiling proc-macro-error v0.2.6
   Compiling synstructure v0.12.1
   Compiling structopt-derive v0.3.3
   Compiling failure v0.1.6
   Compiling structopt v0.3.3
   Compiling opener-bin v0.1.0 (/home/archangel/Code/Rust/opener/opener-bin)
    Finished dev [unoptimized + debuginfo] target(s) in 28.58s
     Running `/home/archangel/Code/Rust/opener/target/debug/opener-bin index.html`
Opened path successfully.

but still this doesnt

rustup doc --std 
▶ rustup component add rust-docs                                                          
info: component 'rust-docs' for target 'x86_64-unknown-linux-gnu' is up to date
▶ uname -r; pacman -Q linux                                                                
5.3.6-arch1-1-ARCH
linux 5.3.7.arch1-1
▶ rustup --version                                                                         
rustup 1.20.2 (13979c968 2019-10-16)

from opener.

Seeker14491 avatar Seeker14491 commented on August 15, 2024

@japrogramer to be clear, the first set of commands opens your browser? If so, can you check if this command opens the docs in your browser (make sure to run on the master branch):

cargo run -- $(rustup doc --std --path)

If all these commands work fine, then maybe the problem really is in rustup.

from opener.

japrogramer avatar japrogramer commented on August 15, 2024

Yes they work, But the rustup doc command doesn't

Here the index page i created works and the one pointing to std doesnt

Rust/opener/opener-bin  master ✗                                                                18d ◒  ⍉
▶ cargo run -- index.html                                                                      ∞
    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
     Running `/home/archangel/Code/Rust/opener/target/debug/opener-bin index.html`
Opened path successfully.

Rust/opener/opener-bin  master ✗                                                                 18d ◒
▶ cargo run -- $(rustup doc --std --path)                                                       ∞
    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
     Running `/home/archangel/Code/Rust/opener/target/debug/opener-bin /home/archangel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/share/doc/rust/html/std/index.html`
Opened path successfully.

Rust/opener/opener-bin  master ✗                                                                 18d ◒
▶ rustup doc --std --path                                                                       ∞
/home/archangel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/share/doc/rust/html/std/index.html

both files have the same permissions, and the std/index.html does have content

from opener.

japrogramer avatar japrogramer commented on August 15, 2024

Works
strace -f -s100 cargo run -- index.html &> ~/errors.txt

Doesn't work
strace -f -s100 cargo run -- $(rustup doc --std --path) &> ~/errors2.txt

works

firefox $(rustup doc --std --path)

from opener.

julienp17 avatar julienp17 commented on August 15, 2024

Same issue here, the following works

firefox $(rustup doc --path)

but not

firefox $(rustup doc)

which opens KTorrent for me. I followed some instructions from rustup doc appears to do nothing #1125, by removing

[Default Applications]
text/html=ktorrent.desktop

from ~/.config/mimeapps.list and replacing it with text/html=firefox.desktop but it didn't fix the issue.

My config:
5.5.3-arch1-1
linux 5.5.3.arch1-1
rustup 1.21.1 (2020-01-25)
rust-docs up to date

from opener.

Seeker14491 avatar Seeker14491 commented on August 15, 2024

I was never able to reproduce this issue locally, unfortunately. Anyways, I released v0.5 of this crate about two weeks ago, and it changes the strategy on Linux such that the system xdg-open is tried first if available. I'd like to know if this is still a problem with the new version. Note that a version of Rustup with the updated opener version still hasn't shipped, so to test this, a procedure like I described in #4 (comment) can be used.

from opener.

gdnathan avatar gdnathan commented on August 15, 2024

as asked in here, i'll respond to this.

I use WSL, and xdg-open-wsl (which i can call with xdg-open on my system

from opener.

Seeker14491 avatar Seeker14491 commented on August 15, 2024

@Erudyx Ah, WSL should work fine with the release of v0.5. Still, if you want to confirm it's fixed now you can run what I posted above:

git clone https://github.com/Seeker14491/opener.git
cd opener/opener-bin/
echo 'Hello' > index.html
cargo run -- index.html

from opener.

gdnathan avatar gdnathan commented on August 15, 2024

Its working fine, but i dont i dont know why rustup doc --book does nothing... no error printed, return 0...

from opener.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.