Skip to content

Fixes show build menu sh #2208

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

Closed
wants to merge 2 commits into from
Closed

Fixes show build menu sh #2208

wants to merge 2 commits into from

Conversation

lillo42
Copy link
Contributor

@lillo42 lillo42 commented Sep 11, 2019

Fixes problem to run ShowBuildMenu.sh

@@ -13,7 +13,7 @@ async_generator_path=""

if [ ! -f $BUILD_TOOL_PATH ]
then
dotnet build ./Tools/BuildTool/BuildTool.sln -c Release -o bin
dotnet build ./Tools/BuildTool/BuildTool.sln -c Release -o ./Tools/BuildTool/bin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change causes the binaries to be generated into ./Tools/BuildTool/Tools/BuildTool/bin, which is invalid.
Normally the output is relative to the project file location, not to the command current folder.
In which case would you have it relative to the current folder instead of the project folder?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway, if your case really need a fix, better change the current directory to the project one, run the command as it is currently in master, then switch back to the script directory.

Copy link
Contributor Author

@lillo42 lillo42 Sep 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it not wired we check one folder and build in other path?
/usr/<some user>/nhibernate-core/Tools/BuildTool/bin/BuildTool.dll
/usr/<some user>/nhibernate-core/bin

When I ran ShowBuildMenu.sh I got this error:

Could not execute because the specified command or file was not found.
Possible reasons for this include:
  * You misspelled a built-in dotnet command.
  * You intended to execute a .NET Core program, but dotnet-./Tools/BuildTool/bin/BuildTool.dll does not exist.
  * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
Could not execute because the specified command or file was not found.
Possible reasons for this include:
  * You misspelled a built-in dotnet command.
  * You intended to execute a .NET Core program, but dotnet-./Tools/BuildTool/bin/BuildTool.dll does not exist.
  * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
cat: /home/<user>/nhibernate-core/folder.tmp: No such file or directory
cp: cannot access '/lost+found': Permission denied
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/agpgart': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/audio': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/audio1': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/audio2': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/audio3': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/audioctl': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/console': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/dsp': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/dsp1': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/dsp2': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/dsp3': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/full': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/kmem': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/loop0': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/loop1': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/loop2': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/loop3': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/loop4': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/loop5': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/loop6': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/loop7': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/mem': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/midi0': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/midi00': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/midi01': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/midi02': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/midi03': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/midi1': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/midi2': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/midi3': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/mixer': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/mixer1': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/mixer2': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/mixer3': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/mpu401data': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/mpu401stat': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/null': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/port': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/ram0': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/ram1': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/ram10': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/ram11': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/ram12': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/ram13': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/ram14': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/ram15': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/ram16': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/ram2': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/ram3': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/ram4': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/ram5': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/ram6': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/ram7': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/ram8': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/ram9': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/random': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/rmidi0': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/rmidi1': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/rmidi2': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/rmidi3': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/sequencer': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/smpte0': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/smpte1': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/smpte2': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/smpte3': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/sndstat': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/tty': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/tty0': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/tty1': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/tty2': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/tty3': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/tty4': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/tty5': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/tty6': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/tty7': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/tty8': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/tty9': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/urandom': Operation not permitted
cp: cannot create special file './current-test-configuration/snap/core/7713/dev/zero': Operation not permitted
cp: cannot open '/snap/core/7713/etc/.pwd.lock' for reading: Permission denied
cp: cannot open '/snap/core/7713/etc/gshadow' for reading: Permission denied
cp: cannot open '/snap/core/7713/etc/ppp/chap-secrets' for reading: Permission denied
cp: cannot open '/snap/core/7713/etc/ppp/pap-secrets' for reading: Permission denied
cp: cannot open '/snap/core/7713/etc/security/opasswd' for reading: Permission denied
cp: cannot open '/snap/core/7713/etc/shadow' for reading: Permission denied
cp: cannot access '/snap/core/7713/etc/ssl/private': Permission denied
cp: cannot open '/snap/core/7713/etc/sudoers' for reading: Permission denied
cp: cannot open '/snap/core/7713/etc/sudoers.d/README' for reading: Permission denied
^Xcp: cannot access '/snap/core/7713/root': Permission denied

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not building in another path that the one checked. Re-read my first-comment.

Normally the output is relative to the project file location, not to the command current folder.

