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

Update install process to fix class ucode link directives #255

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

brucerennie
Copy link
Collaborator

@brucerennie brucerennie commented Oct 8, 2021

Changes made to the install process for make
1). addition of the compilation and execution of the program fixalllinks
after the installation of the Unicon system into the current system
2). addition of additional class directories that should be transferred on install
3). update the call of fixalllinks to ./fixalllinks (caused problem with debian install process)

Signed-off-by: Bruce Rennie [email protected]

@Jafaral
Copy link
Member

Jafaral commented Oct 8, 2021

@brucerennie DESTDIR can be passed in as an environment variable. It is used by the Debian package build system That is why your PR fails that test now, and the error shows as:

dh_auto_install: error: make -j1 install DESTDIR=/home/runner/work/unicon/unicondist/unicon_13.3\~prerelease/debian/unicon AM_UPDATE_INFO_DIR=no returned exit code 2
make: *** [debian/rules:22: binary] Error 25
dpkg-buildpackage: error: fakeroot debian/rules binary subprocess returned exit status 2
debuild: fatal error at line 1182:
dpkg-buildpackage -us -uc -ui failed
make: *** [Makefile:375: debin] Error 29
Error: Process completed with exit code 2.

@brucerennie brucerennie force-pushed the installchanges branch 2 times, most recently from 5a39cc9 to 77af74a Compare October 8, 2021 19:04
Changes made to the install process for make
    1). addition of the compilation and execution of the program fixalllinks
        after the installation of the Unicon system into the current system
    2). addition of additional class directories that should be transferred on install

Signed-off-by: Bruce Rennie <[email protected]>
It appears that the Debian install process requires ./fixalllinks instead of
fixalllinks without the path specifier.

Signed-off-by: Bruce Rennie <[email protected]>
Copy link
Member

@Jafaral Jafaral left a comment

Choose a reason for hiding this comment

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

Thank @brucerennie , I made a few suggestions, pleas let me know what you think.

@@ -234,7 +244,7 @@ Tbins=unicon icont iconx iconc unicont uniconx uniconc udb uprof unidep unidoc \
ui ivib patchstr iyacc rt.a rt.h

Tdirs=$(DESTDIR)$(ULB) $(DESTDIR)$(UIPL) $(DESTDIR)$(UPLUGINS)
Udirs=lib 3d gui unidoc unidep xml parser
Udirs=lib 3d gui ide unidoc unidep xml parser udb udb/dta udb/lib unicon
Copy link
Member

Choose a reason for hiding this comment

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

Why are we installing these extra directories? Are they being used as libraries similar to the existing dirs ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The extra directories contain useful ucode files. In addition, they also have updateable link directives. I added them for completeness. If you do not want to include them that is your prerogative.

Copy link
Member

Choose a reason for hiding this comment

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

The reason those are not included as the other ones is that they don't contain library files intended to be used by end users. ide, unicon, udb, etc, are meant to be used in their binary forms. They are also not on the IPATH/LPATH like the other ones, and that is why they are not included by default.

@@ -0,0 +1,130 @@
############################################################################
#
# File: fixalllinks.icn
Copy link
Member

Choose a reason for hiding this comment

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

let us give the a more descriptive name in this context, maybe fixucodelinks.icn ?

Also, let us move the file down to a subdirectory. I suggest to uni/progs since we already have utilities there such as idxGen.icn that we use with docs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Any required name changes or location placement changes that you require are a "go" as far as I am concerned. Let me know exactly want you want here and I'll make the appropriate changes.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks @brucerennie

#
# fixalllinks install.dir
#
# Within the Makefile, the install.dir is $(ULB)
Copy link
Member

Choose a reason for hiding this comment

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

The install location for "unicon library files" is $(ULB)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not a problem, I will update the comments shortly.

fname,
bname,
line,
subdirectories := ["3d", "gui", "ide", "lib", "parser", "udb",
Copy link
Member

Choose a reason for hiding this comment

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

It is better if these subdirectories re passed in from the command line. Actually, we don't even have to do them all it was, but we could. Since the Makefile already does the follopwing:

	@for d in $(Udirs); do \
	  echo "Installing uni/$$d to $(DESTDIR)$(ULB)/$$d ..."; \
	  $(INST) -m 644 uni/$$d/*.* $(DESTDIR)$(ULB)/$$d; \
	done

we can just add a call to fix links as we go one directory at a time.

The reason for this is that we don't have change the file itself if we add/remove new subdirectory or if installing some of them became conditionals. Also, by generalizing it, a user can use it to patch ucode files for any reason when they are moved around.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll check first that we can run it in this position and make sure that the code doesn't break.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It is better if these subdirectories re passed in from the command line. Actually, we don't even have to do them all it was, but we could. Since the Makefile already does the follopwing:

	@for d in $(Udirs); do \
	  echo "Installing uni/$$d to $(DESTDIR)$(ULB)/$$d ..."; \
	  $(INST) -m 644 uni/$$d/*.* $(DESTDIR)$(ULB)/$$d; \
	done

we can just add a call to fix links as we go one directory at a time.

The reason for this is that we don't have change the file itself if we add/remove new subdirectory or if installing some of them became conditionals. Also, by generalizing it, a user can use it to patch ucode files for any reason when they are moved around.

If we change to command line parameters, Bruce will have to change the present treatment of the log file. Currently, it is opened with "w" (which will erase the previous log file). We will need a way of starting again at the beginning of a fresh install.

@Jafaral Jafaral requested a review from Don-Ward October 25, 2021 03:58
if exists(destdir || "/" || sd || "/" || infilename || ".old") then {
remove(destdir || "/" || sd || "/" || infilename || ".old")
}
rename(destdir || "/" || sd || "/" || infilename, destdir || "/" || sd || "/" || infilename || ".old")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Rename can fail. Is it worth checking for that?

#
every sd := !subdirectories do {
writes(logfile, "sub-directory:")
destdirfs := open(write(logfile, destdir || "/" || sd), "r")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if it's worth computing prefix := destdir || "/" || sd || "/" and then replacing the multiple instances of destdir || "/" || sd // "/" || ... with prefix || ...

It might not make all that much difference to the run time, but it might make the code slightly easier to read.

No worries if you disagree.

Copy link
Collaborator

@Don-Ward Don-Ward left a comment

Choose a reason for hiding this comment

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

Looks OK. I've made a couple of very minor comments but there are no show-stoppers that I can see.

@Jafaral
Copy link
Member

Jafaral commented Dec 13, 2021

Hi @brucerennie , any updates on this PR ?

@brucerennie brucerennie marked this pull request as draft December 13, 2021 06:14
@brucerennie
Copy link
Collaborator Author

I have converted this pull request to a draft as I have been unable to get back to it due to various other matters.

I will look at this again in the new year and make all appropriate updates per the various suggestions that have been made.

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

Successfully merging this pull request may close these issues.

3 participants