Package Details: crowbook 0.16.1-0

Git Clone URL: https://aur.archlinux.org/crowbook.git (read-only, click to copy)
Package Base: crowbook
Description: Converts books written in Markdown to HTML, LaTeX/PDF and EPUB
Upstream URL: https://github.com/lise-henry/crowbook
Licenses: LGPL
Submitter: stefan0xC
Maintainer: stefan0xC
Last Packager: stefan0xC
Votes: 1
Popularity: 0.000000
First Submitted: 2020-08-29 23:50 (UTC)
Last Updated: 2023-08-04 02:35 (UTC)

Dependencies (2)

Required by (0)

Sources (1)

Latest Comments

dreieck commented on 2022-10-16 19:11 (UTC) (edited on 2022-10-18 10:04 (UTC) by dreieck)

~git needs to be a make dependency since you download the source via git.~

↑ Addendum: OK, you changed now the source URL to a .tar.gz download. Also a way to solve the problem, and this also allows for checksum test ;-). Thanks!

dreieck commented on 2022-10-16 18:32 (UTC)

Ahoj @stefan0xC,

yes, → the error[E0512] problem is gone now, thanks.

I also added to the PKGBUILD (needs to be put inside the functions, since $srcdir is only defined within them)

export CARGO_HOME="${srcdir}/cargo"

so not ~/.cargo gets cluttered but everything stays nicely self-contained within $srcdir. → PKGBUILD patch, → PKGBUILD.

Regarding → the older issue with the linking:

I have added -ffat-lto-objects to the CFLAGS (why are the CFLAGS important if rust is used as a compiler?), compilation works now for me.

Regards!

stefan0xC commented on 2022-10-16 10:33 (UTC) (edited on 2022-10-16 10:49 (UTC) by stefan0xC)

@dreieck: This is due to a breaking change in rust 1.64. So we have to update the dependencies. Can you check if it builds for you now and maybe also report the issue upstream? I think the issue is already fixed in the main branch so we'd just need a new release.

dreieck commented on 2022-10-15 14:58 (UTC) (edited on 2022-10-15 14:58 (UTC) by dreieck)

Now I get another error, which seems to be an upstream error:

Build fails for me with error[E0512]: cannot transmute between types of different sizes, or dependently-sized types:

==> Starting build()...
   Compiling libc v0.2.71
   Compiling cfg-if v0.1.10
[...]
   Compiling backtrace v0.3.49
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
   --> /[...]/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.3.12/src/sockaddr.rs:176:9
    |
176 |         mem::transmute::<SocketAddrV4, sockaddr_in>(v4);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: source type: `SocketAddrV4` (48 bits)
    = note: target type: `sockaddr_in` (128 bits)

For more information about this error, try `rustc --explain E0512`.
error: could not compile `socket2` due to previous error
warning: build failed, waiting for other jobs to finish...
==> ERROR: A failure occurred in build().

Output of rustc --explain E0512:

Transmute with two differently sized types was attempted.

Erroneous code example:

```
fn takes_u8(_: u8) {}

fn main() {
    unsafe { takes_u8(::std::mem::transmute(0u16)); }
    // error: cannot transmute between types of different sizes,
    //        or dependently-sized types
}
```

Please use types with same size or use the expected type directly. Example:

```
fn takes_u8(_: u8) {}

fn main() {
    unsafe { takes_u8(::std::mem::transmute(0i8)); } // ok!
    // or:
    unsafe { takes_u8(0u8); } // ok!
}
```

Regards!

stefan0xC commented on 2022-09-19 04:32 (UTC)

Can you try with either adding -ffat-lto-objects or removing -flto from CFLAGS?

dreieck commented on 2022-09-18 16:05 (UTC) (edited on 2022-09-18 16:06 (UTC) by dreieck)

Did you change some compiler flags?

Yes:

