News for hackers. Stuff that matters.
Re:Difftastic: A diff that understands syntax by loxias on Tuesday March 29, 2022 @08:36AM (#30841693)
This looks really cool and I can't wait to try it, tho... a bit of a PITA to get running. ;) Took a while to figure out how to build, and had to install 400MB of dependencies first....

Edit: And after installing cargo, watching it fail to build, then determining I must need a newer version of cargo, so I built that from source... it fails. Apparently I need to install `rustc-mozilla` and not `rustc`. "obviously".

This is all a testament to how much I want to try this tool...

MOAR EDIT: even with rustc-mozilla cargo fails to build. running `cargo install difftastic` gives me an error about my version of cargo being too old ;.;

Dear author: Let us run your tool.

Re:Difftastic: A diff that understands syntax by gkfasdfasdf on Tuesday March 29, 2022 @10:08AM (#30842720)
Using ubuntu 20.04, I first installed cargo:

  curl https://sh.rustup.rs -sSf | sh
Restart shell to get $HOME/.cargo/bin in PATH, then did:

  cargo install difftastic
And ~4 minutes later, difft executable is ready.

Agree though that some pre-built binaries would be fantastic!

Re:Difftastic: A diff that understands syntax by loxias on Tuesday March 29, 2022 @10:18AM (#30842835)
Ah, well, if you're willing to accept having a frankensystem with a mix of packaged and unpackaged software, sure. ;) I used to do that, back in Slackware days.

It's considered really sloppy and unmaintainable to admin a system like that. Things quickly get out of hand.

That strategy _does_ work if you isolate it to a chroot or a container, but littering /usr/local with all sorts of locally compiled upstream is just asking for future pain. Security updates, library incompatibilities, &c.

Prebuilt binaries might be nice, but I don't expect them for random projects. (and I wouldn't have used them if offered) I do think it's a reasonable expectation to be able to build software w/o essentially setting up a new userland just for that tool though. :)

Re:Difftastic: A diff that understands syntax by gkfasdfasdf on Tuesday March 29, 2022 @11:09AM (#30843587)
The method I posted above doesn't write anything to /usr/local. Root isn't required. Everything is written under ~.
Re:Difftastic: A diff that understands syntax by loxias on Tuesday March 29, 2022 @11:31AM (#30843924)
Whoa really?

I'm sorry, and retract my ignorant assumption! Going to try it out now.

Re:Difftastic: A diff that understands syntax by Wilfred on Tuesday March 29, 2022 @12:42PM (#30844954)
There are a few packages available, e.g. https://aur.archlinux.org/packages/difftastic and https://pkgsrc.se/wip/difftastic.

I've also had requests from Alpine Linux packagers to allow dynamic linking to parsers. This is something I want to support in future, once I'm happy with the basic diffing logic.

Re:Difftastic: A diff that understands syntax by jeremyjh on Tuesday March 29, 2022 @10:38AM (#30843117)
I agree it leads to problems but isn't the entire purpose of `/usr/local` to be a dumping ground for locally administered (unpackaged) programs?
Re:Difftastic: A diff that understands syntax by vlunkr on Tuesday March 29, 2022 @01:57PM (#30846132)
A huge part of the appeal of Rust and Go tools is that you can just ship a binary, it's frustrating that it's not available here.
Re:Difftastic: A diff that understands syntax by easrng on Tuesday March 29, 2022 @08:47PM (#30850271)
Not sure about Go, but Rust still links against glibc, so I sometimes have to recompile things to make them work on my Debian systems if they're built against newer glibc.
Re:Difftastic: A diff that understands syntax by pinsl on Saturday April 02, 2022 @09:32AM (#30888143)
Re:Difftastic: A diff that understands syntax by ducktective on Tuesday March 29, 2022 @01:24PM (#30845651)
Same here. Looked into repo -> no binary in release or Github actions

spinned up a Ubuntu 18.04 instance -> git clone, git checkout 0.24.0

installed rust using curl | sh method

build fails:

https://termbin.com/29xy

removed the instance and gonna check it again 6 months later

Re:Difftastic: A diff that understands syntax by adwn on Tuesday March 29, 2022 @01:38PM (#30845856)
In another comment you're asking about vim support. So let me get this straight: You're using vim, yet you're unable to resolve the error message

    = note: /usr/bin/ld: cannot find Scrt1.o: No such file or directory
            /usr/bin/ld: cannot find crti.o: No such file or directory
Have you tried googling for "ubuntu crti.o: No such file or directory" ?
Re:Difftastic: A diff that understands syntax by joemi on Tuesday March 29, 2022 @02:09PM (#30846285)
Using vim has nothing to do with ones ability to troubleshoot compiler/ubuntu issues. Plus both compiler and ubuntu issues can be massive PITA to solve even if you're familiar with them. Personally, if I'm trying to install something on whim to try it out and I start getting "no such file or directory" errors I'd be upset that something is going wrong.
Re:Difftastic: A diff that understands syntax by ducktective on Tuesday March 29, 2022 @02:15PM (#30846362)
>Have you tried googling for "ubuntu crti.o: No such file or directory" ?

Depending on the project, there is a certain threshold of trying-to-make-something-work which I'm willing to undertake in order to test an app.

But you are right. I'm sorry if my OG comment may come arrogant to the devs who do stuff for free. (♥ to the devs)

[edit]: ok, I tried again, `sudo apt update && sudo apt install build-essential` before installing rust and `cargo install`ing.

Error again:

https://dpaste.com/FTG7FSRQF

Re:Difftastic: A diff that understands syntax by jbrr25 on Wednesday March 30, 2022 @01:21PM (#30858140)
The GCC version in Ubuntu 18.04 is too old. I had the same problem, I just installed clang, updated the default c++ and it worked. There is an issue in the repo about that.
Re:Difftastic: A diff that understands syntax by estebank on Tuesday March 29, 2022 @03:34PM (#30847297)
Funnily enough, the error is in a C dependency providing Haskell support.

    vendor/tree-sitter-haskell-src/scanner.cc
Re:Difftastic: A diff that understands syntax by unhammer on Wednesday March 30, 2022 @05:09AM (#30852938)
If you have nix (package manager) installed, it takes like half a second. For tools I want to install through nixpkgs I make a starter like this:

    $ cat /usr/local/bin/difftastic
    #!/bin/sh
    source $HOME/.nix-profile/etc/profile.d/nix.sh
    nix run nixpkgs.difftastic -c difftastic "$@"
and then it'll install on first run:

    $ difftastic
    these paths will be fetched (1.17 MiB download, 9.38 MiB unpacked):
      /nix/store/wn74xn0w60xcwsly6nqaibn205hh2qms-difftastic-0.8
    copying path '/nix/store/wn74xn0w60xcwsly6nqaibn205hh2qms-difftastic-0.8' from 'https://cache.nixos.org'...
    Difftastic 0.8.0
    Wilfred Hughes
    A syntax aware diff.
    
    USAGE:
    [etc.]
Re:Difftastic: A diff that understands syntax by YetAnotherNick on Tuesday March 29, 2022 @08:40AM (#30841737)
Used `cargo install difftastic`? Finished in a minute for me.
Re:Difftastic: A diff that understands syntax by lopatin on Tuesday March 29, 2022 @08:51AM (#30841829)
Build errors for me. Apparently I'm on some nightly build of cargo, but I need 2021 version. The pain begins...

Edit: Reinstalling Cargo worked!

Re:Difftastic: A diff that understands syntax by skywal_l on Tuesday March 29, 2022 @09:26AM (#30842237)
With rustup, it's pretty easy to update/change your cargo version.
Re:Difftastic: A diff that understands syntax by loxias on Tuesday March 29, 2022 @09:37AM (#30842360)
How did you do it? When I tried to rebuild cargo I got build errors. I'm starting to suspect the only way to run this tool is make a chroot tracking sid or something....
Re:Difftastic: A diff that understands syntax by lopatin on Tuesday March 29, 2022 @09:59AM (#30842605)
I just followed the installation instructions here: https://doc.rust-lang.org/cargo/getting-started/installation...

It'll confirm that you want to install it, because it's already installed I think, and I just selected 1. for Yes.

Re:Difftastic: A diff that understands syntax by loxias on Tuesday March 29, 2022 @10:21AM (#30842868)
> curl https://sh.rustup.rs -sSf | sh

hard pass :)

Re:Difftastic: A diff that understands syntax by adwn on Tuesday March 29, 2022 @11:50AM (#30844157)
> hard pass

Why? You're willing to run some random open source project, but you're not willing to run the official Rust installation script?

Re:Difftastic: A diff that understands syntax by chlorion on Tuesday March 29, 2022 @11:04PM (#30851141)
I feel the same way, I am just not willing to pipe curl into a shell blindly.

Even if this specific instance of curl'ing into sh is safe, or if I download and then run it, it's still extremely poor practice and gives me serious doubts about the developers and their security practices in general.

I also do not like when every project decides to poorly reimplement the package manager. If every software used it's own package manager my system would be a complete mess with dozens of different package managers fighting each other and it would be a total nightmare to update the system or manage non-trivial dependency chains when installing something new.

Rust is one of my favorite languages but this is definitely my least favorite aspect of it all. It really feels like the developers "optimized" for systems with no package manager.

Re:Difftastic: A diff that understands syntax by a_passable_dev on Tuesday March 29, 2022 @03:05PM (#30846961)
Out of curiosity, what would be an acceptable way for the developers to provide a quick way for users to get up and running?

A get started guide with all the required commands easily copy-pastable? (A popular option these days) Something else?

I don’t mean to be critical, I’m simply curious.

Re:Difftastic: A diff that understands syntax by DangitBobby on Tuesday March 29, 2022 @07:13PM (#30849544)
You could always download it first and eyeball it before running it.
Re:Difftastic: A diff that understands syntax by loxias on Tuesday March 29, 2022 @08:52AM (#30841838)
Sure, but first I had to figure out wtf "cargo" is. :P

Also, `cargo install difftastic` AIUI pulls it from a central location, if I'm gonna poke at software for the first time, I enjoy building it myself first, so I can get my hands dirty in the source. :)

EDIT: Also, the build fails. :(

"error: unexpected token: `include_str` --> /home/loxias/.cargo/registry/src/github.com-1ecc6299db9ec823/radix-heap-0.4.2/src/lib.rs:2:10 | 2 | #![doc = include_str!("../README.md")] | ^^^^^^^^^^^

error: aborting due to previous error

error: could not compile `radix-heap`.

sad trombone

Re:Difftastic: A diff that understands syntax by Wilfred on Tuesday March 29, 2022 @04:14PM (#30847794)
This looks like you're using a version of Rust older than the minimum required (1.56).
Re:Difftastic: A diff that understands syntax by Wilfred on Tuesday March 29, 2022 @12:15PM (#30844505)
The getting started section of the manual should help: https://difftastic.wilfred.me.uk/getting_started.html

I've documented the minimum rust version required today, although I'm looking at lowering the minimum version.

Re:Difftastic: A diff that understands syntax by estebank on Wednesday March 30, 2022 @12:57PM (#30857820)
Honest question: how did you arrive to the conclusion you needed rustc-mozilla? I would love to make sure whatever flow led you to that is made clearer for other newcomers, because that is definitely not something anyone that isn't working on Firefox should even try.
Re:Difftastic: A diff that understands syntax by Wilfred on Wednesday March 30, 2022 @05:26PM (#30860984)
I imagine it's a misunderstanding with the rustc-hash dependency used in difftastic for faster hashing.