The project file is located into ./Tools/BuildTool/, so the bin output folder is created into ./Tools/BuildTool/ by the dotnet command. It works this way with my Debian setup. (dotnet --version was outputing 2.1.403 on my setup, but just incase, I have updated it, and with 2.2.204, it is still working.) By the way, it works the same under Windows with the .bat version.

For now it seems to be only on your setup that it does not work, if that bin does land somewhere else on your device.

And your proposed fix breaks regular setup. It cannot be accepted.

This change causes the binaries to be generated into ./Tools/BuildTool/Tools/BuildTool/bin, which is invalid.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other word you are attempting to fix an issue that we cannot reproduce, and you fix it in a way that causes more issues.
If there is actually anything to fix in that script, you will have to prove it first by supplying enough information for allowing someone else than you to reproduce the issue.

Copy link
Member

@bahusoid bahusoid Sep 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You intended to execute a .NET Core program, but dotnet-./Tools/BuildTool/bin/BuildTool.dll does not exist.

Path is suspiciously prefixed with "dotnet-"

Copy link
Member

@hazzik hazzik Sep 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have faced this myself. The problem is when you run the menu not within the same path (eg not ./ShowBuildMenu.sh, but ./something/ShowBuildMenu.sh). Then it tries to copy root folder (/ - whole file system) into the current-test-configuration folder).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me this often happens when I run ShowBuildMenu.sh from ./src folder (so I run it like ../ShowBuildMenu.sh).

@lillo42 lillo42 closed this Sep 15, 2019
@hazzik
Copy link
Member

hazzik commented Sep 15, 2019

hazzik@pc:/mnt/c/Projects/Private/nhibernate-core/src$ ../ShowBuildMenu.sh
Microsoft (R) Build Engine version 16.2.32702+c4012a063 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1009: Project file does not exist.
Switch: ./Tools/BuildTool/BuildTool.sln
========================= NHIBERNATE BUILD MENU ==========================
--- TESTING ---
A. (Step 1) Set up a new test configuration for a particular database.
B. (Step 2) Activate a test configuration.
C. (Step 3) Run tests.
.
--- BUILD ---
E. Build NHibernate (Debug)
F. Build NHibernate (Release)
.
--- Code generation ---
H. Generate async code (Generates files in Async sub-folders)
.
--- Exit ---
X. Make the beautiful build menu go away.
.
No executable found matching command "dotnet-./Tools/BuildTool/bin/BuildTool.dll"
No executable found matching command "dotnet-./Tools/BuildTool/bin/BuildTool.dll"
cat: /mnt/c/Projects/Private/nhibernate-core/src/folder.tmp: No such file or directory
cp: cannot open '/var/cache/apt/archives/lock' for reading: Permission denied
cp: cannot access '/var/cache/apt/archives/partial': Permission denied

Note how I ran the script.

@fredericDelaporte
Copy link
Member

The "copy root" part is a bit nasty, the script should fail earlier, for sure. (I have got it too, while testing this PR, which was resulting into that copy when launching the script from where it resides.)

@fredericDelaporte
Copy link
Member

Replaced by #2215

@hazzik
Copy link
Member

hazzik commented Sep 17, 2019

Ok, I have now faced the issue which @lillo42 experienced. The problem as it seems is a difference in behavior between 2.2 and 3.0 SDKs. The 2.2 builds like following:

BuildTool -> C:\Projects\Private\nhibernate-core\Tools\BuildTool\bin\BuildTool.dll

And 3.0 (preview 5) like following:

BuildTool -> C:\Projects\Private\nhibernate-core\bin\BuildTool.dll

@bahusoid
Copy link
Member

Should we use dotnet run for solution to avoid such issues?

@fredericDelaporte
Copy link
Member

dotnet run was previously used, but going through compilation was causing the menu to be a bit sluggish.

If that is a preview bug, we may just ignore it.
Or we may dodge that by some cd into the build tool folder, build it, then cd back.

@hazzik
Copy link
Member

hazzik commented Sep 17, 2019

If that is a preview bug, we may just ignore it.

Just tried RC1. The behaviour is the same.

@hazzik
Copy link
Member

hazzik commented Sep 17, 2019

If that is a preview bug, we may just ignore it.

Just tried RC1. The behaviour is the same.

pushd and popd around building build tool should be enough imo. I'll check on mac later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants