CDSoft / pp

PP - Generic preprocessor (with pandoc in mind) - macros, literate programming, diagrams, scripts...
http://cdelord.fr/pp
GNU General Public License v3.0
252 stars 21 forks source link

Build failure on macOS 10.13.1 #44

Closed beingalink closed 6 years ago

beingalink commented 6 years ago
stack build
pp-2.1.3: configure (lib + exe)
Configuring pp-2.1.3...
pp-2.1.3: build (lib + exe)
Preprocessing library pp-2.1.3...
Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2: can't find source for Tag in src,
.stack-work, .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/autogen

--  While building package pp-2.1.3 using:
      /Users/tolink/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.2.0 build lib:pp exe:pp --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
make: *** [/Users/tolink/Downloads/pp-2.1.3/.stack-work/install/x86_64-osx/lts-9.11/8.0.2/bin/pp] Error 1
CDSoft commented 6 years ago

Ok, I see. The release archive built by Github does not contain Tag.hs which is a generated source file. This file is either regenerated when compiling pp from a git repository (git clone ...) or present in the archive made by make and available on my web site: http://cdsoft.fr/pp/pp.tgz

I don't know how Github could archive generated source files...

I can't put Tag.hs under source version control since it contains version information that are known after committing (see git describe)... Does anybody have a solution?

tajmone commented 6 years ago

I did some googling on the topic and (even though I haven't worked with GitHub API, and am not really qualified on this) I've found some links to GitHub API documentation that deals with the creation of releases:

... specifically:

... which looks like a solution if you use a local script that handles the creation of the archive and then uploads it to GitHub, or just add the locally created Tag.hs to the final archive created on GitHub. Basically, the API should allow automating the creation of new releases from local scripts, with fine-grain control on what to include and exclude from the archive (even files from outside the repo).

The new GraphQL API v4 should allow to pack multiple complex API requests into a single request:

As I said, I'm not qualified on GH API, but from what I read it should allow to solve situations like this one.

Maybe you could create a script that creates a GH release and uploads the same release archives you create for cdsoft.fr.

beingalink commented 6 years ago

I could compile the cloned repo though it nagged about wine at the end. But I got the executable as it seems.

CDSoft commented 6 years ago

wine is used by some examples in the documentation. Maybe should I remove these examples. Anyway, if you run make install it will just compile and install pp.

make test also requires wine.

CDSoft commented 6 years ago

I'm going to update tag.sh to generate Tag.hs outside of a git repository (the version given by git describe is also in pp.cabal). The next github release should be compilable.

beingalink commented 6 years ago

I installed wine and I'm getting now:

-e \x1b[1m\x1b[32m#### preprocessing doc/pp.md\x1b[0m
stack exec -- pp -en -img=doc/img doc/pp.md | pandoc -S --toc --self-contained -c doc/pp.css -f markdown -t html5 > doc/pp.html
--smart/-S has been removed.  Use +smart or -smart extension instead.
For example: pandoc -f markdown+smart -t markdown-smart.
Try pandoc --help for more information.
cat: /etc/redhat-release: No such file or directory
make: *** [doc/pp.html] Error 2
make: *** Deleting file `doc/pp.html'
CDSoft commented 6 years ago

I will ignore the error on /etc/redhat-release.

I also need to upgrade my pandoc version. Which version do you use?

CDSoft commented 6 years ago

I've fixed these bugs in 2.1.5. Hope it works now.

beingalink commented 6 years ago

With 2.1.5 I get:

-e \x1b[1m\x1b[32m#### downloading Plantuml.jar\x1b[0m
wget http://sourceforge.net/projects/plantuml/files/plantuml.jar -O .stack-work/Plantuml.jar
URL transformed to HTTPS due to an HSTS policy
--2017-11-07 06:51:22--  https://sourceforge.net/projects/plantuml/files/plantuml.jar
Resolving sourceforge.net... 216.34.181.60
Connecting to sourceforge.net|216.34.181.60|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://sourceforge.net/projects/plantuml/files/plantuml.jar/download [following]
--2017-11-07 06:51:23--  https://sourceforge.net/projects/plantuml/files/plantuml.jar/download
Connecting to sourceforge.net|216.34.181.60|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2017-11-07 06:51:24 ERROR 404: Not Found.

make: *** [.stack-work/Plantuml.jar] Error 8
make: *** Deleting file `.stack-work/Plantuml.jar'
CDSoft commented 6 years ago

I guess it was temporary. I can rebuild pp 2.1.5 from the github archive.

beingalink commented 6 years ago

OK, all seems well now. I had an issue that there is already a pp binary installed on my mac (PAR Packager, version 1.017) which was in my PATH. Your pp got installed to ~/.local/binwhich wasn't in my path but I fixed it now. Not sure if this location was chosen because I already had another pp binary. Anyway, this issue as is got fixed.

CDSoft commented 6 years ago

~/.local/bin is the standard location chosen by stack to install binaries. See https://github.com/CDSoft/pp#installation.