Re: [OE-core] [PATCH] native/cross: make ar wrapper support to read options from file

2021-12-02 Thread hongxu
On 12/2/21 4:49 PM, Jacob Kroon wrote:
> [Please note: This e-mail is from an EXTERNAL e-mail address]
>
> On 12/2/21 09:37, Hongxu Jia wrote:
>> If ar input params starts with @, it means to read options from file
>> $ ar -h
>> ...
>>@  - read options from 
>> ...
>>
>> It failed to call ar wrapper to read options from file:
>> $ path_to/oe-core/scripts/native-intercept/ar 
>> @bazel-out/k8-opt/bin/external/llvm-project/llvm/libSupport.a-2.params
>> |path_to/oe-core/scripts/native-intercept/ar: invalid option -- '@'
>> | Usage: path_to/oe-core/scripts/native-intercept/ar [emulation options]
>> [-]{dmpqrstx}[abcDfilMNoPsSTuvV] [--plugin ] [member-name] [count] 
>> archive-file file...
>>
>> If input params start with @, append option -D to argv list
>>
>> Signed-off-by: Hongxu Jia 
>> ---
>>   scripts/native-intercept/ar | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/scripts/native-intercept/ar b/scripts/native-intercept/ar
>> index dcc623e3ed..32f45171d6 100755
>> --- a/scripts/native-intercept/ar
>> +++ b/scripts/native-intercept/ar
>> @@ -19,6 +19,8 @@ argv = sys.argv
>>   if argv[1].startswith('--'):
>>   # No modifier given
>>   None
>> +elif argv[1].startswith('@'):
>> +argv.append('-D')
>>   else:
>>   # remove the optional '-'
>>   if argv[1][0] == '-':
>>
> I am a little surprised this works, since "-D" would be placed after any
> archive/member parameters. But if does, ok.
I've several tries, and append -D works well

> Otherwise maybe we should just give up if there is a '@' and fallback to
> not modifying the args, unless we want to process the file itself in the
> wrapper.

This is my original trying, if above failed in some cases, we have to 
give up to support determinism for @

//Hongxu

> Jacob



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#159078): 
https://lists.openembedded.org/g/openembedded-core/message/159078
Mute This Topic: https://lists.openembedded.org/mt/87448903/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH] native/cross: make ar wrapper support to read options from file

2021-12-02 Thread Jacob Kroon
On 12/2/21 09:37, Hongxu Jia wrote:
> If ar input params starts with @, it means to read options from file
> $ ar -h
> ...
>   @  - read options from 
> ...
> 
> It failed to call ar wrapper to read options from file:
> $ path_to/oe-core/scripts/native-intercept/ar 
> @bazel-out/k8-opt/bin/external/llvm-project/llvm/libSupport.a-2.params
> |path_to/oe-core/scripts/native-intercept/ar: invalid option -- '@'
> | Usage: path_to/oe-core/scripts/native-intercept/ar [emulation options]
> [-]{dmpqrstx}[abcDfilMNoPsSTuvV] [--plugin ] [member-name] [count] 
> archive-file file...
> 
> If input params start with @, append option -D to argv list
> 
> Signed-off-by: Hongxu Jia 
> ---
>  scripts/native-intercept/ar | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/scripts/native-intercept/ar b/scripts/native-intercept/ar
> index dcc623e3ed..32f45171d6 100755
> --- a/scripts/native-intercept/ar
> +++ b/scripts/native-intercept/ar
> @@ -19,6 +19,8 @@ argv = sys.argv
>  if argv[1].startswith('--'):
>  # No modifier given
>  None
> +elif argv[1].startswith('@'):
> +argv.append('-D')
>  else:
>  # remove the optional '-'
>  if argv[1][0] == '-':
> 

I am a little surprised this works, since "-D" would be placed after any
archive/member parameters. But if does, ok.

Otherwise maybe we should just give up if there is a '@' and fallback to
not modifying the args, unless we want to process the file itself in the
wrapper.

Jacob

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#159077): 
https://lists.openembedded.org/g/openembedded-core/message/159077
Mute This Topic: https://lists.openembedded.org/mt/87448903/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH] native/cross: make ar wrapper support to read options from file

2021-12-02 Thread hongxu
If ar input params starts with @, it means to read options from file
$ ar -h
...
  @  - read options from 
...

It failed to call ar wrapper to read options from file:
$ path_to/oe-core/scripts/native-intercept/ar 
@bazel-out/k8-opt/bin/external/llvm-project/llvm/libSupport.a-2.params
|path_to/oe-core/scripts/native-intercept/ar: invalid option -- '@'
| Usage: path_to/oe-core/scripts/native-intercept/ar [emulation options]
[-]{dmpqrstx}[abcDfilMNoPsSTuvV] [--plugin ] [member-name] [count] 
archive-file file...

If input params start with @, append option -D to argv list

Signed-off-by: Hongxu Jia 
---
 scripts/native-intercept/ar | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/native-intercept/ar b/scripts/native-intercept/ar
index dcc623e3ed..32f45171d6 100755
--- a/scripts/native-intercept/ar
+++ b/scripts/native-intercept/ar
@@ -19,6 +19,8 @@ argv = sys.argv
 if argv[1].startswith('--'):
 # No modifier given
 None
+elif argv[1].startswith('@'):
+argv.append('-D')
 else:
 # remove the optional '-'
 if argv[1][0] == '-':
-- 
2.33.0


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#159076): 
https://lists.openembedded.org/g/openembedded-core/message/159076
Mute This Topic: https://lists.openembedded.org/mt/87448903/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-