-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
support src-one target and backlevel icus #13
base: main
Are you sure you want to change the base?
Conversation
- added some extra .gitignores for other branches Fixes: #12
DISTROS_SMALL=ubuntu fedora | ||
SRC=src/icu | ||
REV:=$(shell (cd $(SRC) && (git describe --tags --exact-match 2>/dev/null || git rev-parse --short HEAD)) || echo 'unknown') | ||
REV:=$(shell (cd $(SRC) >/dev/null 2>/dev/null && (git describe --tags --exact-match 2>/dev/null || git rev-parse --short HEAD)) || echo 'unknown') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the purpose of the first >/dev/null
here, under what circumstances would cd
ever output anything to stdout
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure which circumstances. but it is certainly doing so. might be sh vs bash
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest that you remove the first >/dev/null
and in case you later actually encounter a case where it's needed you can then add it with an explanation of the circumstances under which it's needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was needed on my mac, otherwise I get REV=/some/path 64.2
. I will test again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mystery solved: complete user error, https://superuser.com/a/90537/13787
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, I think that unset CDPATH
, as recommended there, seems like the most straightforward solution, which leaves no doubt as to what the purpose of it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, I think that
unset CDPATH
, as recommended there, seems like the most straightforward solution
I'm inclined to remove >/dev/null 2>/dev/null
everywhere and (possibly) just document to not set CDPATH
.
Huh, i found something! See https://bosker.wordpress.com/2012/02/12/bash-scripters-beware-of-the-cdpath/ (kind of a public service announcement):
You can avoid it in some cases by using cd ./foo, which does not consult CDPATH. But this is not a panacea: it can’t easily be used with paths that might be absolute or relative, such as
dirname "$0"
, so I think unsetting CDPATH is still the best way to deal with it.
That actually implies that Q=$(cd ./stuff; echo bar)
or P�=$(cd /path/to/stuff; echo baz)
might be best - using a non-ambiguous path starting with /
or ./
.
So setting:
SRC=./src/icu
…at the top of this Makefile actually avoids the CDPATH issue.
src/bin/check-icu4c-version.sh
Outdated
shift | ||
fi | ||
|
||
if [ ! -f ./source/common/unicode/uversion.h ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The initial ./
doesn't add any value here, the current directory is always the base for any relative path.
src/bin/check-icu4c-version.sh
Outdated
echo "unknown-no-uversion" | ||
exit 1 | ||
fi | ||
( grep -h "^#define U_ICU_VERSION " ./source/common/unicode/uvernum.h || echo unknown-no-define) | cut -d' ' -f3 | tr -d '"' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial ./
.
src/bin/check-icu4c-version.sh
Outdated
echo "unknown-no-uversion" | ||
exit 1 | ||
fi | ||
( grep -h "^#define U_ICU_VERSION " ./source/common/unicode/uvernum.h || echo unknown-no-define) | cut -d' ' -f3 | tr -d '"' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The -h
option is the default when grep
only has one file to search, it's redundant here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally had included source/common/unicode/uversion.h
, however, it was not needed. (it predates 4.8)
@@ -0,0 +1,99 @@ | |||
# Copyright (C) 2016 and later: Unicode, Inc. and others. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copyright 2016? Is this file a copy of some existing file? If it is, would it be possible to make git show that in the change history?
The way it is now, it looks as if your wrote a new file from scratch, but put the wrong date on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it's a copy of dist.mk
from ICU trunk. I'll fix the date.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it's a copy of
dist.mk
from ICU trunk.
Ah, from a file in a different repository? That explains why the diff here shows it as new ... I think it could be valuable if you for those files that are copies listed exact paths of the files they're copies of. That'll make it much easier to track down where things came from if that turns out to be needed in the future.
I'll fix the date.
It looks as if you forgot to actually do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks as if you forgot to actually do that.
No, as I said above, I wanted finish using this script (getting the maint tarballs out the door) before coming back to this PR.
src/bin/makesrc.sh
Outdated
@@ -0,0 +1,46 @@ | |||
#!/bin/sh | |||
# © 2016 and later: Unicode, Inc. and others. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this file, is it a copy of some existing file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a copy of one of the sibling scripts in the same directory. Will fix.
# #FN=icu-r$(svnversion /src/icu/ | tr -d ' ')-$(bash /src/icu/icu4c/source/config.guess)-${1:RANDOM} | ||
# tar cfpz /dist/${FN}-sdoc.tgz ./doc || exit 1 | ||
#cd /dist | ||
#md5sum ${FN}.tgz | tee ${FN}.tgz.md5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there should be any commented-out code in the file (at least not without a comment explaining under what circumstances someone using this should uncomment and use that code).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, please either remove the commented-out code or add a comment explaining when a user should be doing that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, i was waiting until the maint branches were shipped to finish this. I have a commit that removes this code.
- also add a workaround for icu 58/59 Fixes: #12
- you might want to disable this if you want to look at the container later
DISTROS_SMALL=ubuntu fedora | ||
SRC=src/icu | ||
REV:=$(shell (cd $(SRC) && (git describe --tags --exact-match 2>/dev/null || git rev-parse --short HEAD)) || echo 'unknown') | ||
REV:=$(shell (cd $(SRC) >/dev/null 2>/dev/null && (git describe --tags --exact-match 2>/dev/null || git rev-parse --short HEAD)) || echo 'unknown') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest that you remove the first >/dev/null
and in case you later actually encounter a case where it's needed you can then add it with an explanation of the circumstances under which it's needed.
@@ -0,0 +1,17 @@ | |||
#!/bin/sh | |||
# © 2016 and later: Unicode, Inc. and others. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2016?
@@ -0,0 +1,99 @@ | |||
# Copyright (C) 2016 and later: Unicode, Inc. and others. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it's a copy of
dist.mk
from ICU trunk.
Ah, from a file in a different repository? That explains why the diff here shows it as new ... I think it could be valuable if you for those files that are copies listed exact paths of the files they're copies of. That'll make it much easier to track down where things came from if that turns out to be needed in the future.
I'll fix the date.
It looks as if you forgot to actually do that.
# #FN=icu-r$(svnversion /src/icu/ | tr -d ' ')-$(bash /src/icu/icu4c/source/config.guess)-${1:RANDOM} | ||
# tar cfpz /dist/${FN}-sdoc.tgz ./doc || exit 1 | ||
#cd /dist | ||
#md5sum ${FN}.tgz | tee ${FN}.tgz.md5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, please either remove the commented-out code or add a comment explaining when a user should be doing that.
Fixes: #12