evoldoers / biomake

GNU-Make-like utility for managing builds and complex workflows
BSD 3-Clause "New" or "Revised" License
103 stars 9 forks source link

Backslashes in dependencies make biomake sad #44

Closed sjackman closed 6 years ago

sjackman commented 7 years ago

Makefile

all: a \
    b

a b:
    touch $@

Observed output

❯❯❯ biomake
# Target all not materialized - build required
all FAILED

Expected output

❯❯❯ make
touch a
touch b
sjackman commented 7 years ago

Thanks for this fantastic tool! The multiple pattern rules are the best.

cmungall commented 7 years ago

Thanks for the feedback!

I can't seem to recreate this, but it may be the case that github is doing some kind of whitespace replacement.

xxd Makefile 
0000000: 616c 6c3a 2061 205c 0a09 620a 0a61 2062  all: a \..b..a b
0000010: 3a0a 0974 6f75 6368 2024 400a            :..touch $@.
biomake
 touch a
 touch b
Target all not materialized - build required
all built

Weirdly, I thought I hit on some combination of spaces and tabs that recreated your output but I carelessly lost that iteration, now I can't seem to reproduce it at all.

sjackman commented 7 years ago

Our Makefile are identical.

❯❯❯ xxd Makefile
0000000: 616c 6c3a 2061 205c 0a09 620a 0a61 2062  all: a \..b..a b
0000010: 3a0a 0974 6f75 6368 2024 400a            :..touch $@.
❯❯❯ biomake
# Target all not materialized - build required
all FAILED

I'm using biomake 0.1.1 installed using Homebrew on macOS and Linuxbrew on Linux. I can replicate the issues on both operating systems.

❯❯❯ brew install homebrew/science/biomake
❯❯❯ biomake --version | head -n1
Biomake 1.0

I've just tested master with brew upgrade --HEAD biomake, and the bug is fixed there. Would you please consider tagging and releasing a new version of biomake?

I've noticed now that the output of biomake --version is inconsistent with the GitHub tag.

sjackman commented 7 years ago

Thanks for your quick response!

cmungall commented 7 years ago

OK I made a release https://github.com/evoldoers/biomake/releases/tag/v0.1.2

So this should work in the brew file: https://github.com/evoldoers/biomake/archive/v0.1.2.tar.gz

What next? Do I make a PR on this? https://github.com/Homebrew/homebrew-science/blob/master/biomake.rb Looks like you know more about this than I...

sjackman commented 7 years ago

Thanks! Yes, you can open a PR. You only have to change the url and sha256 lines. https://github.com/Homebrew/homebrew-science/blob/master/biomake.rb#L4-L5

❯❯❯ curl -sL https://github.com/evoldoers/biomake/archive/v0.1.2.tar.gz | gsha256sum
3ed91b553201b2b0aeab600f1f0795f1c02cb1cb1f19a4c0a2bb78070147b096  -
sjackman commented 6 years ago

I've found another case of this issue.

all: \
    a \
    b

a b:
    touch $@
❯❯❯ biomake
Exception: error(syntax_error(GNU makefile parse error at line 1 of file foo.mk: all:   a   b),_1624)
sjackman commented 6 years ago

@cmungall Do you think you'd have time to fix this issue? I'd appreciate your effort very much!

cmungall commented 6 years ago

Not sure if @ihh has time, I will try and take a look later this week

ihh commented 6 years ago

It will be in the GNU Makefile parsing code. I will look tomorrow - sorry for the delay

sjackman commented 6 years ago

No worries, Ian. Thanks a bunch!

sjackman commented 6 years ago

I commented on a bunch of issues just now. The ones that are really holding me back are…

  1. 44 Backslashes in dependencies

  2. 49 SLURM

  3. 50 Export environment variables

sjackman commented 6 years ago

Thank you, Ian! 🏆