Skip to content

Conversation

@kaosf
Copy link
Contributor

@kaosf kaosf commented Jan 27, 2017

To fix the following error:

mktemp: too few X's in template ‘codesigndoc’

To fix the following error:

    mktemp: too few X's in template ‘codesigndoc’
@viktorbenei
Copy link
Contributor

Which macOS version did you have this error with?

@kaosf
Copy link
Contributor Author

kaosf commented Jan 27, 2017

The result of sw_vers:

ProductName:	Mac OS X
ProductVersion:	10.12.3
BuildVersion:	16D32

Thanks.

@viktorbenei
Copy link
Contributor

It works for me on 10.12.3 O_O

Viktors-MBP:tmp viktorbenei$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.12.3
BuildVersion:	16D32
bash -l -c "$(curl -sfL https://raw.githubusercontent.com/bitrise-tools/codesigndoc/master/_scripts/install_wrap-xcode.sh)"
 => Creating a temporary directory for codesigndoc ...
 => Downloading version: 0.9.18
 => Downloading codesigndoc from (https://github.com/bitrise-tools/codesigndoc/releases/download/0.9.18/codesigndoc-Darwin-x86_64) to (/var/folders/p9/2zh1v8p545j5m09f47_w1tsr0000gn/T/codesigndoc.JBZQdC2m/codesigndoc) ...
######################################################################## 100.0%
 => Making it executable ...
 => codesigndoc version: 0.9.18
 => Running codesigndoc scan ...

@viktorbenei
Copy link
Contributor

Running mktemp manually also works:

mktemp -d -t codesigndoc
/var/folders/p9/2zh1v8p545j5m09f47_w1tsr0000gn/T/codesigndoc.4K8dEcwH

@kaosf
Copy link
Contributor Author

kaosf commented Jan 27, 2017

Ouch!!! Sorry for my carelessness.

I have installed coreutils with homebrew. So, my mktemp is /usr/local/opt/coreutils/libexec/gnubin/mktemp.

I could run mktemp command with full path:

$ /usr/bin/mktemp -d -t codesigningXXX
/var/folders/k4/yvdp21kn5sl81nf6zc_y0jbh0000gn/T/codesigningXXX.I8YNwEho

I'm very sorry. X-(

@viktorbenei
Copy link
Contributor

I'm very sorry. X-(

Don't be! Actually, reading e.g. https://github.com/fisherman/fisherman/pull/8/files I have to agree that including XXX would be a better solution, as that works everywhere, without any issue, while not including XXX can cause issues!

The only thing is, you should add this to the template "wrap" script instead (https://github.com/bitrise-tools/codesigndoc/blob/master/_scripts/install_wrap.sh.template), as that's the one we use to auto generate the other ones! ;)

Additionally, reading a couple of related docs, I'd suggest you to add 5 Xs instead of 3, that seems to be "universally accepted" on all platforms ;)

@viktorbenei
Copy link
Contributor

Or maybe 6 Xs, just to be really really sure :D http://www.gnu.org/software/libc/manual/html_node/Temporary-Files.html ("The last six characters of this string must be ‘XXXXXX’")

@kaosf
Copy link
Contributor Author

kaosf commented Jan 27, 2017

Okay, I'm sure. I create some commits again which add 5 Xs to the template file. Please wait a minute.

@kaosf
Copy link
Contributor Author

kaosf commented Jan 27, 2017

aahh... Yes, 6 Xs. I got it. Thanks for your advises!

@kaosf
Copy link
Contributor Author

kaosf commented Jan 27, 2017

Can I do any other things?

Squash 3 commits, change the title of this PR (3 Xs will make no sense in the future, I think) and etc. I do if you want.

@viktorbenei viktorbenei merged commit 4b0c707 into bitrise-io:master Jan 27, 2017
@viktorbenei
Copy link
Contributor

Perfect!

Thank you, I'll re-generate the wrapper scripts in a sec! ;)

@viktorbenei
Copy link
Contributor

Re-generated and pushed, if you run the curl command again you should now get the updated scripts ;)

Thanks again, and Happy Building! :)

@kaosf
Copy link
Contributor Author

kaosf commented Jan 27, 2017

Thanks to merge! 😄

@kaosf kaosf deleted the add-xxx-to-mktemp-command branch January 27, 2017 17:23
@viktorbenei
Copy link
Contributor

Thanks for the PR! ;)

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.

2 participants