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

support src-one target and backlevel icus #13

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

support src-one target and backlevel icus #13

wants to merge 6 commits into from

Conversation

srl295
Copy link
Member

@srl295 srl295 commented Apr 10, 2019

  • added some extra .gitignores for other branches

Fixes: #12

- added some extra .gitignores for other branches

Fixes: #12
@srl295 srl295 requested review from roubert and yumaoka April 10, 2019 00:44
@srl295 srl295 self-assigned this Apr 10, 2019
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')
Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member Author

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

Copy link
Member

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.

Copy link
Member Author

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.

shift
fi

if [ ! -f ./source/common/unicode/uversion.h ];
Copy link
Member

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.

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 '"'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial ./.

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 '"'
Copy link
Member

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.

Copy link
Member Author

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.
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

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.

@@ -0,0 +1,46 @@
#!/bin/sh
# © 2016 and later: Unicode, Inc. and others.
Copy link
Member

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?

Copy link
Member Author

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
Copy link
Member

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).

Copy link
Member

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.

Copy link
Member Author

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
@srl295 srl295 requested a review from roubert April 11, 2019 19:19
- 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')
Copy link
Member

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.
Copy link
Member

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.
Copy link
Member

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
Copy link
Member

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.

Base automatically changed from master to main March 24, 2021 17:49
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.

support backlevel icus
2 participants