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

Set and clear XML_CATALOG_FILES on activation and deactivation, respectively #82

Merged
merged 2 commits into from
Jan 10, 2023

Conversation

hattne
Copy link
Contributor

@hattne hattne commented Jan 10, 2023

Checklist

  • Used a personal fork of the feedstock to propose changes
  • Bumped the build number (if the version is unchanged)
  • Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
  • Ensured the license file is being packaged.

From conda-forge/libxslt-feedstock#36.

@conda-forge-webservices
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@ocefpaf
Copy link
Member

ocefpaf commented Jan 10, 2023

@hattne not that we will probably need to reset after merging this. See https://conda-forge.org/status/ and conda-forge/status#137 on how to do this, if you have the extra time.

@ocefpaf ocefpaf merged commit de5816d into conda-forge:main Jan 10, 2023
#!/bin/bash

export xml_catalog_files_libxslt="${XML_CATALOG_FILES}"
export XML_CATALOG_FILES="${CONDA_PREFIX}/etc/xml/catalog"
Copy link
Member

Choose a reason for hiding this comment

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

This should also add the system location separated by a space.

ocefpaf added a commit that referenced this pull request Jan 10, 2023
Set and clear XML_CATALOG_FILES on activation and deactivation, respectively
@ghost
Copy link

ghost commented Jan 10, 2023

This changes are causing an issue on Windows OS: the Anaconda Prompt (cmd) started behaving not as expected when lauching and after using conda commands.

To fix it:

  • just need to change recipe/activate.bat to start lines 1 and 2 with @
    (use @set instead of set)
  • and change recipe/desactivate.bat to start lines 1, 2, 4 and 6 with @
    (use @if instead of if and use @set instead of set)

@hattne
Copy link
Contributor Author

hattne commented Jan 10, 2023

  • just need to change recipe/activate.bat to start lines 1 and 2 with @
    (use @set instead of set)
  • and change recipe/desactivate.bat to start lines 1, 2, 4 and 6 with @
    (use @if instead of if and use @set instead of set)

Would @echo off at the top of both files be a cleaner solution?

@ghost ghost mentioned this pull request Jan 10, 2023
5 tasks
@ghost
Copy link

ghost commented Jan 11, 2023

@hattne, yes, adding the @echo off at the top of recipe/activate.bat and recipe/desactivate.bat is an nice solution, I had already tested it and works. Thanks!

@acaprez
Copy link

acaprez commented Jan 11, 2023

Just an FYI, this change causes issues in environments that have unset variable checking (i.e. set -u) enabled:

/anaconda/etc/conda/activate.d/libxml2_activate.sh: line 3: XML_CATALOG_FILES: unbound variable

@ghost
Copy link

ghost commented Jan 11, 2023

@hattne , I had noticed that in Windows OS there is no folder etc/xml/catalog in Anaconda installation.
Since the purpose of this changes are to create/change the environment variable XML_CATALOG_FILES to be assigned to etc/xml/catalog, does it still makes sense apply this changes for Windows OS?
For exemple, I cite the following reference in http://www.sagehill.net/docbookxsl/UseCatalog.html where Windows is excluded from assigning XML_CATALOG_FILES=etc/xml/catalog (as there is no xsltproc catalog folder etc/xml/catalog in Windows)

By default, xsltproc looks for an XML catalog file named /etc/xml/catalog (except on Windows, for which there is no default location)

@g-rutter
Copy link

g-rutter commented Jan 12, 2023

@hattne this breaks my org's workflow with the error @acaprez pointed out. Could we please check for the existence of the variable before access? Something like

export xml_catalog_files_libxslt="${XML_CATALOG_FILES:-}"

might be what you want.

Edit: Same may be needed in deactivate.sh and other places

@jakirkham
Copy link
Member

Note: These packages have been marked broken ( conda-forge/admin-requests#649 )

@hattne
Copy link
Contributor Author

hattne commented Jan 13, 2023

@hattne , I had noticed that in Windows OS there is no folder etc/xml/catalog in Anaconda installation. Since the purpose of this changes are to create/change the environment variable XML_CATALOG_FILES to be assigned to etc/xml/catalog, does it still makes sense apply this changes for Windows OS?

I think yes, because it provides the path to where other packages will read or write catalog information. libxml2 itself does not provide any catalogs, just the infrastructure to manipulate them and XML_CATALOG_FILES is part of that infrastructure.

@ReimarBauer
Copy link

Our scheduled build runs in this problem on linux and MacOS

/home/runner/Miniforge/envs/mssenv/etc/conda/deactivate.d/libxml2_deactivate.sh: line 3: xml_catalog_files_libxml2: unbound variable

https://github.com/Open-MSS/mss-install/actions/runs/10035304064/job/27731093204#step:3:1200

@hattne
Copy link
Contributor Author

hattne commented Jul 23, 2024

/home/runner/Miniforge/envs/mssenv/etc/conda/deactivate.d/libxml2_deactivate.sh: line 3: xml_catalog_files_libxml2: unbound variable

The unbound-variable issue in libxml2_deactivate.sh was addressed in b98cd64.

It seems your build is pulling in libxml2-2.10.3_4 on line 971. I don't know what's causing that, but I suspect it's what's causing the breakage. You'll need libxml2-2.10.3_6 or later for the fix.

@jakirkham
Copy link
Member

Please open a new bug issue on the feedstock with all the info requested if you are still seeing issues

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.

7 participants