Skip to content

Suppress error code if copying of README.md/amalgamate_demo.cpp isn't needed - #1103

Closed
pps83 wants to merge 1 commit into
simdjson:masterfrom
pps83:bugfix/Suppress-error-code-if-copying-of-README.md-amalgamate_demo.cpp-isnt-needed
Closed

Suppress error code if copying of README.md/amalgamate_demo.cpp isn't needed#1103
pps83 wants to merge 1 commit into
simdjson:masterfrom
pps83:bugfix/Suppress-error-code-if-copying-of-README.md-amalgamate_demo.cpp-isnt-needed

Conversation

@pps83

@pps83 pps83 commented Aug 8, 2020

Copy link
Copy Markdown
Contributor

Fixes an error introduced by #1070


cp -u "${SCRIPTPATH}/amalgamate_demo.cpp" "${DEMOCPP}" 2>/dev/null
cp -u "${SCRIPTPATH}/README.md" "${README}" 2>/dev/null
cp -u "${SCRIPTPATH}/amalgamate_demo.cpp" "${DEMOCPP}" 2>/dev/null || :

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What does the : do? This is new syntax to me.

Will cp -f do what we want? I don't care which, as long as this works everywhere.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also, if the source file isn't there and it therefore fails to copy, will we still get an error code?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The "-u" flag is GNU-specific. It is likely not to work under freeBSD and macos.

@lemire

lemire commented Aug 10, 2020

Copy link
Copy Markdown
Member

Under non-GNU systems (so FreeBSD and macOS)...

AMALGAMATE_OUTPUT_PATH=. ../path/amalgamate.sh

will only copy simdjson.cpp and simdjson.h.

@lemire

lemire commented Aug 10, 2020

Copy link
Copy Markdown
Member

Please don't use GNU-specific flags. It is bad practice.

@lemire

lemire commented Aug 10, 2020

Copy link
Copy Markdown
Member

Currently the build is broken if you have bash but are not under a GNU system (essentially Linux and the like).

We cannot use -u. Please keep the script portable.

See PR:
#1109

@lemire

lemire commented Aug 12, 2020

Copy link
Copy Markdown
Member

I'll close this PR. If there is still an issue, please generate a new PR.

@lemire lemire closed this Aug 12, 2020
@pps83
pps83 deleted the bugfix/Suppress-error-code-if-copying-of-README.md-amalgamate_demo.cpp-isnt-needed branch August 13, 2020 09:23
@pps83

pps83 commented Aug 13, 2020

Copy link
Copy Markdown
Contributor Author

Same fix still needs to be applied regardless of #1109, see updated PR:
#1113

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.

3 participants