In /etc/makepkg.conf:

  • CFLAGS=" -g0 -march=x86-64 -mtune=native -O3 -flto -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fomit-frame-pointer -fPIC"
  • CXXFLAGS="-g0 -march=x86-64 -mtune=native -O3 -flto -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fomit-frame-pointer -fPIC -fpermissive"
  • RUSTFLAGS="-C opt-level=3 -C debuginfo=0"
  • LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu"
  • CGO_CPPFLAGS="${CPPFLAGS}"
  • CGO_CFLAGS="${CFLAGS}"
  • CGO_CXXFLAGS="${CXXFLAGS}"
  • CGO_LDFLAGS="${LDFLAGS}"
  • GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
  • MAKEFLAGS="-j4"
  • DEBUG_CFLAGS=" -Og -fno-lto -gdwarf-5 -ggdb -gno-strict-dwarf -g3 -gpubnames -grecord-gcc-switches -fno-eliminate-unused-debug-symbols -fvar-tracking -fvar-tracking-assignments -fdebug-types-section -fno-stack-protector -fno-omit-frame-pointer -D_FORTIFY_SOURCE=0 -DDEBUG"
  • DEBUG_CXXFLAGS="-Og -fno-lto -gdwarf-5 -ggdb -gno-strict-dwarf -g3 -gpubnames -grecord-gcc-switches -fno-eliminate-unused-debug-symbols -fvar-tracking -fvar-tracking-assignments -fdebug-types-section -fno-stack-protector -fno-omit-frame-pointer -D_FORTIFY_SOURCE=0 -DDEBUG"
  • DEBUG_RUSTFLAGS="-C opt-level=0 -C debuginfo=2"
  • DEBUG_LDFLAGS="${_LDFLAGS}"
  • DEBUG_MAKEFLAGS="-j1 V=sc"

If I set

export LDFLAGS=''
export RUSTFLAGS=''

in the build() function, I still get the errors (having cleaned up build directories by rm -R src pkg before).

Hm.

stefan0xC commented on 2022-08-26 01:01 (UTC)

I've added RUSTUP_TOOLCHAIN=stable which should make it compatible with rustup. Not sure if I can really help with the linking issue. Did you change some compiler flags?

dreieck commented on 2022-08-25 20:26 (UTC)

build() fails for me while linking:

  = note: /usr/bin/ld: /[...]/crowbook/src/crowbook/target/release/deps/libstemmer-d52a548d1ad06a0e.rlib(stemmer-d52a548d1ad06a0e.stemmer.bad72d96-cgu.0.rcgu.o): in function `<stemmer::stemmer::Stemmer as core::ops::drop::Drop>::drop':
          stemmer.bad72d96-cgu.0:(.text._ZN67_$LT$stemmer..stemmer..Stemmer$u20$as$u20$core..ops..drop..Drop$GT$4drop17hd2908b0bb6c4557eE+0xa): undefined reference to `sb_stemmer_delete'
          /usr/bin/ld: /[...]/crowbook/src/crowbook/target/release/deps/libstemmer-d52a548d1ad06a0e.rlib(stemmer-d52a548d1ad06a0e.stemmer.bad72d96-cgu.0.rcgu.o): in function `stemmer::stemmer::Stemmer::list':
          stemmer.bad72d96-cgu.0:(.text._ZN7stemmer7stemmer7Stemmer4list17h17342132c45ca948E+0x10): undefined reference to `sb_stemmer_list'
          /usr/bin/ld: /[...]/crowbook/src/crowbook/target/release/deps/libstemmer-d52a548d1ad06a0e.rlib(stemmer-d52a548d1ad06a0e.stemmer.bad72d96-cgu.0.rcgu.o): in function `stemmer::stemmer::Stemmer::new':
          stemmer.bad72d96-cgu.0:(.text._ZN7stemmer7stemmer7Stemmer3new17heffbe8ae8d958970E+0x7c): undefined reference to `sb_stemmer_new'
          /usr/bin/ld: /[...]/crowbook/src/crowbook/target/release/deps/libstemmer-d52a548d1ad06a0e.rlib(stemmer-d52a548d1ad06a0e.stemmer.bad72d96-cgu.0.rcgu.o): in function `stemmer::stemmer::Stemmer::stem_str':
          stemmer.bad72d96-cgu.0:(.text._ZN7stemmer7stemmer7Stemmer8stem_str17h68448fc8dade27a3E+0x3f): undefined reference to `sb_stemmer_stem'
          /usr/bin/ld: /[...]/crowbook/src/crowbook/target/release/deps/libsyntect-0ed8a900721e993b.rlib(syntect-0ed8a900721e993b.syntect.b38efe50-cgu.10.rcgu.o): in function `onig::Regex::search_with_param':
          syntect.b38efe50-cgu.10:(.text._ZN4onig5Regex17search_with_param17h9ea2b235f51f0e8cE+0x31): undefined reference to `OnigEncodingUTF8'
          /usr/bin/ld: syntect.b38efe50-cgu.10:(.text._ZN4onig5Regex17search_with_param17h9ea2b235f51f0e8cE+0x94): undefined reference to `onig_search_with_param'
          /usr/bin/ld: /[...]/crowbook/src/crowbook/target/release/deps/libonig-dcbc0f3b844f5b6e.rlib(onig-dcbc0f3b844f5b6e.onig.70484441-cgu.1.rcgu.o): in function `onig::Error::new':
          onig.70484441-cgu.1:(.text._ZN4onig5Error3new17h6b3923c6359d01bcE+0x3f): undefined reference to `onig_error_code_to_str'
          /usr/bin/ld: /[...]/crowbook/src/crowbook/target/release/deps/libonig-dcbc0f3b844f5b6e.rlib(onig-dcbc0f3b844f5b6e.onig.70484441-cgu.1.rcgu.o): in function `onig::Regex::with_options_and_encoding':
          onig.70484441-cgu.1:(.text._ZN4onig5Regex25with_options_and_encoding17h77871cdb9d871493E+0xb2): undefined reference to `OnigEncodingUTF8'
          /usr/bin/ld: onig.70484441-cgu.1:(.text._ZN4onig5Regex25with_options_and_encoding17h77871cdb9d871493E+0xc6): undefined reference to `onig_new'
          /usr/bin/ld: /[...]/crowbook/src/crowbook/target/release/deps/libonig-dcbc0f3b844f5b6e.rlib(onig-dcbc0f3b844f5b6e.onig.70484441-cgu.1.rcgu.o): in function `onig::Regex::encoding':
          onig.70484441-cgu.1:(.text._ZN4onig5Regex8encoding17h979ff2e2e7d5663eE+0x5): undefined reference to `onig_get_encoding'
          /usr/bin/ld: /[...]/crowbook/src/crowbook/target/release/deps/libonig-dcbc0f3b844f5b6e.rlib(onig-dcbc0f3b844f5b6e.onig.70484441-cgu.1.rcgu.o): in function `<onig::Regex as core::ops::drop::Drop>::drop':
          onig.70484441-cgu.1:(.text._ZN53_$LT$onig..Regex$u20$as$u20$core..ops..drop..Drop$GT$4drop17h2242e668f830ca11E+0x5): undefined reference to `onig_free'
          /usr/bin/ld: /[...]/crowbook/src/crowbook/target/release/deps/libonig-dcbc0f3b844f5b6e.rlib(onig-dcbc0f3b844f5b6e.onig.70484441-cgu.10.rcgu.o): in function `<onig::match_param::MatchParam as core::default::Default>::default':
          onig.70484441-cgu.10:(.text._ZN72_$LT$onig..match_param..MatchParam$u20$as$u20$core..default..Default$GT$7default17h86e76671bdc629abE+0x3): undefined reference to `onig_new_match_param'
          /usr/bin/ld: onig.70484441-cgu.10:(.text._ZN72_$LT$onig..match_param..MatchParam$u20$as$u20$core..default..Default$GT$7default17h86e76671bdc629abE+0xf): undefined reference to `onig_initialize_match_param'
          /usr/bin/ld: /[...]/crowbook/src/crowbook/target/release/deps/libonig-dcbc0f3b844f5b6e.rlib(onig-dcbc0f3b844f5b6e.onig.70484441-cgu.10.rcgu.o): in function `<onig::match_param::MatchParam as core::ops::drop::Drop>::drop':
          onig.70484441-cgu.10:(.text._ZN71_$LT$onig..match_param..MatchParam$u20$as$u20$core..ops..drop..Drop$GT$4drop17h77d3eb5907ffd7daE+0x5): undefined reference to `onig_free_match_param'
          /usr/bin/ld: /[...]/crowbook/src/crowbook/target/release/deps/libonig-dcbc0f3b844f5b6e.rlib(onig-dcbc0f3b844f5b6e.onig.70484441-cgu.4.rcgu.o): in function `onig::syntax::Syntax::default':
          onig.70484441-cgu.4:(.text._ZN4onig6syntax6Syntax7default17h8393c052d33a2212E+0x3): undefined reference to `OnigDefaultSyntax'
          /usr/bin/ld: /[...]/crowbook/src/crowbook/target/release/deps/libonig-dcbc0f3b844f5b6e.rlib(onig-dcbc0f3b844f5b6e.onig.70484441-cgu.5.rcgu.o): in function `core::ptr::drop_in_place<onig::region::Region>':
          onig.70484441-cgu.5:(.text._ZN4core3ptr41drop_in_place$LT$onig..region..Region$GT$17h852776f3f04733baE+0x4): undefined reference to `onig_region_free'
          /usr/bin/ld: /[...]/crowbook/src/crowbook/target/release/deps/libonig-dcbc0f3b844f5b6e.rlib(onig-dcbc0f3b844f5b6e.onig.70484441-cgu.5.rcgu.o): in function `onig::region::Region::with_capacity':
          onig.70484441-cgu.5:(.text._ZN4onig6region6Region13with_capacity17h2a94d48ca11a2c9aE+0x13): undefined reference to `onig_region_resize'
          /usr/bin/ld: /[...]/crowbook/src/crowbook/target/release/deps/libonig-dcbc0f3b844f5b6e.rlib(onig-dcbc0f3b844f5b6e.onig.70484441-cgu.5.rcgu.o): in function `<onig::region::Region as core::ops::drop::Drop>::drop':
          onig.70484441-cgu.5:(.text._ZN62_$LT$onig..region..Region$u20$as$u20$core..ops..drop..Drop$GT$4drop17hba120952f6600332E+0x4): undefined reference to `onig_region_free'
          /usr/bin/ld: /[...]/crowbook/src/crowbook/target/release/deps/libonig-dcbc0f3b844f5b6e.rlib(onig-dcbc0f3b844f5b6e.onig.70484441-cgu.5.rcgu.o): in function `<onig::region::Region as core::clone::Clone>::clone':
          onig.70484441-cgu.5:(.text._ZN59_$LT$onig..region..Region$u20$as$u20$core..clone..Clone$GT$5clone17hcb02df5d955cf855E+0x13): undefined reference to `onig_region_copy'
          collect2: error: ld returned 1 exit status

  = help: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

error: could not compile `crowbook` due to previous error

Regards!

dreieck commented on 2022-08-25 19:44 (UTC) (edited on 2022-08-25 19:48 (UTC) by dreieck)

I get the following error:

==> Starting build()...
error: rustup could not choose a version of cargo to run, because one wasn't specified explicitly, and no default is configured.
help: run 'rustup default stable' to download the latest stable release of Rust and set it as your default toolchain.

I had rustup instead of rust installed, it was still lying around from another package's makedepends. Installing rust did solve the problem. -- Sad that they are not makeconflicts, otherwise you could exclude rustup explicitly.

Btw., as we are at Rust:

Can you make that all the stuff that Rust downloads is already present when build() is started? E.g. download in prepare() to some sub-directory below $srcdir? That would make things cleaner and allows build() without internet access.

Thanks for maintaining!,
regards.

charlesjohnson commented on 2022-08-22 16:46 (UTC) (edited on 2022-08-22 16:47 (UTC) by charlesjohnson)

texlive-latexextra should be an optional dependency because without it, it fails on output to pdf with ! LaTeX Error: File 'hyphenat.sty' not found.