Openembedded Core Discussions
 help / color / mirror / Atom feed
* potential bashism in guile_2.0.13.bb
@ 2017-01-31 12:29 Patrick Ohly
  2017-02-01 17:03 ` Khem Raj
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick Ohly @ 2017-01-31 12:29 UTC (permalink / raw)
  To: OpenEmbedded

Hello!

verify-bashisms (after some fixing of the script) reports:

/work/iot-ref-kit/openembedded-core/meta/recipes-devtools/guile/guile_2.0.13.bb
 possible bashism in guile_cross_config line 94 ($'...' should be "$(printf '...')"):  
        	echo '#!'`which ${BUILD_SYS}-guile`$' \\\n--no-auto-compile -e main -s\n!#\n(define %guile-build-info '\'\( \
			> ${B}/guile-config.cross


This is for:

guile_cross_config() {
	# this is only for target recipe
	if [ "${PN}" = "guile" ]
	then
	        # Create guile-config returning target values instead of native values
	        install -d ${SYSROOT_DESTDIR}${STAGING_BINDIR_CROSS}
        	echo '#!'`which ${BUILD_SYS}-guile`$' \\\n--no-auto-compile -e main -s\n!#\n(define %guile-build-info '\'\( \
			> ${B}/guile-config.cross

And the resulting guile-config.cross has (when /bin/sh -> /bin/dash):

#!/fast/build/refkit/intel-corei7-64/tmp-glibc/work/corei7-64-refkit-linux/guile/2.0.13-r0/recipe-sysroot-native/usr/bin/x86_64-linux-guile$ \
--no-auto-compile -e main -s
!#
(define %guile-build-info '(
...

This looks rather strange to me and I've no idea how the Linux kernel
will interpret that first shebang line, which literally ends in
...guile$ \

Is the content as intended?

It builds, whatever that means.

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: potential bashism in guile_2.0.13.bb
  2017-01-31 12:29 potential bashism in guile_2.0.13.bb Patrick Ohly
@ 2017-02-01 17:03 ` Khem Raj
  2017-02-02 11:09   ` Patrick Ohly
  0 siblings, 1 reply; 3+ messages in thread
From: Khem Raj @ 2017-02-01 17:03 UTC (permalink / raw)
  To: openembedded-core



On 1/31/17 4:29 AM, Patrick Ohly wrote:
> Hello!
> 
> verify-bashisms (after some fixing of the script) reports:
> 
> /work/iot-ref-kit/openembedded-core/meta/recipes-devtools/guile/guile_2.0.13.bb
>  possible bashism in guile_cross_config line 94 ($'...' should be "$(printf '...')"):  
>         	echo '#!'`which ${BUILD_SYS}-guile`$' \\\n--no-auto-compile -e main -s\n!#\n(define %guile-build-info '\'\( \
> 			> ${B}/guile-config.cross
> 
> 
> This is for:
> 
> guile_cross_config() {
> 	# this is only for target recipe
> 	if [ "${PN}" = "guile" ]
> 	then
> 	        # Create guile-config returning target values instead of native values
> 	        install -d ${SYSROOT_DESTDIR}${STAGING_BINDIR_CROSS}
>         	echo '#!'`which ${BUILD_SYS}-guile`$' \\\n--no-auto-compile -e main -s\n!#\n(define %guile-build-info '\'\( \
> 			> ${B}/guile-config.cross
> 
> And the resulting guile-config.cross has (when /bin/sh -> /bin/dash):
> 
> #!/fast/build/refkit/intel-corei7-64/tmp-glibc/work/corei7-64-refkit-linux/guile/2.0.13-r0/recipe-sysroot-native/usr/bin/x86_64-linux-guile$ \
> --no-auto-compile -e main -s
> !#
> (define %guile-build-info '(
> ...
> 
> This looks rather strange to me and I've no idea how the Linux kernel
> will interpret that first shebang line, which literally ends in
> ...guile$ \
> 
> Is the content as intended?

it should have come out as path to native guile with options, I think if
this is not happening it might just be installing wrong wrapper when
used it should complain. In any case its better to make it shell
independent.

> 
> It builds, whatever that means.
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: potential bashism in guile_2.0.13.bb
  2017-02-01 17:03 ` Khem Raj
@ 2017-02-02 11:09   ` Patrick Ohly
  0 siblings, 0 replies; 3+ messages in thread
From: Patrick Ohly @ 2017-02-02 11:09 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembedded-core

On Wed, 2017-02-01 at 09:03 -0800, Khem Raj wrote:
> 
> On 1/31/17 4:29 AM, Patrick Ohly wrote:
> > Hello!
> > 
> > verify-bashisms (after some fixing of the script) reports:
> > 
> > /work/iot-ref-kit/openembedded-core/meta/recipes-devtools/guile/guile_2.0.13.bb
> >  possible bashism in guile_cross_config line 94 ($'...' should be "$(printf '...')"):  
> >         	echo '#!'`which ${BUILD_SYS}-guile`$' \\\n--no-auto-compile -e main -s\n!#\n(define %guile-build-info '\'\( \
> > 			> ${B}/guile-config.cross
> > 
> > 
> > This is for:
> > 
> > guile_cross_config() {
> > 	# this is only for target recipe
> > 	if [ "${PN}" = "guile" ]
> > 	then
> > 	        # Create guile-config returning target values instead of native values
> > 	        install -d ${SYSROOT_DESTDIR}${STAGING_BINDIR_CROSS}
> >         	echo '#!'`which ${BUILD_SYS}-guile`$' \\\n--no-auto-compile -e main -s\n!#\n(define %guile-build-info '\'\( \
> > 			> ${B}/guile-config.cross
> > 
> > And the resulting guile-config.cross has (when /bin/sh -> /bin/dash):
> > 
> > #!/fast/build/refkit/intel-corei7-64/tmp-glibc/work/corei7-64-refkit-linux/guile/2.0.13-r0/recipe-sysroot-native/usr/bin/x86_64-linux-guile$ \
> > --no-auto-compile -e main -s
> > !#
> > (define %guile-build-info '(
> > ...
> > 
> > This looks rather strange to me and I've no idea how the Linux kernel
> > will interpret that first shebang line, which literally ends in
> > ...guile$ \
> > 
> > Is the content as intended?
> 
> it should have come out as path to native guile with options, I think if
> this is not happening it might just be installing wrong wrapper when
> used it should complain.

Here's a test script:
vvvvvvvvvvvvvvvvvvvvvvvv
#!/bin/echo \
hello world
^^^^^^^^^^^^^^^^^^^^^^^^

That prints:
\ /tmp/test2

It doesn't look like line continuation in the shebang line works, so the
above guile-config.cross is just wrong. However, both dash and bash do
the same thing, so I guess the file is not used at all?

>  In any case its better to make it shell
> independent.

So the correct content of guile-config.cross would be this?

#!/.../guile/2.0.13-r0/recipe-sysroot-native/usr/bin/x86_64-linux-guile --no-auto-compile -e main -s
!#
(define %guile-build-info '(
...

I have no idea what the script is supposed to do, so I'm a bit reluctant
to change anything.

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-02 11:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-31 12:29 potential bashism in guile_2.0.13.bb Patrick Ohly
2017-02-01 17:03 ` Khem Raj
2017-02-02 11:09   ` Patrick Ohly

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox