Giter Club home page Giter Club logo

Comments (7)

imatpot avatar imatpot commented on May 18, 2024 3

I might know what is causing this. I got a very similar error because I didn't have Git installed. In cli/build.rs there is a line that tries to fetch the current Git revision to add to the environment. This also causes problems when you build Typst in a non-repository (ergo a directory without a .git) as the truncation on line 7 of that same file panics.

This makes Git an undocumented de-facto dependency of Typst, which I personally don't think is good. The revision is also only ever used in println!() statements, which don't really add any benefit apart from development.

from typst.

xkevio avatar xkevio commented on May 18, 2024 2

From what I've gathered, they are working on removing those git dependencies to be able to package it properly.
That way, it'll soon be just a simple cargo install typst away, the crate name is already reserved.

from typst.

laurmaedje avatar laurmaedje commented on May 18, 2024 1

I pushed a fix for this. When git is unavailable, the build script fails gracefully now.

from typst.

 avatar commented on May 18, 2024

I might know what is causing this. I got a very similar error because I didn't have Git installed. In cli/build.rs there is a line that tries to fetch the current Git revision to add to the environment. This also causes problems when you build Typst in a non-repository (ergo a directory without a .git) as the truncation on line 7 of that same file panics.

@imatpot thanks for chasing this down, you are a cool guy :)

This makes Git an undocumented de-facto dependency of Typst, which I personally don't think is good. The revision is also only ever used in println!() statements, which don't really add any benefit apart from development.

I strongly agree with this paragraph. The whole reason I came to Typst, is because I hate the bloated and complicated process of setting up a LaTeX environment. The smaller, less dependencies, and simpler/faster the build process can be, the better. So to anyone listening, please remove the Git requirement, unless its absolutely needed.

from typst.

 avatar commented on May 18, 2024

I pushed a fix for this. When git is unavailable, the build script fails gracefully now.

confirmed thanks! @laurmaedje, can you clarify what process is used for building the release? I did this:

cargo build -p typst-cli --release

then ran strip on the result, and the executable is still 22.4 MB. compared to this:

https://github.com/typst/typst/releases/download/22-03-21-2/typst-x86_64-pc-windows-msvc.zip

which when extracted is 17.8 MB. or this:

https://github.com/typst/typst/releases/download/22-03-21/typst-x86_64-pc-windows-msvc.zip

which is only 11.2 MB.

from typst.

laurmaedje avatar laurmaedje commented on May 18, 2024

It shouldn't do anything special. You can see all steps here: https://github.com/typst/typst/blob/main/.github/workflows/release.yml

from typst.

 avatar commented on May 18, 2024

looks like building without fonts:

cargo build -p typst-cli --release --no-default-features

and then strip typst reduces down to 15.8 MB. good enough!

from typst.

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.