<p>A short term one not really. Except maintaining a list of the variables that we pass. Because there is also <code>JLINK_SERIAL</code>, <code>SERIAL</code>, <code>PROGRAMMER_SERIAL</code> for other boards… (this is horrible I know).<br>
It was also an issue for <a class="user-mention" data-hovercard-type="user" data-hovercard-url="/hovercards?user_id=5160052" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bergzand">@bergzand</a> who was using a different <code>RIOTBOARD</code> directory.</p>
<p>The <code>env -i</code> is required to remove everything that was set and exported in the compilation and would pollute calling <code>make</code> in <code>make</code>.<br>
The real solution, remove global <code>export</code> and only do target specific exports or go through a separate included file in Makefile.base.</p>
<p>To go in that direction, it could also work to do <code>unset CFLAGS</code> (or whatever works in the shell) and all the variables that must be removed. It would help tracking what should be cleaned but be in a dangerous state where any export would break things.<br>
At least we got rid of the <code>FLASHER</code> exports.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/11907?email_source=notifications&email_token=ABE7WYF7N5WPPGNLRHOEMGTQBB3WRA5CNFSM4IGQXNQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2WZMDA#issuecomment-514692620">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYCEZTWBOFPBW6MCX23QBB3WRANCNFSM4IGQXNQQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYB6ZOVZEE4EZ4FVZULQBB3WRA5CNFSM4IGQXNQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2WZMDA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/11907?email_source=notifications\u0026email_token=ABE7WYF7N5WPPGNLRHOEMGTQBB3WRA5CNFSM4IGQXNQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2WZMDA#issuecomment-514692620",
"url": "https://github.com/RIOT-OS/RIOT/pull/11907?email_source=notifications\u0026email_token=ABE7WYF7N5WPPGNLRHOEMGTQBB3WRA5CNFSM4IGQXNQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2WZMDA#issuecomment-514692620",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>