You are not logged in.

#1 2024-01-07 18:48:46

d.ALT
Member
Registered: 2019-05-10
Posts: 920

[SOLVED] env is not honoured by makepkg

As per the Pinned Comment in https://aur.archlinux.org/packages/linux-clear page:

metak wrote:

Lastly, build the kernel by setting your environment variable env _subarch=40 _localmodcfg=y.

makepkg does NOT keep tracks of declared variables since I see (in KSysGuard) the compilation is running with gcc and cc1. I also see the CPU's choice coming-up (even if I declared _subarch=44):

Processor family
  1. AMD Opteron/Athlon64/Hammer/K8 (MK8)
  2. AMD Opteron/Athlon64/Hammer/K8 with SSE3 (MK8SSE3) (NEW)
  3. AMD 61xx/7x50/PhenomX3/X4/II/K10 (MK10) (NEW)
  4. AMD Barcelona (MBARCELONA) (NEW)
  5. AMD Bobcat (MBOBCAT) (NEW)
  6. AMD Jaguar (MJAGUAR) (NEW)
  7. AMD Bulldozer (MBULLDOZER) (NEW)
  8. AMD Piledriver (MPILEDRIVER) (NEW)
  9. AMD Steamroller (MSTEAMROLLER) (NEW)
  10. AMD Excavator (MEXCAVATOR) (NEW)
  11. AMD Zen (MZEN) (NEW)
  12. AMD Zen 2 (MZEN2) (NEW)
  13. AMD Zen 3 (MZEN3) (NEW)
  14. AMD Zen 4 (MZEN4) (NEW)
  15. Intel P4 / older Netburst based Xeon (MPSC)
> 16. Intel Core 2 (MCORE2)
  17. Intel Atom (MATOM)
  18. Intel Nehalem (MNEHALEM) (NEW)
  19. Intel Westmere (MWESTMERE) (NEW)
  20. Intel Silvermont (MSILVERMONT) (NEW)
  21. Intel Goldmont (MGOLDMONT) (NEW)
  22. Intel Goldmont Plus (MGOLDMONTPLUS) (NEW)
  23. Intel Sandy Bridge (MSANDYBRIDGE) (NEW)
  24. Intel Ivy Bridge (MIVYBRIDGE) (NEW)
  25. Intel Haswell (MHASWELL) (NEW)
  26. Intel Broadwell (MBROADWELL) (NEW)
  27. Intel Skylake (MSKYLAKE) (NEW)
  28. Intel Skylake X (MSKYLAKEX) (NEW)
  29. Intel Cannon Lake (MCANNONLAKE) (NEW)
  30. Intel Ice Lake (MICELAKE) (NEW)
  31. Intel Cascade Lake (MCASCADELAKE) (NEW)
  32. Intel Cooper Lake (MCOOPERLAKE) (NEW)
  33. Intel Tiger Lake (MTIGERLAKE) (NEW)
  34. Intel Sapphire Rapids (MSAPPHIRERAPIDS) (NEW)
  35. Intel Rocket Lake (MROCKETLAKE) (NEW)
  36. Intel Alder Lake (MALDERLAKE) (NEW)
  37. Intel Raptor Lake (MRAPTORLAKE) (NEW)
  38. Intel Meteor Lake (MMETEORLAKE) (NEW)
  39. Intel Emerald Rapids (MEMERALDRAPIDS) (NEW)
  40. Generic-x86-64 (GENERIC_CPU)
  41. Generic-x86-64-v2 (GENERIC_CPU2) (NEW)
  42. Generic-x86-64-v3 (GENERIC_CPU3) (NEW)
  43. Generic-x86-64-v4 (GENERIC_CPU4) (NEW)
  44. Intel-Native optimizations autodetected by the compiler (MNATIVE_INTEL) (NEW)
  45. AMD-Native optimizations autodetected by the compiler (MNATIVE_AMD) (NEW)
choice[1-45?]:

I'm using:

$ env _localmodcfg=y _subarch=44 _use_llvm_lto=y
###press <ENTER>###
$ makepkg -rs

Last edited by d.ALT (2024-01-07 21:50:25)


<49,17,III,I>    Fama di loro il mondo esser non lassa;
<50,17,III,I>    misericordia e giustizia li sdegna:
<51,17,III,I>    non ragioniam di lor, ma guarda e passa.

Offline

#2 2024-01-07 20:13:29

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [SOLVED] env is not honoured by makepkg

Try

