Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task: Make cross-OS build script #364

Closed
NightOwl888 opened this issue Oct 6, 2020 · 3 comments · Fixed by #596
Closed

Task: Make cross-OS build script #364

NightOwl888 opened this issue Oct 6, 2020 · 3 comments · Fixed by #596
Assignees
Labels
is:enhancement New feature or request pri:normal
Milestone

Comments

@NightOwl888
Copy link
Contributor

We currently have a .bat script file to launch the build from the command line that wraps a Powershell file. Clearly, since .bat is Windows-only, we will need to make a .sh script file in order to be able to build on other operating systems.

The actual build.bat file does nothing more than read command line parameters (in any order they are entered), setting defaults where appropriate, and then launch Powershell with the PSake module.

While we could provide instructions to launch the Powershell script using when not running on Windows, the command structure would be simpler for end users if they had a similar build.sh wrapper script with the same inputs as the build.bat file (and if it is possible to use the .sh file on Windows, simply eliminate the .bat file).

Note that the build.ps script also generates a replacement build.bat file that eliminates the version and packageVersion parameters when building a release. This ensures a release distribution's build.bat file will always build the current release version unless the user manually updates the version.props file that is also in the release distribution. build.ps will need to be updated to generate a build.sh file during a release for the same reasons.

@NightOwl888 NightOwl888 added up-for-grabs This issue is open to be worked on by anyone good-first-issue Good for newcomers is:enhancement New feature or request pri:normal labels Oct 6, 2020
@NightOwl888 NightOwl888 added this to the 4.8.0 milestone Oct 6, 2020
@Shazwazza
Copy link
Contributor

On a side note - the docs building process will need to remain as windows only for now just because docfx 2 is a netframework project.

@miiitch
Copy link

miiitch commented Feb 26, 2021

Hi, I working on build process on Linux boxes. powershell core works fine on it. Have you considered running powershell core for non windows build? There are limitations that I'm not aware of maybe.

@NightOwl888
Copy link
Contributor Author

NightOwl888 commented Feb 26, 2021

@miiitch

Yes, to my knowledge running the build.ps1 file using Powershell core should work fine. But that script is not well documented, the commands to call it are more verbose, and the parameters vs properties to pass are a bit confusing to use and prone to change over time.

Call to build.ps1 directly to run tests on Powershell core

pwsh -ExecutionPolicy Bypass -Command "& { Import-Module ./build/psake.psm1; Invoke-Psake ./build/build.ps1 Build,Test -properties @{ configuration='Release';maximumParalellJobs=10 } -parameters @{ packageVersion='4.8.0-beta00013' } }"

build.bat is documented on the README and requires simpler syntax to use than running build.ps1. Ideally, we would just be able to type build on any OS in the release distribution to build the source from scratch and build -t to run the tests. This currently only works on Windows.

Same command using build.bat

build -t -config:Release -mp 10 -pv:4.8.0-beta00013

Running the command on a clone of the repo requires PackageVersion argument to be supplied. The release distribution doesn't accept a PackageVersion parameter and only builds a specific version that is defined in the Version.proj file of the release.

This issue is mainly about usability, not functionality.

@NightOwl888 NightOwl888 removed up-for-grabs This issue is open to be worked on by anyone good-first-issue Good for newcomers labels Jan 6, 2022
@NightOwl888 NightOwl888 self-assigned this Jan 6, 2022
NightOwl888 added a commit to NightOwl888/lucenenet that referenced this issue Jan 8, 2022
… modified build.bat to only pass the arguments to build.ps1 without doing any processing, only checking for the existence of Powershell. Fixes apache#364.
NightOwl888 added a commit to NightOwl888/lucenenet that referenced this issue Jan 8, 2022
… modified build.bat to only pass the arguments to build.ps1 without doing any processing, only checking for the existence of Powershell. Fixes apache#364.
NightOwl888 added a commit that referenced this issue Jan 8, 2022
… modified build.bat to only pass the arguments to build.ps1 without doing any processing, only checking for the existence of Powershell. Fixes #364.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is:enhancement New feature or request pri:normal
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants