Author Topic: Portable Build Tools  (Read 1148 times)

Vortex

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Portable Build Tools
« on: March 02, 2024, 02:14:43 PM »
PortableBuildTools :

Quote
Portable, simple and fast installer for Visual Studio Build Tools.

Downloads standalone 64-bit MSVC compiler, linker & other tools, also headers/libraries from Windows SDK, into a portable folder, without installing Visual Studio. Has only bare minimum components - no UWP/Store/WindowsRT stuff, just files & tools for 64-bit native desktop app development.

https://github.com/Data-Oriented-House/PortableBuildTools

Modifying \BCX\bed\Bat\MSVC\Config32.bat to use BCX with Portable Build Tools, x86 host compiling 32-bit code :

Code: [Select]
SET MSVCFolder="R:\BuildTools-Hostx86-x86\VC\Tools\MSVC\14.39.33519\bin\Hostx86\x86"

CALL "R:\BuildTools-Hostx86-x86\devcmd.bat"

@SET BCX=D:\BCX

devcmd.bat created by Portable Build Tools :

Code: [Select]
@echo off

set WindowsSDKDir=R:\BuildTools-Hostx86-x86\Windows Kits\10
set WindowsSDKVersion=10.0.22621.0
set VCToolsInstallDir=R:\BuildTools-Hostx86-x86\VC\Tools\MSVC\14.39.33519\
set VSCMD_ARG_TGT_ARCH=x86

set MSVC_BIN=R:\BuildTools-Hostx86-x86\VC\Tools\MSVC\14.39.33519\bin\Hostx86\x86
set SDK_BIN=R:\BuildTools-Hostx86-x86\Windows Kits\10\bin\10.0.22621.0\x86;R:\BuildTools-Hostx86-x86\Windows Kits\10\bin\10.0.22621.0\x86\ucrt
set PATH=%MSVC_BIN%;%SDK_BIN%;%PATH%
set INCLUDE=R:\BuildTools-Hostx86-x86\VC\Tools\MSVC\14.39.33519\include;R:\BuildTools-Hostx86-x86\Windows Kits\10\Include\10.0.22621.0\ucrt;R:\BuildTools-Hostx86-x86\Windows Kits\10\Include\10.0.22621.0\shared;R:\BuildTools-Hostx86-x86\Windows Kits\10\Include\10.0.22621.0\um;R:\BuildTools-Hostx86-x86\Windows Kits\10\Include\10.0.22621.0\winrt;R:\BuildTools-Hostx86-x86\Windows Kits\10\Include\10.0.22621.0\cppwinrt
set LIB=R:\BuildTools-Hostx86-x86\VC\Tools\MSVC\14.39.33519\lib\x86;R:\BuildTools-Hostx86-x86\Windows Kits\10\Lib\10.0.22621.0\ucrt\x86;R:\BuildTools-Hostx86-x86\Windows Kits\10\Lib\10.0.22621.0\um\x86

A quick test, building the GetBmp SaveBmp Demo by Robert Wishlaw  :

Code: [Select]
BCX BASIC to C/C++ Translator (c) 1999-2024 by Kevin Diggins
Version 8.0.8 (12/27/2023) Compiled using MS Visual C++ for 64-bit Windows Systems
[Lines In: 113] [Lines Out: 742] [Statements: 79] [Time: 0.01 Sec's]
BCX translated [Savebmp.Bas] to [Savebmp.C] for a C Compiler
**************************************************************************
MSVC is compiling [ "D:\BCX\bed\SaveBmp" ] as a 32-bit GUI application.
SaveBmp.c
Linking "D:\BCX\bed\SaveBmp"
Microsoft (R) Incremental Linker Version 14.39.33519.0
Copyright (C) Microsoft Corporation.  All rights reserved.
**************************************************************************
MSVC built [ "D:\BCX\bed\SaveBmp".exe ]
**************************************************************************
Microsoft (R) C/C++ Optimizing Compiler Version 19.39.33519 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

Robert

  • Hero Member
  • *****
  • Posts: 1163
    • View Profile
Re: Portable Build Tools
« Reply #1 on: March 02, 2024, 05:07:53 PM »
Very interesting.

Portable stripped down Pelles can be done as well.

Just the tickets for the new soon-to-be-released BCX installer. Ahem, um, cough, cough ...

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1966
    • View Profile
Re: Portable Build Tools
« Reply #2 on: March 06, 2024, 05:10:13 PM »
Vortex -- Sorry for inadvertently hijacking your original thread.   ;)

I moved the BCX installer discussion into its own thread.
https://bcxbasiccoders.com/smf/index.php?topic=1003.0

Now we can keep these two discussions better organized.

Vortex

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: Portable Build Tools
« Reply #3 on: March 07, 2024, 02:52:07 PM »
Hi MrBcx,

No worries, it's OK.

airr

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Re: Portable Build Tools
« Reply #4 on: March 07, 2024, 05:56:02 PM »
So here's a quick question:  How small can you make the actual MSVC installation for use with BED/BCX?

I installed using the tool (Thanks, Vortex for the link!) and it came in at about 1.2GB.

I managed to remove enough to get it down to about 690MB and working with BED with the same example file Vortex used, but I'd like to go even smaller.

Any tips?

AIR.
 

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1966
    • View Profile
Re: Portable Build Tools
« Reply #5 on: March 07, 2024, 07:01:17 PM »
A 690mb MSVC installation is pretty damn impressive.  I'm interested to read
whether Vortex has any tricks up his sleeve.  My only thought on further reduction
involves the UPX packer which is known to trigger AV false positives, so I would
not recommend it.
 

airr

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Re: Portable Build Tools
« Reply #6 on: March 07, 2024, 08:07:02 PM »
64bit only, working here with BED (limited testing), I got it down to 242MB.  YMMV....just trying this to see if it can be done.  :)

https://share.binarymagic.net/-8uQSGMAx5e

AIR.

Robert

  • Hero Member
  • *****
  • Posts: 1163
    • View Profile
Re: Portable Build Tools
« Reply #7 on: March 08, 2024, 05:58:50 PM »
64bit only, working here with BED (limited testing), I got it down to 242MB.  YMMV....just trying this to see if it can be done.  :)

https://share.binarymagic.net/-8uQSGMAx5e

AIR.

I'm going to pair it with Wine.

Thanks

Vortex

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: Portable Build Tools
« Reply #8 on: March 09, 2024, 04:33:20 AM »
Hi MrBcx,

For the moment, no any special triks. Maybe, one could remove some import libraries to reduce the size of the package. The purpose is to use only the most important libraries.