Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use printf for generating version.go #933

Merged
merged 3 commits into from
Oct 31, 2024
Merged

Conversation

starsep
Copy link
Contributor

@starsep starsep commented Sep 3, 2024

Flag -e is to "enable interpretation of backslash escapes"
Which might be a default, depends on a shell.

sh -c 'echo "a\nb"' on my OS prints

a\nb

(no newline)

Launch Checklist

  • Briefly describe the changes in this PR.

Flag -e is to "enable interpretation of backslash escapes"
Which might be a default, depends on a shell.

sh -c 'echo "a\nb"' on my OS prints "a\nb" (no newline)
@HarelM
Copy link
Collaborator

HarelM commented Sep 3, 2024

Seems like this breaks the CI...

@starsep
Copy link
Contributor Author

starsep commented Sep 3, 2024

Indeed.

Error: error reading package: /home/runner/work/maputnik/maputnik/desktop/version.go:1:1: expected 'package', found '-'

I suspect also -e part was echoed. I will check later what exactly OS/shell is used in CI

@kevinschaul
Copy link
Collaborator

@starsep Possibly helpful: https://unix.stackexchange.com/questions/700675/why-is-echo-e-behaving-weird-in-a-makefile

@starsep
Copy link
Contributor Author

starsep commented Sep 6, 2024

Thanks!
Based on StackExchange response I don't think it is possible to use echo portably in Makefile.
I went with printf instead

@starsep starsep changed the title Use echo -e for generating version.go Use printf for generating version.go Sep 6, 2024
@nyurik
Copy link
Member

nyurik commented Sep 6, 2024

heh, that's why i prefer just, optionally with per-platform targets

@HarelM
Copy link
Collaborator

HarelM commented Oct 31, 2024

@nyurik did you review this PR? can it be merged?

@nyurik nyurik merged commit dd6b40c into maplibre:main Oct 31, 2024
7 checks passed
@starsep starsep deleted the versionGoEchoE branch October 31, 2024 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants