ProdriveTechnologies / bazel-pandoc

Rules for invoking Pandoc through the Bazel build system
Apache License 2.0
24 stars 13 forks source link

Option `--filter pandoc-citeproc` causes pandoc: PATH: getEnv: does not exist (no environment variable) #2

Open regisd opened 6 years ago

regisd commented 6 years ago

This target works:

pandoc(
    name = "html",
    src = ":manual_mdx",
    from_format = "markdown",
    output = "manual.html",
    to_format = "html",
)

This target fails:

pandoc(
    name = "html",
    src = ":manual_mdx",
    from_format = "markdown",
    output = "manual.html",
    to_format = "html",
    options = ["--filter", "pandoc-citeproc"],
)

ERROR:[REDACTED]/Projects/jflex/docs/BUILD:11:1: Pandoc docs/manual.html failed (Exit 1) pandoc: PATH: getEnv: does not exist (no environment variable) Target //docs:html failed to build

regisd commented 6 years ago

bazel-bin: [REDACTED]/.cache/bazel/_bazel_regisd/d1298cc00c93bfbf087444414b619b42/execroot/main/bazel-out/k8-fastbuild/bin bazel-genfiles: [REDACTED]/.cache/bazel/_bazel_regisd/d1298cc00c93bfbf087444414b619b42/execroot/main/bazel-out/k8-fastbuild/genfiles bazel-testlogs: [REDACTED]/.cache/bazel/_bazel_regisd/d1298cc00c93bfbf087444414b619b42/execroot/main/bazel-out/k8-fastbuild/testlogs character-encoding: file.encoding = ISO-8859-1, defaultCharset = ISO-8859-1 command_log: [REDACTED]/.cache/bazel/_bazel_regisd/d1298cc00c93bfbf087444414b619b42/command.log committed-heap-size: 1277MB execution_root: [REDACTED]/.cache/bazel/_bazel_regisd/d1298cc00c93bfbf087444414b619b42/execroot/main gc-count: 25 gc-time: 859ms install_base: [REDACTED]/.cache/bazel/_bazel_regisd/install/792a28b07894763eaa2bd870f8776b23 java-home: [REDACTED]/.cache/bazel/_bazel_regisd/install/792a28b07894763eaa2bd870f8776b23/_embedded_binaries/embedded_tools/jdk java-runtime: OpenJDK Runtime Environment (build 9.0.7.1+1) by Azul Systems, Inc. java-vm: OpenJDK 64-Bit Server VM (build 9.0.7.1+1, mixed mode) by Azul Systems, Inc. max-heap-size: 15008MB output_base: [REDACTED]/.cache/bazel/_bazel_regisd/d1298cc00c93bfbf087444414b619b42 output_path: [REDACTED]/.cache/bazel/_bazel_regisd/d1298cc00c93bfbf087444414b619b42/execroot/main/bazel-out package_path: %workspace% release: release 0.17.2 repository_cache: [REDACTED]/.cache/bazel/_bazel_regisd/cache/repos/v1 server_pid: 117524 used-heap-size: 199MB workspace: [REDACTED]/Projects/jflex

EdSchouten commented 6 years ago

It looks like pandoc-citeproc is part of the same tarball/zip as pandoc, so it should be relatively simple to add support for this. That said, we don't use this feature at Prodrive, meaning we'd rather have that such a feature is contributed.

patbro commented 4 years ago

Sorry for the long delay between opening this issue and merging the changes with master, but this issue is resolved now after I merged #1 with master.

regisd commented 4 years ago

No worries about delay, we are all doing this on our spare time. However, I don't think PR 1 has anything to do with this issue. I tried and I still have:

ERROR: /Users/regis/Projects/jflex/docs/BUILD:9:1: Pandoc docs/manual.html failed (Exit 1) pandoc failed: error executing command (cd /private/var/tmp/_bazel_regis/297b145b0aac08cfb2c9cf2ea0f2624b/sandbox/darwin-sandbox/7/execroot/main && \ exec env - \ external/pandoc_bin_macOS/bin/pandoc --filter pandoc-citeproc --from markdown --to html -o bazel-out/darwin-fastbuild/bin/docs/manual.html bazel-out/darwin-fastbuild/bin/docs/md/concatenated_manual.md) Execution platform: @local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox

Can you reopen the issue?

patbro commented 4 years ago

No worries about delay, we are all doing this on our spare time. However, I don't think PR 1 has anything to do with this issue. I tried and I still have:

ERROR: /Users/regis/Projects/jflex/docs/BUILD:9:1: Pandoc docs/manual.html failed (Exit 1) pandoc failed: error executing command (cd /private/var/tmp/_bazel_regis/297b145b0aac08cfb2c9cf2ea0f2624b/sandbox/darwin-sandbox/7/execroot/main && exec env - external/pandoc_bin_macOS/bin/pandoc --filter pandoc-citeproc --from markdown --to html -o bazel-out/darwin-fastbuild/bin/docs/manual.html bazel-out/darwin-fastbuild/bin/docs/md/concatenated_manual.md) Execution platform: @local_config_platform//:host Use --sandbox_debug to see verbose messages from the sandbox

Can you reopen the issue?

Ah, I see. I thought this issue was related to #1 because it said regisd mentioned this issue on Oct 15, 2018, my bad!

I believe no one within our organization currently uses bazel-pandoc like this, because we did not run into this issue yet. Feel free to contribute the needed changes.

regisd commented 4 years ago

Yes, you can reassign the issue to me, but I'm not going to look into it anytime soon, tbh.