env _localmodcfg=y _subarch=44 _use_llvm_lto=y makepkg -rs

Offline

#3 2024-01-07 21:51:08

d.ALT
Member
Registered: 2019-05-10
Posts: 920

Re: [SOLVED] env is not honoured by makepkg

Head_on_a_Stick wrote:

Try

env _localmodcfg=y _subarch=44 _use_llvm_lto=y makepkg -rs

Thanks!

(I wonder why on earth should I use env then??)

Last edited by d.ALT (2024-01-07 21:51:35)


<49,17,III,I>    Fama di loro il mondo esser non lassa;
<50,17,III,I>    misericordia e giustizia li sdegna:
<51,17,III,I>    non ragioniam di lor, ma guarda e passa.

Offline

#4 2024-01-07 22:13:16

seth
Member
Registered: 2012-09-03
Posts: 51,570

Re: [SOLVED] env is not honoured by makepkg

env sets an environment and runs a command with it - you actually don't even need that w/ an advanced™ shell and could just

_localmodcfg=y _subarch=44 _use_llvm_lto=y makepkg -rs

But this won't work w/ eg. ash

For your original approach you would have had to export the variables, but that just sullies your interactive shell.

Online

#5 2024-01-07 23:33:20

d.ALT
Member
Registered: 2019-05-10
Posts: 920

Re: [SOLVED] env is not honoured by makepkg

seth wrote:

you actually don't even need that w/ an advanced™ shell and could just

_localmodcfg=y _subarch=44 _use_llvm_lto=y makepkg -rs

So, in my case (Bash), using env is redundant, am I understanding right?


<49,17,III,I>    Fama di loro il mondo esser non lassa;
<50,17,III,I>    misericordia e giustizia li sdegna:
<51,17,III,I>    non ragioniam di lor, ma guarda e passa.

Offline

#6 2024-01-07 23:35:02

seth
Member
Registered: 2012-09-03
Posts: 51,570

Re: [SOLVED] env is not honoured by makepkg

In this case yes (env can do more and esp. clear the environment)

Online

#7 2024-01-07 23:36:12

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,548
Website

Re: [SOLVED] env is not honoured by makepkg

seth wrote:

But this won't work w/ eg. ash

Which ash?  It works fine on my busybox ash build.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#8 2024-01-07 23:37:50

d.ALT
Member
Registered: 2019-05-10
Posts: 920

Re: [SOLVED] env is not honoured by makepkg

Trilby wrote:
seth wrote:

But this won't work w/ eg. ash

Which ash?  It works fine on my busybox ash build.

You mean you're indeed running some commands without env?


<49,17,III,I>    Fama di loro il mondo esser non lassa;
<50,17,III,I>    misericordia e giustizia li sdegna:
<51,17,III,I>    non ragioniam di lor, ma guarda e passa.

Offline

#9 2024-01-07 23:44:10

seth
Member
Registered: 2012-09-03
Posts: 51,570

Re: [SOLVED] env is not honoured by makepkg

https://archlinux.org/packages/extra/x86_64/busybox/

Trilby might be using a custom config (*his* busybox ash build)

Online

#10 2024-01-08 01:52:51

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,548
Website

Re: [SOLVED] env is not honoured by makepkg

Yes, I have my own build, and I've adjusted the build config significantly - but I don't recall any changes about this behavior.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#11 2024-01-08 07:19:52

seth
Member
Registered: 2012-09-03
Posts: 51,570

Re: [SOLVED] env is not honoured by makepkg

"foo=bar echo $foo" works for you?

Online

#12 2024-01-08 15:33:55

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [SOLVED] env is not honoured by makepkg

seth wrote:

"foo=bar echo $foo" works for you?

That will not work for any shell because "$foo" is expanded before the variable is set:

$ echo $0
bash
$ foo=bar echo "$foo"

$ foo=bar ; echo "$foo"
bar
$

See also https://unix.stackexchange.com/question … ppear-in-c

Passing the variables to a command or script works just fine though, with or without `env`:

$ cat script       
#!/bin/sh
echo "$foo"
$ foo=bar ./script 
bar
$ ls -l /bin/sh                                           
lrwxrwxrwx 1 root root 4 Dec 20 05:56 /bin/sh -> dash
~$

Note that plain `env` with no arguments returns the current environmental variables, saving 5 typed characters compared to `printenv`, which is useful for impatient people like me :-)

Last edited by Head_on_a_Stick (2024-01-08 15:38:21)

Offline

Board footer

Powered by FluxBB